MasiDaily New Traders
    Updated 2024-10-26
    with tb1 as ( select trunc(block_timestamp,'hour') as hourly,
    platform,
    tx_hash,
    trader,
    amount_in_usd,
    amount_out_usd,
    SYMBOL_OUT,
    amount_in,
    amount_out,
    symbol_in,
    TOKEN_OUT_CONTRACT,
    TOKEN_IN_CONTRACT,
    case when amount_in_usd is null then amount_out_usd else amount_in_usd end as vol
    from near.defi.ez_dex_swaps
    where platform in ('ref-playground.near','v2.ref-finance.near','ref.marior.near','ref-finance.near')
    )
    ,
    tb2 as ( select hour,
    token_address,
    symbol,
    avg(price) as avg_price
    from crosschain.price.ez_prices_hourly
    where blockchain = 'near'
    group by 1,2,3
    UNION
    select HOUR,
    'wrap.near' as token_address,
    'wNEAR' as symbol,
    avg(price) as avg_price
    from near.price.ez_prices_hourly
    where symbol = 'WNEAR'
    group by 1,2,3 )
    ,
    tb3 as ( select hourly::date as date,
    platform,
    tx_hash,
    QueryRunArchived: QueryRun has been archived