Query editor
-- On-chain vs StonkFun API. Dashboard title: test-- Reads payouts_attributed.sql; replace query_0000000 with its Dune query id.-- Dune parameter: Ga5ErptAQ5oHwB7G195UEq9FeJ5UNDoV9SCRCpebFeG7---- dune.andre_111.test4 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 query_8656808),theirs AS (SELECT holder_count, distributed_tokens, payout_countFROM dune.andre_111.test4WHERE reward_mint = 'Ga5ErptAQ5oHwB7G195UEq9FeJ5UNDoV9SCRCpebFeG7'ORDER BY captured_at DESCLIMIT 1),pairs AS (SELECT 'Quote distributed' AS metric, o.quote_distributed AS ours, t.distributed_tokens AS stonkfunFROM ours o CROSS JOIN theirs tUNION ALLSELECT 'Unique wallets rewarded', CAST(o.wallets AS double), CAST(t.holder_count AS double)FROM ours o CROSS JOIN theirs tUNION ALLSELECT 'Reward payouts', CAST(o.payouts AS double), CAST(t.payout_count AS double)FROM ours o CROSS JOIN theirs t)SELECTmetric,ours,stonkfun,ours - stonkfun AS diff,100.0 * ours / nullif(stonkfun, 0) AS pct_matchFROM pairs