Query editor
with token_list as (select * from (values(0x76bb1eb4ff2172fc925c2013f674bb58342dff22, 'gMESSI'),(0x192ed0be3fc868916390b864791afe280bcaf7f6, 'gBRUN'),(0xd85f684f1e1c6edd97f8214bfec577a9f65165d1, 'gMONK'),(0x20668e4542df7d840f47970954f9398e4e01d5c7, 'gPULI'),(0xa0dd634a9d3c91829081fc66b90103a3e5c6aeec, 'gSPEED'),(0xbf88ed85e8fd528d6370be619fd43206fa28c9de, 'gSHAI'),(0x865d7ad904804155f5ecb399efd2cbe6af47801b, 'gOHTANI'),(0xee8b7b02fe52597d53f0cb45c625df7acff2ccce, 'gMBAPPE'),(0x5b0314865b880108b9cd1ef1bc7b8075effc9012, 'gBRADY'),(0xcedf028059b39bbabd340a62fc993abe2a36e5db, 'gCADE'),(0xd87a8e8c6d0ef4460581f5e5f5829381023ff7a8, 'gYAMAL'),(0x65af283cd126a007741c8a6683c2fdadcc82d9f3, 'gWEMBY'),(0x570d8a9effa39a6aa6c58eaed019c6724c9d4772, 'gKOBE'),(0xe91253175be290132911153c4e0b76b5573f7610, 'gMJ'),(0xd5185a8329161567fee26646feaad56f360b146d, 'gCHAR'),(0x143bdb8ebb0b6b5c5c3da4528175095dd2e254c7, 'gBRON'),(0x44174816ab56987fe5788cddf4065261673c2551, 'gPIKA')) as t(contract_address, symbol)),daily_price as (selectdate_trunc('day', block_time) as day,token_bought_address as contract_address,avg(amount_usd / token_bought_amount) as price_usdfrom dex.tradeswhere blockchain = 'base'and token_bought_address in (select contract_address from token_list)and amount_usd > 0and token_bought_amount > 0group by 1, 2union allselectdate_trunc('day', block_time) as day,token_sold_address as contract_address,avg(amount_usd / token_sold_amount) as price_usdfrom dex.tradeswhere blockchain = 'base'and token_sold_address in (select contract_address from token_list)and amount_usd > 0and token_sold_amount > 0group by 1, 2),avg_daily_price as (selectday,contract_address,avg(price_usd) as price_usdfrom daily_pricegroup by 1, 2),first_price as (select