IBC_insiderAlgorand mega 20
    Updated 2023-01-03
    with prices as (
    with flow_prices as (
    select block_timestamp::date as date, avg(TOKEN_OUT_AMOUNT)/avg(TOKEN_IN_AMOUNT) as flow_price
    from flow.core.ez_swaps
    where TOKEN_OUT_CONTRACT = 'A.cfdd90d4a00f7b5b.TeleportedTetherToken'
    and TOKEN_IN_CONTRACT = 'A.1654653399040a61.FlowToken'
    group by 1
    ), wbtc_prices as (
    select hour::date as date, avg(price) as wbtc_price
    from ethereum.core.fact_hourly_token_prices
    where symbol = 'WBTC'
    group by 1
    ), weth_prices as (
    select hour::date as date, avg(price) as weth_price
    from ethereum.core.fact_hourly_token_prices
    where symbol = 'WETH'
    group by 1
    ), matic_prices as (
    select hour::date as date, avg(price) as matic_price
    from ethereum.core.fact_hourly_token_prices
    where symbol = 'MATIC'
    group by 1
    ), ftm_prices as (
    select hour::date as date, avg(price) as ftm_price
    from ethereum.core.fact_hourly_token_prices
    where symbol = 'FTM'
    group by 1
    ), bnb_prices as (
    select BLOCK_TIMESTAMP::date as date, avg(ASSET_USD) as bnb_price
    from flipside_prod_db.thorchain.prices
    where POOL_NAME = 'BNB.BNB'
    group by 1
    ), sportium_prices as (
    select timestamp::date as date, avg(price_usd) as Sportium_price
    from flow.core.fact_prices
    where token = 'Sportium'
    Run a query to Download Data