Query editor
with last_sync as (selectevt_block_time,reserve0,reserve1from uniswap_v2_base.uniswapv2pair_evt_syncwhere contract_address = from_hex('0xD1DbB2E56533C55C3A637D13C53aeEf65c5D5703')order by evt_block_time desclimit 1),eth_price as (selectprice as eth_usdfrom prices.usdwhere blockchain = 'base'and symbol = 'WETH'order by minute desclimit 1)selectreserve0 / 1e18 as token0_reserve,reserve1 / 1e18 as token1_reserve,eth_usd,-- If token0 = WETH, token1 = DONUT:(cast(reserve0 as double) / cast(reserve1 as double)) as donut_price_if_token1_in_weth,(cast(reserve0 as double) / cast(reserve1 as double)) * eth_usd as donut_price_if_token1_in_usd,-- If token1 = WETH, token0 = DONUT:(cast(reserve1 as double) / cast(reserve0 as double)) as donut_price_if_token0_in_weth,(cast(reserve1 as double) / cast(reserve0 as double)) * eth_usd as donut_price_if_token0_in_usdfrom last_synccross join eth_price;