Query editor
-- Demonstration of the resolution of `prices.usd` table-- select distinct blockchain-- from prices.usd-- cardano-- zora-- bitcoin-- solana-- fantom-- scroll-- base-- ethereum-- zksync-- bnb-- optimism-- avalanche_c-- celo-- gnosis-- arbitrum-- polygonWITH PriceChanges AS (SELECTminute,price,LAG(price) OVER (ORDER BY minute) AS previous_price,LAG(minute) OVER (ORDER BY minute) AS previous_minuteFROM prices.usdWHEREblockchain = 'ethereum'and contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 -- wethand minute >= cast('2024-01-01' as timestamp))SELECTminute,price,previous_minute,previous_price,DATE_DIFF('minute', previous_minute, minute) AS minutes_since_last_changeFROM PriceChangesWHERE price != previous_priceORDER BY minute;