Query editor
WITHpyth_airdrop_claimed AS (SELECTABS(SUM(token_balance_change)) - 4 AS airdrop_claimed,((ABS(SUM(token_balance_change)) - 4) / 250134630) * 100 AS airdrop_claimed_pct,block_dateFROMsolana.account_activityWHEREblock_date >= DATE '2023-11-20'AND (address = '9aDZy2BkW84u667ZMcFJS5evABPDnvvF48tdqsidLGfh'OR address = 'Hqfb1UmTXhQuLp9HVGszSfcKy7THnS4BhCFqEQNya5gy')AND token_mint_address = 'HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3'AND tx_id != '5QQ4EPhtYWDVgja4M6MiBSFVhfxvZfTVTi2VifaEeZRjmFBtmAuNuFe9SZ6LVJH5s6hxCbfAGAmNqHVXfmAZgoNK' -- Transfer back to PDAAND tx_id != '67naiLNJC4JKtoyQGUMN1Rgup6Ef1zDTZRxUvayRRE65PybBhdLJWX5KxpUnYMNVWbx9x8Q6gYjM84yjfhzGyQx6' -- Top up airdrop from PDAGROUP BY 3),created_pos_signers as (selectcall_block_date,sum(amount) as created_posfrompyth_solana.staking_call_createPositionwherecall_block_date >= date '2023-11-16' -- date when the first 600m is stakedgroup bycall_block_date),closed_pos_signers as (selectcall_block_date,sum(amount) as closed_posfrompyth_solana.staking_call_closePositionwherecall_block_date >= date '2023-11-16'group bycall_block_date),staking_per_day AS (SELECTcps.call_block_date AS day,(CAST(coalesce(cps.created_pos, 0) AS BIGINT) - CAST(coalesce(closed.closed_pos, 0) AS BIGINT)) / 1000000 AS amount,SUM((CAST(coalesce(cps.created_pos, 0) AS BIGINT) - CAST(coalesce(closed.closed_pos, 0) AS BIGINT)) / 1000000) OVER (ORDER BY cps.call_block_date) AS cumulative_amountFROMcreated_pos_signers cpsLEFT JOIN closed_pos_signers closed ON cps.call_block_date = closed.call_block_dateGROUP BY1, 2)SELECTp.airdrop_claimed,ROUND(SUM(p.airdrop_claimed_pct) OVER (ORDER BY p.block_date), 2) AS accumulated_airdrop_claimed_pct,s.amount AS daily_staking_amount,s.cumulative_amount AS cumulative_staking_amount,p.block_dateFROM