Query editor
with token_list as (select * from (values(0x76bb1eb4ff2172fc925c2013f674bb58342dff22, 'gMESSI', 'MESSI'),(0x192ed0be3fc868916390b864791afe280bcaf7f6, 'gBRUN', 'BRUNSON'),(0xd85f684f1e1c6edd97f8214bfec577a9f65165d1, 'gMONK', 'MONK'),(0x20668e4542df7d840f47970954f9398e4e01d5c7, 'gPULI', 'PULISIC'),(0xa0dd634a9d3c91829081fc66b90103a3e5c6aeec, 'gSPEED', 'ISHOWSPEED'),(0xbf88ed85e8fd528d6370be619fd43206fa28c9de, 'gSHAI', 'SHAI'),(0x865d7ad904804155f5ecb399efd2cbe6af47801b, 'gOHTANI', 'OHTANI'),(0xee8b7b02fe52597d53f0cb45c625df7acff2ccce, 'gMBAPPE', 'MBAPPE'),(0x5b0314865b880108b9cd1ef1bc7b8075effc9012, 'gBRADY', 'BRADY'),(0xcedf028059b39bbabd340a62fc993abe2a36e5db, 'gCADE', 'CADE'),(0xd87a8e8c6d0ef4460581f5e5f5829381023ff7a8, 'gYAMAL', 'YAMAL'),(0x65af283cd126a007741c8a6683c2fdadcc82d9f3, 'gWEMBY', 'WEMBY'),(0x570d8a9effa39a6aa6c58eaed019c6724c9d4772, 'gKOBE', 'KOBE'),(0xe91253175be290132911153c4e0b76b5573f7610, 'gMJ', 'MJ'),(0xd5185a8329161567fee26646feaad56f360b146d, 'gCHAR', 'CHAR'),(0x143bdb8ebb0b6b5c5c3da4528175095dd2e254c7, 'gBRON', 'BRON'),(0x44174816ab56987fe5788cddf4065261673c2551, 'gPIKA', 'PIKA'),(0x1433dc30d043a513dfa77f344f72040231469ef7, 'gDOUE', 'DOUE'),(0x179a81c325f27044ebbf3aeae9ddcbcbc9d578e0, 'gRONALDO', 'RONALDO')) as t(contract_address, symbol, name))-- circulating supply per token, circulating_supply as (selecttl.contract_address, sum(casewhen tr."from" = 0x0000000000000000000000000000000000000000then tr.value / 1e18when tr."to" = 0x0000000000000000000000000000000000000000then - (tr.value / 1e18)else0end) as circulating_supplyfrom token_list tlleft join erc20_base.evt_transfer tr on tl.contract_address = tr.contract_addressgroup bytl.contract_address)-- all buy and sell trades for all 17 tokens, all_trades as (selecttoken_bought_address as contract_address, amount_usd / token_bought_amount as price_usd, amount_usd, block_time, taker as traderfrom dex.tradeswhere blockchain = 'base'and token_bought_address in (selectcontract_addressfrom token_list)and amount_usd > 0and token_bought_amount > 0