Query editor
-- This query used incompatible data types from Dune SQL alpha and may need to be updated.-- More details can be found on https://dune.com/docs/query/dunesql-changes/WITH current_scale as (SELECTcast(scale as integer) as scale,evt_block_number,'Ethereum' as networkFROM airswap_ethereum.Pool_v4_1_evt_SetScaleUNION ALLSELECT10 as scale,1 as evt_block_number,'Ethereum' as networkorder by evt_block_number desclimit 1),current_max as (SELECTcast(max as integer) as max,evt_block_number,'Ethereum' as networkFROM airswap_ethereum.Pool_v4_1_evt_SetMaxUNION ALLSELECT100 as scale,1 as evt_block_number,'Ethereum' as networkorder by evt_block_number desclimit 1),pool_addrs as (SELECT*FROM (VALUES(0xbbcec987E4C189FCbAB0a2534c77b3ba89229F11, 'ethereum'),(0x16B57a5958271C479f64BC5F830DfC4f30ba2235, 'bnb')) as t(address, network)),pools as (SELECTsum_amt / power(10, p.decimals) * p.price as sum_usd,p.symbol,networkFROM (SELECTSUM(amt) as sum_amt,contract_address,networkFROM (