Query editor
withcai_price as (selectdate_trunc('minute', a.date) as minute,avax_usd_price * cai_avax_price as cai_pricefrom(selectdate_trunc('minute', evt_block_time) as date,reserve1 / reserve0 as cai_avax_pricefromtrader_joe_avalanche_c.JoePair_evt_Syncwherecontract_address = 0xe5e9d67e93ad363a50cabcb9e931279251bbefd0) as aleft join (selectdate_trunc('minute', evt_block_time) as date,(reserve1 / 1e6) / (reserve0 / 1e18) as avax_usd_pricefromtrader_joe_avalanche_c.JoePair_evt_Syncwherecontract_address = 0xf4003F4efBE8691B60249E6afbD307aBE7758adb) as b on a.date = b.dateorder bya.date asc),distinct_cai_flows as (select distinctminute,evt_tx_hash,a."from",to,value / 1e18 as valuefrom(selectdate_trunc('minute', evt_block_time) as minute,value,to,"from",evt_tx_hashfromerc20_avalanche_c.evt_Transferwherecontract_address = 0x48f88A3fE843ccb0b5003e70B4192c1d7448bEf0and ("from" = 0x0000000000000000000000000000000000000000or to = 0x0000000000000000000000000000000000000000)and to != 0x6d825cE7F220c6cc03fE156F28BE6318e6546Ca8and to != 0x6D9F100ca14384262Ca6afd8ef7ceC265a113113order byminute asc) as a),distinct_cai_flows_with_price as (select distincta.minute,a.to,