Query editor
-- select wallet, behalf_stake/1e18 from dune.abtokenomics.moca_behalf_staking-- select count (wallet) from dune.abtokenomics.moca_behalf_staking-- select distinct(behalf_stake/1e18) from dune.abtokenomics.moca_behalf_staking-- the problem is that the gsheet features only 5 diff sums for Moca ID airdrop, but then I have 24 unique values here-- so for the PoC purposes I have to trust behalfStake 1) ONLY included MOCA ID Airdrop 1 2) All eligible MOCA ID wallets were staken on behalf of-- I could additionally look up MOCA ID contract on Polygon -> Identify operators of each ID (aka end-users) + look up metadata for each MOCA ID to map MOCA ID handles with operator wallet addresses => Atm, I think this should be only if Moca team buys into this-- TO TRACK---- $MOCA (tokens / in USD) airdropped (aka staked on behalf)---- Wallets # airdropped to---- Out of those wallets:------ Wallets unstaked their airdrop => meaning 0 staking balance at some point------ Wallets partly unstaked => meaning staking balance < initial at some point------ Wallets staked more on top => meaning staking balance > initial at some point------ Wallets with multiple stakes & unstakes => meaning N > 1 staking and M > 1 unstaking txnsWITH-- 1. Fetching min and max days for the staking contract (since Moca ID airdrop autostaked)airdrop_range AS (SELECTCAST(MIN(DATE_TRUNC('day', evt_block_time)) AS DATE) AS start_date,CAST(MAX(DATE_TRUNC('day', evt_block_time)) AS DATE) AS end_dateFROM erc20_ethereum.evt_transferWHERE contract_address = 0x9a98E6B60784634AE273F2FB84519C7F1885AeD2),-- 2. Creating time series based on min and max daystime_series AS (SELECT DATE_TRUNC('day', time) AS dayFROM unnest(SEQUENCE((SELECT start_date FROM airdrop_range),(SELECT end_date FROM airdrop_range),INTERVAL '1' DAY)) AS s(time)),-- 3. Calculating behalf stakes per day, cuz behalf stake statsairdrop_stats AS (SELECTCOUNT(DISTINCT a.wallet) AS airdrop_wallets,SUM(a.behalf_stake/1e18) AS airdrop_tokens,SUM(a.behalf_stake/1e18 * COALESCE(b.med_token_price, 0.1168)) AS airdrop_usdFROM dune.abtokenomics.moca_behalf_staking aLEFT JOIN query_4718736 b ON DATE_TRUNC('day', a.tx_date) = b.day-- WHERE a.behalf_stake / 1e18 IN (2271.29, 4528.53, 9620.28, 18917.05, 31810.26) -- LIMIT results to behalf stake of these exact amounts from the Airdrop 1 design doc),-- 4. Check wallet activity: behalf stake date, unstake & stake dates if any, to further categorize walletsunstaked_below_airdrop AS (SELECTCOUNT(DISTINCT wallet) AS cnt_wallets_unstakedFROM query_4734950WHERE net_stake_includes_airdrop = 0),staked_above_airdrop AS (SELECTCOUNT(DISTINCT wallet) AS cnt_wallets_stakedFROM query_4734950WHERE net_stake - airdrop_tokens > 0),restaked AS (SELECT