BlockTrackerMonthly swap volume
    Updated 2025-04-14
    select
    date_trunc('month', block_timestamp) as date,
    sum(coalesce(from_amount_usd, to_amount_usd)) as swap_volume ,
    count(distinct tx_id) as n_swaps,
    count(distinct from_address) as n_swappers,
    sum(LIQ_FEE_CACAO_USD) as swap_fee ,
    avg(case when block_timestamp >= '2023-05-07' then SWAP_SLIP_BP else 0 end) as AVG_SWAP_SLIP_BP
    from maya.defi.fact_swaps
    where tx_id not in (select tx_id from maya.defi.fact_refund_events)
    group by 1
    order by 2 desc



    QueryRunArchived: QueryRun has been archived