hessTotal
    Updated 2023-11-16
    with woofi as ( select block_timestamp,
    tx_hash,
    origin_from_address,
    pool_name,
    symbol_in,
    symbol_out,
    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 count(DISTINCT(block_timestamp::date)) as days,
    count(DISTINCT(tx_hash)) tx,
    count(*) as swaps,
    swaps/tx as "Avg Swap per Tx",
    count(DISTINCT(origin_from_address)) as users,
    users/days as "Swappers per day",
    sum(amount_usd) as usd_volume,
    usd_volume/users as "Avg Volume per User",
    tx/users as "Avg Tx Per User"
    from woofi

    Run a query to Download Data