Query editor
-- Clanker Volume & Fees (V3, V31, V4 comprehensive)WITH weth_price AS (SELECT priceFROM prices.usd_latestWHERE blockchain = 'base'AND contract_address = 0x4200000000000000000000000000000000000006),clanker_tokens_all AS (/* ---------- V31 ---------- */SELECTt.tokenAddress,t.evt_block_time,'V31' AS token_version,a.pool,0x4200000000000000000000000000000000000006 AS pairedToken,0.0030 AS fee_factor -- V3 standard 0.3% feeFROM clanker_base.Clanker_v31_evt_TokenCreated tLEFT JOIN clanker_base.Clanker_v31_call_deployToken cON c.call_tx_hash = t.evt_tx_hashAND c.call_success = trueLEFT JOIN uniswap_v3_base.uniswapv3factory_evt_poolcreated aON a.evt_tx_hash = t.evt_tx_hashAND (a.token0 = 0x4200000000000000000000000000000000000006OR a.token1 = 0x4200000000000000000000000000000000000006)/* ---------- V4 ---------- */UNION ALLSELECTt.tokenAddress,t.evt_block_time,'V4' AS token_version,COALESCE(pf.poolId, po.poolId) AS pool,t.pairedToken,CASEWHEN t.poolHook = 0xd60D6B218116cFd801E28F78d011a203D2b068Cc THEN 0.0120 -- DynamicV2WHEN t.poolHook = 0xb429d62f8f3bFFb98CdB9569533eA23bF0Ba28CC THEN 0.0120 -- StaticV2WHEN t.poolHook = 0x34a45c6B61876d739400Bd71228CbcbD4F53E8cC THEN 0.0100 -- DynamicV1WHEN t.poolHook = 0xDd5EeaFf7BD481AD55Db083062b13a3cdf0A68CC THEN 0.0100 -- StaticV1ELSE 0.0100END AS fee_factorFROM clanker_v4_multichain.clanker_evt_tokencreated tLEFT JOIN clanker_v4_multichain.clanker_call_deployToken cON c.call_tx_hash = t.evt_tx_hashAND c.chain = t.chainAND c.call_success = trueLEFT JOIN clanker_v4_multichain.clankerhookstaticfee_evt_poolcreatedfactory pfON pf.evt_tx_hash = t.evt_tx_hashAND pf.clanker = t.tokenAddressAND pf.chain = t.chainLEFT JOIN clanker_v4_multichain.clankerhookstaticfee_evt_poolcreatedopen poON po.evt_tx_hash = t.evt_tx_hashAND po.clanker = t.tokenAddressAND po.chain = t.chainWHERE t.chain = 'base'/* ---------- V3 ---------- */UNION ALLSELECTt.tokenAddress,