Query editor
--Possibly relevant tables based on your question: ['prices.usd', 'erc20_ethereum.evt_Transfer', 'prices.tokens', 'weth_avalanche_c.BridgeToken_evt_Swap']WITH price_changes AS (SELECTminute,LEAD(price) OVER (PARTITION BY DATE_TRUNC('minute', minute) ORDER BY minute) AS next_10_min_price,price AS current_priceFROM prices.usdWHEREblockchain = 'ethereum'AND symbol = 'WETH'AND contract_address = FROM_HEX('c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2')AND minute BETWEEN DATE_TRUNC('day', CURRENT_TIMESTAMP) - INTERVAL '1' DAY AND DATE_TRUNC('day', CURRENT_TIMESTAMP)), price_direction AS (SELECTCASEWHEN next_10_min_price > current_priceTHEN 'UP'WHEN next_10_min_price < current_priceTHEN 'DOWN'ELSE 'STABLE'END AS direction,COUNT(*) OVER (PARTITION BY CASEWHEN next_10_min_price > current_priceTHEN 'UP'WHEN next_10_min_price < current_priceTHEN 'DOWN'ELSE 'STABLE'END) AS count_direction,COUNT(*) OVER () AS totalFROM price_changesWHERENOT next_10_min_price IS NULL)SELECTdirection,count_direction,total,count_direction / total AS probabilityFROM price_directionGROUP BYdirection,count_direction,total