Updated 2024-01-09
    with claim_gas_used as (
    select
    date_trunc('hour', f.BLOCK_TIMESTAMP) as dates,
    count(case when STATUS = 'SUCCESS' then f.FROM_ADDRESS end) as users,
    sum(amount) as claimed_amount
    --sum(amount_usd) as claim_usd_amt
    from bsc.core.fact_transactions f
    join bsc.core.ez_token_transfers e on f.TX_HASH = e.TX_HASH
    where
    --f.BLOCK_TIMESTAMP >= '2023-12-27 09:00:00.000'
    --and
    f.TO_ADDRESS = lower('0x7Bf27D1c4F7fdfC242E85E20B4b63734285f7996')
    and e.contract_address = lower('0x75E8ddB518bB757b4282cd5b83bb70d4101D12FB')
    and f.ORIGIN_FUNCTION_SIGNATURE = '0x3b439351'
    group by 1)


    select
    dates,
    --71 as airdrop_amt, -- 71,000,000
    --710 as total_supply, -- 710,000,000
    ifnull(claimed_amount,0) as claimed_amount,
    ifnull(users,0) as claimers,
    sum(ifnull(claimed_amount,0)) over(order by dates asc) as cum_claimed_amount,
    71000000 - sum(ifnull(claimed_amount,0)) over(order by dates asc) as cum_unclaimed_amount,
    sum(ifnull(users,0)) over(order by dates asc) as cum_claimers
    from claim_gas_used
    order by 1 asc


    QueryRunArchived: QueryRun has been archived