boomer77Untitled Query
    Updated 2022-02-09
    with anc as (select sender, sum(claim_1_amount) as total_claimed, count(tx_id) as tx_count
    from anchor.reward_claims
    where block_timestamp between '2022-01-01' and '2022-01-31'
    group by 1),

    claim as (select date_trunc('day', block_timestamp) as dt, sum(claim_1_amount) as claim_anc
    from anchor.reward_claims
    where block_timestamp between '2022-01-01' and '2022-01-31'
    group by 1),
    stake as (select date_trunc('day', block_timestamp) as dt, sum(amount) as stake_ANC
    from anchor.gov_staking
    where sender in (select sender from anc) and event_type = 'stake'
    group by 1)

    select a.dt, a.claim_anc, b.stake_anc
    from claim a
    join stake b on a.dt = b.dt
    Run a query to Download Data