Query editor
/*Token Priceprice.usdswap evt_logv2: 0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822v3: 0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67*/with pool_list as (SELECTblock_time, blockchain, token0, token0_symbol, token0_decimals, token1, token1_symbol, token1_decimals, pool, fee, tick_spacing, version, amm_protocol, tx_hashFROM query_2781510 -- https://dune.com/queries/2781510)-- , swap_evt_logs as (-- select-- t1.block_time-- , t2.blockchain-- , t1.contract_address as pool-- , bytearray_ltrim(topic2) as trader-- , t2.token0-- , t2.token0_symbol-- , t2.token0_decimals-- , t2.token1-- , t2.token1_symbol-- , t2.token1_decimals-- , (cast(bytearray_to_uint256(bytearray_substring(data, 1, 32)) as DOUBLE) - cast(bytearray_to_uint256(bytearray_substring(data, 1+2*32, 32)) as DOUBLE)) / pow(10, t2.token0_decimals) as amount0-- , (cast(bytearray_to_uint256(bytearray_substring(data, 1+1*32, 32)) as DOUBLE) - cast(bytearray_to_uint256(bytearray_substring(data, 1+3*32, 32)) as DOUBLE)) / pow(10, t2.token1_decimals) as amount1-- , t1.tx_hash-- , 'v2' as version-- from ethereum.logs t1 -- ************* blockchain ***********-- INNER join pool_list t2 on t1.contract_address = t2.pool-- where-- topic0 = 0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822 -- v2-- and t2.token0 = 0x808507121b80c02388fad14726482e061b8da827 -- ethereum ************* token contract ***********-- and t2.token1_symbol in ('WETH', 'USDT', 'USDC', 'DAI')-- and t1.block_time >= TIMESTAMP '2021-04-28 18:00:00' -- *************** Start Time ***************-- UNION ALL-- select-- t1.block_time-- , t2.blockchain-- , t1.contract_address as pool-- , bytearray_ltrim(topic2) as trader-- , t2.token0-- , t2.token0_symbol-- , t2.token0_decimals