Query editor
-- Four.meme ANTB-quoted internal bonding-curve trades (BSC / DuneSQL).-- UTC dates; start is inclusive, end is exclusive. Change params as needed.-- cost = gross curve volume excluding fees; fee = event-recorded base fee.-- Excludes AntiSniper extraFee, token tax, router fee, gas and external DEX fees.-- USD estimates use each trade day's ANTB price; missing prices remain NULL.WITH params AS (SELECT TIMESTAMP '2026-11-18 00:00:00' AS start_time,CAST(current_timestamp AS timestamp) AS end_time,0x38dd26788cf2d901e3abf04efe3007d459d0fc53 AS antb),antb_templates AS (-- _templates(166).quote verified via BSC RPC on 2026-11-21.SELECT CAST(166 AS bigint) AS quote_idUNIONSELECT CAST(_0 AS bigint)FROM four_meme_bnb.tokenmanager2_call__templatesWHERE call_success AND output_quote = (SELECT antb FROM params)AND _0 <= 255),creation_args AS (SELECT e.token, c.args,CASE WHEN varbinary_to_uint256(varbinary_substring(c.args, 1, 32)) = 32THEN 32 ELSE 0 END AS tuple_offsetFROM four_meme_bnb.tokenmanager2_evt_tokencreate eJOIN four_meme_bnb.tokenmanager2_call_createtoken cON e.evt_tx_hash = c.call_tx_hashAND e.evt_block_date = c.call_block_dateAND e.requestid = varbinary_to_uint256(varbinary_substring(c.args,CASE WHEN varbinary_to_uint256(varbinary_substring(c.args, 1, 32)) = 32THEN 33 ELSE 1 END, 32))WHERE c.call_successAND e.evt_block_date >= DATE '2026-11-18'AND c.call_block_date >= DATE '2026-11-18'),token_quote_ids AS (SELECT token,CAST(varbinary_to_uint256(varbinary_substring(args, tuple_offset + CASEWHEN varbinary_to_uint256(varbinary_substring(args, 65, 32)) BETWEEN 256 AND 1024AND varbinary_to_uint256(varbinary_substring(args, 97, 32))BETWEEN varbinary_to_uint256(varbinary_substring(args, 65, 32)) + 32AND varbinary_to_uint256(varbinary_substring(args, 65, 32)) + 256THEN 256 ELSE 288 END,1)) AS bigint) AS quote_idFROM creation_args),antb_tokens AS (SELECT DISTINCT token FROM token_quote_idsWHERE quote_id IN (SELECT quote_id FROM antb_templates)),trades AS (SELECT evt_block_time AS block_time, evt_tx_hash AS tx_hash,evt_index, evt_tx_from AS wallet, token, 'buy' AS side,CAST(cost AS double) / 1e18 AS volume_antb,CAST(fee AS double) / 1e18 AS base_fee_antbFROM four_meme_bnb.tokenmanager2_evt_tokenpurchaseWHERE evt_block_date >= CAST((SELECT start_time FROM params) AS date)AND evt_block_time >= (SELECT start_time FROM params)AND evt_block_time < (SELECT end_time FROM params)