Query editor
-- Actual gross BNB/WBNB bonding-curve buy + sell amounts, UTC days.-- Fixed 2026-11-10: replaces fee-recipient transfers / fixed fee multipliers.-- Other quote assets (including BNC4 stock quotes) are excluded, not converted at fixed prices.WITH four_trades AS (SELECT evt_block_date day,token,cast(cost as double)/1e18 volume_bnb,cast(fee as double)/1e18 fee_bnbFROM four_meme_bnb.tokenmanager2_evt_tokenpurchaseWHERE evt_block_date>=current_date-interval '60' dayUNION ALLSELECT evt_block_date,token,cast(cost as double)/1e18,cast(fee as double)/1e18FROM four_meme_bnb.tokenmanager2_evt_tokensaleWHERE evt_block_date>=current_date-interval '60' day), active_tokens AS (SELECT DISTINCT token FROM four_trades), four_quote AS (-- The low byte of the packed template/config word identifies the quote template.-- Native BNB template 0; both legacy flat args and tuple-encoded args supported.-- Match request ID as well as tx hash: a batched launch must not multiply events.SELECT e.token,min(cast(varbinary_to_uint256(varbinary_substring(c.args,(CASE WHEN varbinary_to_uint256(varbinary_substring(c.args,1,32))=32 THEN 32 ELSE 0 END)+(CASE WHEN varbinary_to_uint256(varbinary_substring(c.args,65,32)) BETWEEN 256 AND 1024 AND varbinary_to_uint256(varbinary_substring(c.args,97,32)) BETWEEN varbinary_to_uint256(varbinary_substring(c.args,65,32))+32 AND varbinary_to_uint256(varbinary_substring(c.args,65,32))+256 THEN 256 ELSE 288 END),1)) as bigint)) quote_idFROM four_meme_bnb.tokenmanager2_evt_tokencreate eJOIN active_tokens a ON a.token=e.tokenJOIN four_meme_bnb.tokenmanager2_call_createtoken cON e.evt_tx_hash=c.call_tx_hash AND 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))=32 THEN 32 ELSE 0 END)+1,32))WHERE c.call_success GROUP BY 1UNION-- Eight legacy tokens lack a decoded creation call; quote checked via official Helper3 on 2026-11-10.SELECT token,quote_id FROM (VALUES (0x17f828a1ad19a0b8cbc529121cd14231ed2e5a09,0),(0xc122e51eb8c3ef1a225dd91fec70584775d3c8b1,0),(0x39d2fbc620e287f25b6a3b5d38b94ff00b43fdce,0),(0x1040b9886c69cfbc283d8cf388724b7b06acab20,0),(0x1d41e9d7ea85b19542c681155d33b871063b3b48,-1),(0x1e59e1af954291143dc7495e63f3cd637b96ffff,0),(0xf98cf0db69ba0dec1266e1f53b3143e79b5c212a,0),(0xf08a7e72ed566472f7f17867195110beb47da768,0)) AS fallback(token,quote_id)), four_native_trades AS (SELECT t.* FROM four_trades t JOIN four_quote q ON q.token=t.token AND q.quote_id=0UNION ALLSELECT evt_block_date,token,cast(etheramount as double)/1e18,cast(fee as double)/1e18 FROM four_meme_bnb.tokenmanager_evt_tokenpurchase WHERE evt_block_date>=current_date-interval '60' dayUNION ALLSELECT evt_block_date,token,cast(etheramount as double)/1e18,cast(fee as double)/1e18 FROM four_meme_bnb.tokenmanager_evt_tokensale WHERE evt_block_date>=current_date-interval '60' day), four_daily AS (SELECT day,sum(volume_bnb) legacy_four_bnb_vol,sum(fee_bnb) legacy_fee_bnb,count(*) legacy_tradesFROM four_native_trades GROUP BY 1), openfour_daily AS (SELECT block_date day,sum(cast(varbinary_to_uint256(varbinary_substring(data,161,32)) as double)/1e18) openfour_bnb_vol,sum(cast(varbinary_to_uint256(varbinary_substring(data,289,32)) as double)/1e18) openfour_fee_bnb,count(*) openfour_tradesFROM bnb.logsWHERE block_date>=current_date-interval '60' dayAND contract_address=0xebe7b6c1089d9f72ad07f34e36d898e44e5e27f3AND topic0=keccak(to_utf8('TradeExecuted(address,address,uint256,bool,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)'))AND varbinary_substring(data,45,20) IN (0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c,0x0000000000000000000000000000000000000000)GROUP BY 1), dates AS (SELECT day FROM unnest(sequence(current_date-interval '60' day,current_date,interval '1' day)) AS t(day))SELECT cast(d.day as timestamp) transfer_date,coalesce(f.legacy_four_bnb_vol,0)+coalesce(o.openfour_bnb_vol,0) four_bnb_vol,coalesce(f.legacy_four_bnb_vol,0) legacy_four_bnb_vol,coalesce(o.openfour_bnb_vol,0) openfour_bnb_vol,coalesce(f.legacy_fee_bnb,0)+coalesce(o.openfour_fee_bnb,0) four_fee_bnb,coalesce(f.legacy_trades,0)+coalesce(o.openfour_trades,0) four_tradesFROM dates d LEFT JOIN four_daily f ON d.day=f.day LEFT JOIN openfour_daily o ON d.day=o.dayORDER BY 1