saeedmznBridge Volume - tokens volume
    Updated 2022-07-01
    with eth_prices as ( select
    date_trunc(day,HOUR) as date ,
    case
    when SYMBOL='WBTC' then 'ceWBTC'
    when SYMBOL='WETH' then 'ceWETH'
    when SYMBOL='MATIC' then 'ceMATIC'
    when SYMBOL = 'aUSDT' then 'ceUSDT'
    when SYMBOL = 'BUSD' then 'ceBUSD'
    when SYMBOL ='FTM' then 'ceFTM'
    end as token ,
    avg(PRICE) as price
    from ethereum.core.fact_hourly_token_prices
    group by 1,2 having token is not NULL
    ),
    flow_prices as (
    select date_trunc(day,TIMESTAMP) as date ,
    case when token = 'Blocto Token' then 'BloctoToken'
    when token = 'Starly' then 'StarlyToken'
    when token = 'REVV' then 'REVV'
    when token = 'Flow' then 'FlowToken'
    end as token_ ,
    avg(PRICE_USD) as price
    from flow.core.fact_prices
    where SOURCE = 'coingecko'
    group by 1,2 having token_ is not NULL
    ),
    ALL_prices as (
    select date , token , price from eth_prices
    UNION all
    select date , token_ as token , price from flow_prices
    ),
    bridge as (
    select
    BLOCK_TIMESTAMP::date as date ,
    CONTRACT_NAME as token ,
    DIRECTION ,
    Run a query to Download Data