CryptoLionprice std
    Updated 2023-03-27
    SELECT
    date_trunc('day',block_timestamp) as day,
    CASE
    WHEN pool_name LIKE 'USDC-WETH%' THEN 'USDC-WETH'
    WHEN pool_name LIKE 'WETH-USDT%' THEN 'WETH-USDT'
    WHEN pool_name LIKE 'USDC-USDT%' THEN 'USDC-USDT'
    WHEN pool_name LIKE 'WBTC-WETH%' THEN 'WBTC-WETH'
    END as pool,
    avg(price_0_1),
    Avg(price_1_0),
    STDDEV(price_0_1) as std_t0,
    STDDEV(price_1_0) as std_t1
    FROM uniswapv3.pool_stats
    WHERE block_timestamp >= getdate() - interval '14 days'
    AND (pool_name LIKE 'USDC-WETH%'
    OR pool_name LIKE 'WETH-USDT%'
    OR pool_name LIKE 'USDC-USDT%'
    OR pool_name LIKE 'WBTC-WETH%')
    GROUP BY day,pool
    ORDER BY DAY

    Run a query to Download Data