Query editor
-- Bonus: wallets whose first-ever ZEC arrived as a ZCAT reward. Title: test-- Reads payouts_attributed.sql; replace query_0000000 with its Dune query id.-- Dune parameter: A7bdiYdS5GjqGFtxf17ppRHtDKPkkRqbKtR27dxvQXaS---- This is the one query with no date floor, on purpose. A wallet only counts if-- it had never received ZEC before, so first_inbound has to see the mint's whole-- history -- bounding it to ZCAT's launch would classify long-time ZEC holders as-- newly onboarded. That makes it the most expensive query here; materialise-- first_inbound if credits are tight.---- first_inbound deliberately scans ALL incoming ZEC, not just distributor-- payouts -- the metric only means something if a wallet had no other way of-- getting ZEC first. A Solana wallet cannot have held ZEC anywhere else, so-- "first-ever" here means first on Solana.WITH first_inbound AS (SELECTto_owner AS wallet,min(block_time) AS first_quote_timeFROM tokens_solana.transfersWHERE token_mint_address = 'A7bdiYdS5GjqGFtxf17ppRHtDKPkkRqbKtR27dxvQXaS'AND to_owner IS NOT NULLAND action IN ('transfer', 'mintTo')GROUP BY 1),first_reward AS (SELECTwallet,min(block_time) AS first_reward_timeFROM (-- Attributed reward payouts. Paste in Dune as its own query; every other file in-- sql/rewards/ reads it back as query_0000000. Dashboard title: test---- Dune parameters:-- HcRLc9VDgjLeK154xDawfb1dmVJ98DoSqcwTHGqiDeJR HcRLc9VDgjLeK154xDawfb1dmVJ98DoSqcwTHGqiDeJR (ZCAT)-- A7bdiYdS5GjqGFtxf17ppRHtDKPkkRqbKtR27dxvQXaS A7bdiYdS5GjqGFtxf17ppRHtDKPkkRqbKtR27dxvQXaS (ZEC, classic SPL)-- 5KXDF6QnqhBj72hDtJNkkpFaQVUfbFXNybMsp3DiK6tD 5KXDF6QnqhBj72hDtJNkkpFaQVUfbFXNybMsp3DiK6tD-- 0.5 0.5 (calibrated -- see threshold_sweep.sql)-- 2026-08-30 2026-08-30 (the pair's launch day)---- Set every parameter's default value before running. Dune substitutes an empty-- string for a blank parameter, which matches no rows and looks like "no results"-- rather than an error. 2026-08-30 is not optional either: without it this-- scans the whole of tokens_solana.transfers.---- Why attribution is needed: StonkFun pays every reward coin quoted in the same-- asset out of one token account, and the payout transaction names no reward-- coin -- it is ~20 bare transferChecked instructions, no memo, no CPI. For ZEC,-- ZCAT is only 77% of the volume and 61% of the payouts leaving that account, so-- filtering on the distributor alone overstates ZCAT by 29% and 65%.---- What makes it tractable: one transaction pays holders of exactly one coin, and-- the holder list is walked in descending balance order. So the batch, not the-- wallet, is the unit of attribution -- a wallet can hold several coins quoted in-- the same asset, but a batch belongs to one of them. A simple majority is the-- rule: 0.5 is where ZEC, payout count and wallet count all match StonkFun at-- once. Stricter thresholds drop the tail of the holder list, where wallets that-- have since sold carry a zero balance forward and score low.