Updated 2024-02-18
    with avax_price as (SELECT price
    FROM avalanche.price.ez_hourly_token_prices
    WHERE symbol = 'WAVAX'
    ORDER BY hour DESC LIMIT 1)
    SELECT
    count(DISTINCT t.tx_hash) as txs,
    sum(amount_in_usd + amount_out_usd) / 2 as vol,
    sum(tx_fee) as total_fee,
    sum(tx_fee) * (SELECT price FROM avax_price) as total_fee_usd,
    count(DISTINCT token_in) as tokens_from,
    count(DISTINCT token_out) as tokens_to,
    count(DISTINCT pool_name) as pools
    FROM avalanche.core.fact_transactions t
    JOIN avalanche.defi.ez_dex_swaps s on t.tx_hash = s.tx_hash
    WHERE origin_from_address = lower('{{Address}}')
    AND platform IN ('trader-joe-v2', 'trader-joe-v1')


    Last run: about 1 year agoAuto-refreshes every 3 hours
    TXS
    VOL
    TOTAL_FEE
    TOTAL_FEE_USD
    TOKENS_FROM
    TOKENS_TO
    POOLS
    1
    78538134029472.123736.773254299150265.370792773131336
    1
    63B
    435s