Query editor
-- Top fomo.family traders on BNB Chain from chain data only, for 1 / 7 / 30 day windows in one run.-- Generated from dune/fomo_evm_top_traders.sql.tmpl by dune/gen_fomo_evm.py — edit the template.---- How fomo trades on EVM chains (verified on-chain, Sep 2026):-- * the user's wallet is an EIP-7702 account (their EOA upgraded in place, Alchemy account kit);-- * every order is executed by Relay: sells are ERC-4337 UserOperations from the user's account-- that hand the token to RelayRouterV3 and send proceeds to RelayDepository; buys are Relay fills-- delivering the token to the user's account. RelayRouterV3 / RelayApprovalProxyV3 /-- RelayDepository sit at the same addresses on every chain;-- * Relay routes through several venues — KyberSwap's aggregator (~70% of fills, tagged in its-- ClientData event with {"Source":"relay-fomo"}), Tycho, Uniswap directly — over Uniswap V3/V4 and-- Aerodrome pools. Only the Kyber path carries the fomo tag.-- So attribution is by ACCOUNT: an account with at least one relay-fomo-tagged swap in the window is-- a fomo user, and all of that account's Relay-executed swaps count. Fills are the account's own-- ERC-20 balance deltas inside each transaction (venue-agnostic, and correct for bundled txs).---- These are the users' real on-chain wallets; fomo's API shows different (off-chain) ids, so rows-- here do not match the `fomo` source by address.---- PnL follows fomo's own board: the change in the account's position value over the window-- (1 / 7 / 30 days, 1000 = all-time), per (wallet, token):-- pnl = sells in window − buys in window + open qty × price now − qty at window start × price then-- Positions held at window start are valued at the price of the day before the window (lifetime-- average cost if the token has no fills then), so a bag bought weeks ago only contributes its move-- inside the window. Sells beyond the quantity held (tokens deposited from elsewhere) are neutral.-- realized_pnl_usd = the part from sells; unrealized_pnl_usd = the rest (open positions).-- Buys and sells are valued in USD by the cash leg (largest dex.trades hop in the tx when the tx has-- a single fomo account, else the account's own quote-token delta at minute price). Cost basis uses-- fomo's whole history (since 2026-03-01). Price now = median of the token's dex.trades fills worth-- >= $20 in the past day (>= 5 fills, else the open position is not marked). Chains without-- dex.trades (Arc) get the sells part only. Chains without dex.trades (Arc) get realized only.WITH eval_at AS (SELECT NOW() AS t), -- evaluation time; NOW() in production, a fixed timestamp to backtestquotes AS (-- cash side of a swap; decimals and a fixed USD price are given so chains that Dune indexes as-- raw data only (no tokens.erc20 / prices.usd / dex.trades, e.g. Arc) still value fillsSELECT token, decimals, fixed_price FROM (VALUES(0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c, 18, CAST(NULL AS DOUBLE)), -- WBNB(0x55d398326f99059ff775485246999027b3197955, 18, 1.0), -- USDT(0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d, 18, 1.0), -- USDC(0xe9e7cea3dedca5984780bafc599bd69add087d56, 18, 1.0), -- BUSD(0x8d0d000ee44948fc98c9b98a4fa4921476f08b0d, 18, 1.0), -- USD1(0x2170ed0880ac9a755fd29b2688956bd959f933f8, 18, CAST(NULL AS DOUBLE)), -- ETH(0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c, 18, CAST(NULL AS DOUBLE)) -- BTCB) AS t(token, decimals, fixed_price)),windows AS (SELECT days FROM (VALUES (1), (7), (30), (1000)) AS w(days)), -- 1000 = all-timeinfra AS (SELECT a FROM (VALUES(0xb92fe925dc43a0ecde6c8b1a2709c170ec4fff4f), -- RelayRouterV3(0xccc88a9d1b4ed6b0eaba998850414b24f1c315be), -- RelayApprovalProxyV3(0x4cd00e387622c35bddb9b4c962c136462338bc31), -- RelayDepository(0x6131b5fae19ea4f9d964eac0408e4408b66337b5), -- KyberSwap MetaAggregationRouterV2(0x0000000071727de22e5e9d8baf0edac6f37da032), -- EntryPoint v0.7(0x4337084d9e255ff0702461cf8895ce9e3b5ff108) -- EntryPoint v0.8) AS t(a)),logs30 AS ( -- name kept for brevity: all fomo historySELECT tx_hash, block_time, contract_address, topic0, topic1, topic2, topic3, dataFROM bnb.logsWHERE block_date >= DATE '2026-08-01' -- fomo launch