Query editor
/*Query calculates daily running:-- Volume of $APE held by $APE airdrop recipients-- Volume of $APE staked by $APE airdrop recipients-- Number of $APE airdrop recipients still holding / staking $APE*/with-- 1. Getting wallets of airdrop recipientsclaimers as (select claimer from query_4000101),-- 2. Calculating net balance per day for all token holdersbalances as (selectwallet,date_trunc('day', evt_block_time) as day,sum(value) as balancefrom (select "to" as wallet, evt_block_time, value / 1e18 as valuefrom erc20_ethereum.evt_transferwhere contract_address = 0x4d224452801aced8b2f0aebe155379bb5d594381union allselect "from" as wallet, evt_block_time, -value / 1e18 as valuefrom erc20_ethereum.evt_transferwhere contract_address = 0x4d224452801aced8b2f0aebe155379bb5d594381) as transfersgroup by wallet, date_trunc('day', evt_block_time)),-- 3. Creating a time series of unique datesunique_dates as (select distinct date_trunc('day', evt_block_time) as dayfrom erc20_ethereum.evt_transferwhere contract_address = 0x4d224452801aced8b2f0aebe155379bb5d594381),-- 4. Combine all wallet balances and dates]wallets_and_dates as (selectc.claimer as wallet,ud.day as dayfrom claimers ccross join unique_dates ud),-- 5. Joining airdrop wallets and dates with those wallets' daily balancesdaily_wallet_balances as (selectwad.wallet,wad.day,coalesce(balances.balance, 0) as balancefrom wallets_and_dates wadleft join balanceson wad.wallet = balances.wallet and wad.day = balances.day),