Query editor
-- ============================================================================-- FOMO -- share of trading wallets in profit, four definitions-- ============================================================================-- Grain : one row per chain + an ALL CHAINS rollup, plus a PEOPLE rollup-- that collapses each trader's Solana and EVM addresses. See (a).-- Chains : solana (on-chain) + base, bnb, monad, robinhood, ethereum,-- hyperliquid (via Relay).-- Cohort : wallets that traded through FOMO in the last {{cohort_days}} days-- Accounting : average cost basis over {{basis_days}} days, per (chain, wallet, token)---- STATUS: Relay/EVM path validated on Dune 2026-08-21. The live Solana path-- remains behind {{include_solana}} because it exceeds the community-- engine's two-minute limit at current fee-wallet volume.---- WHY THE EVM HALF LOOKS NOTHING LIKE THE SOLANA HALF-- ----------------------------------------------------- FOMO has no swap contract on any EVM chain. It submits EVM trades to Relay-- (relay.link) tagged referrer="fomo", and Relay nets the platform fee-- off-chain. Verified: a completed FOMO request's on-chain deposit tx contains-- no transfer to FOMO's fee Safe (0x9fc4e320...), so there is no on-chain-- anchor to join on. FOMO's own DefiLlama adapter agrees -- it declares-- chains:[SOLANA] and reads everything else from an off-chain table.---- The previous EVM half was wrong twice over: it keyed wallets off-- dex.trades.tx_from, which under Relay is the solver, not the trader; and it-- looked for a FOMO fee address on EVM that does not exist.---- Relay's record is also strictly better than on-chain data here: it carries-- BOTH legs of the trade with USD values already attached, so the EVM half-- needs no dex.trades at all for user cash flows -- only for marking open-- positions in section 5.-- ============================================================================-- ============================================================-- 0. INPUT TABLE-- Produced by robinhood/relay_ingest.py and uploaded to Dune.-- Uses the archietools3037 upload namespace.-- ============================================================with relay_all as (select *,-- Filter and join on the epoch column, never the ISO string: Dune's-- CSV type inference on '2026-08-21T18:49:28.116Z' is not reliable,-- and a silently-varchar timestamp would make every window filter-- compare lexicographically instead of chronologically.from_unixtime(created_at_unix) at time zone 'UTC' as trade_timefrom dune.archietools3037.dataset_fomo_relay_trades-- Only settled trades. 'refund' rows are failed routes: the user got their-- money back, so they are not a trade and must not enter a cost basis.where status = 'success'and in_amount_usd is not nulland out_amount_usd is not nulland created_at_unix >= to_unixtime(now()) - {{basis_days}} * 86400),-- Cash assets. Anything not listed here is treated as a speculative position,-- so a wrong entry silently reclassifies cash and corrupts every number below.-- Every address here was read off its own chain (symbol()/decimals()), not-- copied from a token list.quotes_evm as (select * from (values