elsina✅ Stablecoins: single numbers - average
    Updated 2023-08-09
    with base as (
    select *
    from osmosis.core.dim_labels
    where (project_name ilike '%DAI%' or project_name ilike '%USDC%' or project_name ilike '%USDT%' or project_name like '%EUR%')
    ),
    info as (
    select
    date_trunc('day', block_timestamp) as "Day",
    count(distinct tx_id) as "tx count",
    count(distinct sender) as "Active users",
    sum(amount/pow(10, decimal)) as "Volume"
    from osmosis.core.fact_transfers a join base b on a.currency = b.address
    where
    tx_succeeded = TRUE and
    amount/pow(10, decimal) < 1000000000 and
    "Day" >= current_date - 90
    group by 1
    ),
    avg_info as (
    select
    avg("tx count") as "AVG tx count",
    avg("Active users") as "AVG Active users",
    avg("Volume") as "AVG Volume"
    from info
    )
    select *
    from avg_info
    Run a query to Download Data