Query editor
withcurve_combined as (select * from bellum_avalanche_c.BellumFactory_evt_CurveCompletedUNION ALLselect * from bellum_avalanche_c.BellumFactoryOld_evt_CurveCompletedUNION ALLselect * from bellum_avalanche_c.BellumFactory03_evt_CurveCompletedUNION ALLselect * from bellum_avalanche_c.BellumFactory04_evt_CurveCompletedUNION ALLselect * from bellum_avalanche_c.BellumFactory05_evt_CurveCompleted),work as (select-- cc.contract_address,cc.evt_block_time,cc.evt_tx_hash,cc.token0,q.name_ as name,q.symbol_ as symbol,max((dt.amount_usd / dt.token_bought_amount)) as ATH,q.supply,cc.dist,cc.jlp-- cc.creator,-- cc.curveIndex-- cc.isPowder,-- cc.token-- e.symbolfromcurve_combined cc-- left join tokens.erc20 e on e.contract_address = cc.tokenjoin query_4151921 q on cc.token0 = q.token_address -- Token INFORMATION LOOKUP QUERYjoin dex.trades dt on dt.blockchain = 'avalanche_c'and dt.block_time >= cc.evt_block_timeAND token_bought_address = cc.token0group by1,2,3,4,5,7,8,9)select*,w.ATH * w.supply as peak_MCAPfromwork worder by 10 desc