Query editor
-- Four.meme is the parent platform: classic Four.meme + OpenFour (including TapeFour).-- Count successful creation events, not mints to a fixed recipient or attempted transaction calls.-- Retain the original rolling 60-day window and Flap definition. UTC; boundary days are partial.WITH params AS (SELECT current_timestamp - INTERVAL '60' DAY AS start_ts),creation_events AS (SELECT block_time, varbinary_substring(data,45,20) token, 'classic' sourceFROM bnb.logsWHERE block_date >= current_date - INTERVAL '60' DAYAND block_time >= (SELECT start_ts FROM params)AND contract_address IN (0xec4549cadce5da21df6e6422d448034b5233bfbc,0x5c952063c7fc8610ffdb798152d69f0b9550762b,0x8d68e48baee3264ecd62a8b85b80f8558cc1b499,0x757eba15a64468e6535532fcf093cef90e226f85,0x23e0d387350200ade3def26759a6d4a6ab751886)AND topic0=keccak(to_utf8('TokenCreate(address,address,uint256,string,string,uint256,uint256,uint256)'))UNION ALLSELECT block_time, varbinary_substring(topic3,13,20) token, 'openfour' sourceFROM bnb.logsWHERE block_date >= current_date - INTERVAL '60' DAYAND block_time >= (SELECT start_ts FROM params)AND contract_address=0xebe7b6c1089d9f72ad07f34e36d898e44e5e27f3AND topic0=keccak(to_utf8('TokenCreated(uint256,uint256,address,address,string,string,uint256,uint256,uint256,uint256,address,address,address,address,address,address,address,string,uint256,bytes)'))),four_tokens AS (SELECT token, CAST(min(block_time) AS date) date,max(CASE WHEN source='openfour' THEN 1 ELSE 0 END) is_openfourFROM creation_eventsWHERE token<>0x0000000000000000000000000000000000000000GROUP BY token),four_daily AS (SELECT date, count(*) four,count_if(is_openfour=0) four_classic,count_if(is_openfour=1) openfourFROM four_tokens GROUP BY 1),flap_daily AS (SELECT DATE(evt_block_time) date, count(DISTINCT contract_address) flapFROM erc20_bnb.evt_transferWHERE "to"=0xe2ce6ab80874fa9fa2aae65d277dd6b8e65c9de0AND "from"=0x0000000000000000000000000000000000000000AND evt_block_time >= (SELECT start_ts FROM params)GROUP BY 1),dates AS (SELECT date FROM four_daily UNION SELECT date FROM flap_daily)SELECT d.date,coalesce(f.flap,0) flap,coalesce(m.four,0) four, -- Display label: Four.meme (includes OpenFour).coalesce(m.four_classic,0) four_classic,coalesce(m.openfour,0) openfour, -- Subset for drilldown only; never add to four again.coalesce(f.flap,0)+coalesce(m.four,0) totalFROM dates dLEFT JOIN four_daily m ON m.date=d.dateLEFT JOIN flap_daily f ON f.date=d.date