BlockTrackeroverview
    Updated 2025-04-12
    select
    date_trunc('{{granularity}}', block_timestamp) as date,
    count(distinct tx_id) as n_txns,
    sum(n_txns) over (order by date) as cum_txns,
    count(DISTINCT from_address) as n_users,
    sum(coalesce(from_amount_usd, to_amount_usd)) as volume,
    sum(volume) over (order by date) as cum_volume ,
    avg(from_amount_usd) as avg_volume,
    median(from_amount_usd) as median_volume ,
    n_txns / n_users as n_users_per_txns
    from thorchain.defi.fact_swaps
    where affiliate_address IN ('okw','okw/-_')
    and date >= dateadd(month, -{{past_months}},current_date)
    group by 1
    order by date desc




    QueryRunArchived: QueryRun has been archived