Query editor
-- Which attribution threshold is right?-- Dune parameters: HcRLc9VDgjLeK154xDawfb1dmVJ98DoSqcwTHGqiDeJR A7bdiYdS5GjqGFtxf17ppRHtDKPkkRqbKtR27dxvQXaS 5KXDF6QnqhBj72hDtJNkkpFaQVUfbFXNybMsp3DiK6tD 2026-08-30---- At 0.9 the ZEC total lands within ~5% of StonkFun but the payout count is 27%-- short, which says genuine ZCAT batches are being dropped rather than the total-- being coincidentally right. The likely cause is the tail of the holder list:-- StonkFun pays smallest balances last, and a wallet that has since sold out-- carries a zero balance forward, so its batch scores low.---- This reruns the attribution at several thresholds at once. The right one makes-- ZEC, payouts AND wallets agree with StonkFun simultaneously -- a threshold that-- fixes the total while wrecking the wallet count is overreaching into other-- coins' batches.---- StonkFun, 9 Sep 2026 06:27 UTC: 3,633.02 ZEC / 766,048 payouts / 23,673 wallets.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'),balance_spans AS (SELECTtoken_balance_owner AS wallet,day AS valid_from,coalesce(lead(day) OVER (PARTITION BY token_balance_owner ORDER BY day),TIMESTAMP '2999-01-01') AS valid_to,token_balanceFROM solana_utils.daily_balancesWHERE token_mint_address = 'HcRLc9VDgjLeK154xDawfb1dmVJ98DoSqcwTHGqiDeJR'AND day >= TIMESTAMP '2026-08-30'),held AS (SELECT wallet, valid_from, valid_toFROM balance_spansWHERE token_balance > 0),tagged AS (SELECTp.tx_id,p.wallet,p.amount,CASE WHEN h.wallet IS NOT NULL THEN 1.0 ELSE 0.0 END AS is_holderFROM payouts pLEFT JOIN held hON h.wallet = p.walletAND date_trunc('day', p.block_time) >= h.valid_from