Query editor
-- On-chain vs StonkFun API. Dashboard title: test-- Reads payouts_attributed.sql; replace query_0000000 with its Dune query id.-- Dune parameter: HcRLc9VDgjLeK154xDawfb1dmVJ98DoSqcwTHGqiDeJR---- dune.andrayondune.dataset_stonkfun_snapshot is the StonkFun snapshot written by `python -m src.stonkfun`.-- It is the closest thing to ground truth for this pair, but it only ever carries-- lifetime totals, so it checks the endpoint of our series, not its shape.-- Anything short of ~100% is a finding to explain, not a number to force.WITH ours AS (SELECTcount(DISTINCT wallet) AS wallets,sum(amount) AS quote_distributed,count(*) AS payoutsFROM (-- 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.WITH payouts AS (SELECTblock_time,tx_id,to_owner AS wallet,amount_display AS amountFROM tokens_solana.transfersWHERE token_mint_address = 'A7bdiYdS5GjqGFtxf17ppRHtDKPkkRqbKtR27dxvQXaS'AND from_owner = '5KXDF6QnqhBj72hDtJNkkpFaQVUfbFXNybMsp3DiK6tD'AND action = 'transfer'AND to_owner IS NOT NULLAND block_time >= TIMESTAMP '2026-08-30'),-- solana_utils.daily_balances carries a row only when an address's balance-- CHANGED that day -- it is sourced from solana.account_activity and is not a