Query editor
withdex_price as (select symbol as dex_symbol, decimals as dex_decimals, avg(token_price_usd) as dex_pricefrom dex.prices_latest,tokens.erc20where token_address = 0x4498cd8Ba045E00673402353f5a4347562707e7Dand contract_address = 0x4498cd8Ba045E00673402353f5a4347562707e7Dand blockchain = 'base'group by 1,2),supply as (select sum(cast(value as double)*-1) as amountfromerc20_base.evt_Transferwhere contract_address = 0x4498cd8Ba045E00673402353f5a4347562707e7Dand "to" in (0x0000000000000000000000000000000000000000,0x000000000000000000000000000000000000dEaD,0xD15a672319Cf0352560eE76d9e89eAB0889046D3)union allselect sum(cast(value as double)) as amountfrom erc20_base.evt_Transferwhere contract_address = 0x4498cd8Ba045E00673402353f5a4347562707e7Dand "from"=0x0000000000000000000000000000000000000000)selectdex_symbol as symbol,dex_price as price,sum(amount*dex_price/power(10,dex_decimals)) as market_cap,sum(amount/power(10,dex_decimals)) as circulatingfrom supply,dex_pricegroup by 1,2