mariaaSwap Analytic
    Updated 2024-10-21
    select date_trunc('week',block_timestamp) as date,
    SUM(COALESCE(FROM_AMOUNT_USD, TO_AMOUNT_USD)) as "Volume USD",
    COUNT(*) as swaps,
    sum("Volume USD") over (order by date) as "Cumulative Volume",
    sum(swaps) over (order by date) as "Cumulative Swaps"
    from thorchain.defi.fact_swaps
    where block_timestamp::DATE >= '2024-01-01'
    and affiliate_address in ('td','ti','tr','te')
    group by 1
    order by 1 asc
    QueryRunArchived: QueryRun has been archived