Query editor
-- Base chain: small-cap-oriented active traders (airdrop targeting, trimmed)-- Engine: DuneSQL (Trino). Paste into a Dune query and Run.---- Reconstructs "low-cap interest" from on-chain behavior (no external mcap API):-- * token "smallness" = low lifetime Base DEX volume + few distinct buyers-- * majority share = most of a wallet's buys are into small tokens-- * median trade cap = excludes whales trading liquid names---- TUNE the params block to dial the list size up/down.WITH params AS (SELECTDATE '2026-04-01' AS start_date, -- activity window (keep short on first run)10.0 AS min_usd, -- min trade size5000000 AS max_token_lifetime_usd, -- token smallness: lifetime DEX volume cap2000 AS max_token_buyers, -- token smallness: distinct-buyer cap500.0 AS max_median_trade_usd, -- whale cutoff (median buy size)10 AS min_smallcap_buys, -- how many small-token buys to qualify0.50 AS min_smallcap_share -- fraction of buys that must be small-token),majors (addr) AS (VALUES(0x4200000000000000000000000000000000000006), -- WETH(0x833589fcd6edb6e08f4c7c32d4f71b54bda02913), -- USDC(0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf), -- cbBTC(0x50c5725949a6f0c72e6c4a641f24049a917db0cb) -- DAI (add EURC, cbETH, USDbC as needed)),trades AS (SELECT t.taker, t.tx_hash, t.block_number, t.token_bought_address,t.token_sold_address, t.amount_usd, t.block_timeFROM dex.trades t, params pWHERE t.blockchain = 'base'AND t.block_time >= p.start_dateAND t.amount_usd >= p.min_usdAND t.token_bought_address NOT IN (SELECT addr FROM majors)),-- token smallness, computed only for tokens our cohort actually boughttoken_stats AS (SELECT token_bought_address AS token,SUM(amount_usd) AS lifetime_buy_usd,COUNT(DISTINCT taker) AS distinct_buyersFROM dex.tradesWHERE blockchain = 'base'AND token_bought_address IN (SELECT DISTINCT token_bought_address FROM trades)GROUP BY 1),small_tokens AS (SELECT ts.tokenFROM token_stats ts, params pWHERE ts.lifetime_buy_usd < p.max_token_lifetime_usdAND ts.distinct_buyers < p.max_token_buyers),-- arb/sandwich bots (HEAVIEST step; comment this + its filter out if credits bite)sandwichers AS (SELECT DISTINCT b.takerFROM trades bJOIN trades s