maybeyonaspost_airdrop_stats
    Updated 2021-10-19
    -- LETS FIND THE CLAIMS FIRST
    with airdrop_claims as(
    select
    block_timestamp,
    claimer,
    amount,
    -- contract_address,
    case contract_address
    when 'terra1atch4d5t25csx7ranccl48udq94k57js6yh0vk' then 'loop' -- i guess'
    end as airdrop_name,
    case contract_address
    when 'terra1atch4d5t25csx7ranccl48udq94k57js6yh0vk' then 'terra1nef5jf6c7js9x6gkntlehgywvjlpytm7pcgkn4' -- loop
    end as token_contract
    from terra.airdrop_claims
    ),
    -- CAUSE USERS MAKE MULTIPLE CLAIMS IN A DAY, WE WILL GROUP BY DATE TO REDUCE COMPLEXITY
    claim_txs as(
    select
    date(block_timestamp) as date,
    claimer,
    -- contract_address,
    airdrop_name,
    token_contract,
    count(amount) as claims,
    sum(amount) as amt_claimed
    from airdrop_claims
    group by 1,2,3,4
    ),
    -- ALL BUY TRANSACTIONS OF AIRDROP TOKEN
    buy as (
    select
    block_timestamp,
    event_attributes:to::string as user,
    event_attributes:ask_asset as token_contract,
    case event_attributes:ask_asset
    when 'terra1nef5jf6c7js9x6gkntlehgywvjlpytm7pcgkn4' then 'loop'
    Run a query to Download Data