Query editor
/* ===================================================STAGE 1b SUMMARY: per country, from dune.boc.result_deposit_fundersCompare funders with the country's deposit candidates in stage1a_summary:with one customer per deposit address, funders should be roughly equal toor fewer than deposit candidates.=================================================== */WITH funders AS (SELECT * FROM dune.boc.result_deposit_funders),direct AS (SELECT wallet, countryFROM dune.boc.result_wallet_country_linksWHERE link_class = 'direct_user')SELECTf.country,COUNT(*) AS funders,COUNT_IF(d.wallet IS NOT NULL) AS also_direct_user,COUNT_IF(d.wallet IS NULL) AS new_wallets,approx_percentile(f.n_via_deposit, 0.5) AS median_transfers_in,approx_percentile(f.via_deposit_usd, 0.5) AS median_usd_in,COUNT_IF(f.n_deposit_addresses = 1) AS one_deposit_address,COUNT_IF(f.n_deposit_addresses >= 10) AS feeds_10plus_deposit_addressesFROM funders fLEFT JOIN direct d ON d.wallet = f.wallet AND d.country = f.countryGROUP BY f.countryORDER BY funders DESC