Query editor
/* ===================================================STAGE 2h: WALLET MASTER TABLE (the one file for the replication package)Save as dune.boc.result_wallet_master, then download as CSV.One row per (wallet, country) for ALL linked wallets from Stage 1(1,202,096 rows), with how it was linked, the inputs to every filter,every flag, and the step at which it left the sample. Every count inthe paper's sample tables and the attrition table can be computed fromthis file alone.dropped_at (first step that removes the row, in attrition order):'institutional' institutional label or hand list'activity' > 5,000 transactions sent in 12 months'size' balance ever > $5M and > 1,000 transactions in 12 months'contract' deployed contract with balance ever > $1M'never_held' never held the country's GDP-adjusted threshold'velocity' mean weekly velocity > 10,000 in a calendar year'transfers' > 5,000 stablecoin transfers in a calendar yearNULL in the main sampleGroups reported separately (flags, not drop reasons):pass_through never held, sent stablecoins (> $0), not transfer-flaggedpersistent_gdp main-sample wallets passing the GDP-adjusted persistence ruleReads materialized tables only.=================================================== */SELECTs.wallet,s.country,-- how the wallet was linked (Stage 1)s.is_direct,s.is_via_deposit,s.is_via_payout,s.n_countries,s.has_domestic_tier_link,s.first_link_date,-- inputs to the filterss.max_usd AS max_balance_usd,s.max_tx_12m,s.is_deployed_contract,p.threshold_usd,p.holding_weeks_gdp,s.observed_weeks,w.max_transfers_year,w.mean_velocity,w.median_velocity,w.active_weeks,-- flagss.flag_institutional,s.flag_tx,s.flag_size,s.flag_contract,COALESCE(w.stablecoin_user, false) AS stablecoin_user,COALESCE(w.flag_velocity, false) AS flag_velocity,COALESCE(w.flag_transfers, false) AS flag_transfers,COALESCE(w.transacted_only, false) AS pass_through,COALESCE(w.in_sample, false) AS in_sample,COALESCE(w.in_sample_persistent, false) AS persistent_gdp,