mhmUSDC marketcap
    Updated 2022-10-09
    with
    ins as (
    select
    trunc(block_timestamp,'day') as date,
    sum(amount) as amount_in
    from solana.core.fact_transfers x
    join solana.core.dim_labels y on x.tx_from = y.address
    where mint='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' --USDC
    group by 1
    ),
    outs as (
    select
    trunc(block_timestamp,'day') as date,
    sum(amount) as amount_out
    from solana.core.fact_transfers x
    join solana.core.dim_labels y on x.tx_to = y.address
    where mint='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' --USDC
    group by 1
    ),
    final as (
    select
    x.date,
    amount_in,amount_out*(-1) as amount_outs,
    amount_in - amount_out as netflow,
    sum(amount_in) over (order by x.date) as total_amount_in,
    sum(amount_out) over (order by x.date) as total_amount_out,
    total_amount_in-total_amount_out as USDC_marketcap
    from ins x
    join outs y on x.date=y.date
    order by 1 asc
    )
    select * from final where date >= '2022-09-01'
    Run a query to Download Data