alitaslimiPrices Swaps Over Time
    Updated 2023-07-11
    with
    avalanche_prices as (
    select
    hour::date as date,
    avg(price) as price
    from
    avalanche.core.fact_hourly_token_prices
    where
    token_address = '0xc891eb4cbdeff6e073e859e987815ed1505c2acd'
    group by
    date
    ),
    ethereum_prices as (
    select
    hour::date as date,
    avg(price) as price
    from
    ethereum.core.fact_hourly_token_prices
    where
    token_address = '0x1abaea1f7c830bd89acc67ec4af516284b1bc33c'
    group by
    date
    ),
    avalanche_swaps_raw as (
    SELECT
    block_timestamp,
    (amount_out / amount_in) AS price
    FROM
    avalanche.core.ez_dex_swaps
    WHERE
    symbol_out IN ('USDC', 'USDT', 'DAI')
    and token_in = '0xc891eb4cbdeff6e073e859e987815ed1505c2acd'
    AND amount_in > 0
    AND amount_out > 0
    UNION
    SELECT
    Run a query to Download Data