hessTotal per token
    Updated 2023-11-16
    with woofi as ( select block_timestamp,
    token_in as token_address,
    symbol_in as symbol,
    tx_hash,
    origin_from_address,
    pool_name,
    case when amount_in_usd is null then amount_out_usd
    when amount_out_usd is null then amount_in_usd
    when amount_in_usd>=amount_out_usd then amount_in_usd
    when amount_out_usd>amount_in_usd then amount_out_usd end as amount_usd
    from avalanche.defi.ez_dex_swaps
    where platform = 'woofi'
    UNION
    select block_timestamp,
    token_out as token_address,
    symbol_out as symbol,
    tx_hash,
    origin_from_address,
    pool_name,
    case when amount_in_usd is null then amount_out_usd
    when amount_out_usd is null then amount_in_usd
    when amount_in_usd>=amount_out_usd then amount_in_usd
    when amount_out_usd>amount_in_usd then amount_out_usd end as amount_usd
    from avalanche.defi.ez_dex_swaps
    where platform = 'woofi'
    )

    select trunc(block_timestamp,'month') as date,
    symbol,
    count(DISTINCT(tx_hash)) tx,
    count(*) as swaps,
    swaps/tx as "Avg Swap per Tx",
    count(DISTINCT(origin_from_address)) as users,
    sum(amount_usd/2) as usd_volume,
    sum(usd_volume) over (order by date asc) as "Cumulative Volume",
    avg(amount_usd) as "Avg Volume Per User",
    Run a query to Download Data