hessMonthly Swaps Per Platform
    Updated 2024-11-27
    with base as ( select trunc(block_timestamp,'hour') as hourly,
    tx_hash,
    origin_from_address,
    pool_name,
    platform,
    amount_in_usd,
    amount_out_usd,
    AMOUNT_IN,
    AMOUNT_Out,
    TOKEN_IN,
    TOKEN_out,
    symbol_in,
    symbol_out
    from avalanche.defi.ez_dex_swaps
    where block_timestamp::date >= '2023-01-01')
    ,
    price_base as ( select hour,
    token_address,
    price
    from avalanche.price.ez_prices_hourly)
    ,
    base1 as ( select hourly,
    tx_hash,
    origin_from_address,
    pool_name,
    amount_in_usd,
    platform,
    amount_out_usd,
    TOKEN_IN,
    TOKEN_out,
    symbol_in,
    symbol_out,
    amount_in*b.price as amt_in_usd,
    amount_out*c.price as amt_out_usd,
    case when amount_in_usd is null then amount_out_usd else amount_in_usd end as volume_1,
    case when amt_in_usd is null then amt_out_usd else amt_in_usd end as volume_2,
    QueryRunArchived: QueryRun has been archived