BlockTrackeroverview
    Updated 2025-04-14
    with one_month_volume as (
    select
    sum(coalesce(from_amount_usd,to_amount_usd)) as one_month_volume
    from maya.defi.fact_swaps
    where block_timestamp::date > current_date - interval '1 month'
    and tx_id not in (select tx_id from maya.defi.fact_refund_events)
    )

    ,
    sevent_days_volume as (
    select
    sum(coalesce(from_amount_usd,to_amount_usd)) as one_week_volume
    from maya.defi.fact_swaps
    where block_timestamp::date > current_date - interval '1 week'
    and tx_id not in (select tx_id from maya.defi.fact_refund_events)
    )
    ,
    one_day_volume as (
    select
    sum(coalesce(from_amount_usd,to_amount_usd)) as one_day_volume
    from maya.defi.fact_swaps
    where block_timestamp > current_date - interval '24 hours'
    and tx_id not in (select tx_id from maya.defi.fact_refund_events)
    -- and block_timestamp::date > current_date - interval '1 day'
    )

    select
    one_month_volume as "30 Days Volume $",
    one_week_volume as "7 Days Volume $",
    one_day_volume as "24 Hours Volume $"
    from one_month_volume a
    left join sevent_days_volume b ON TRUE
    left join one_day_volume c ON TRUE



    QueryRunArchived: QueryRun has been archived