theericstoneALCX Swaps
    Updated 2022-12-31
    with alcxtoeth as (
    select
    date_trunc('hour',block_timestamp) as hour,
    sum(amount_usd) * -1 as alcx_to_eth_usd
    from ethereum.dex_swaps
    where pool_address = '0xc3f279090a47e80990fe3a9c30d24cb117ef91a8' -- alcx eth slp
    and token_address = '0xdbdb4d16eda451d0503b854cf79d55697f90c8df' -- alcx
    and amount_in > 0 -- subset to those swapping alcx for eth
    and block_timestamp > '2021-04-27 11:00:00'
    group by 1
    ),

    ethtoalcx as (
    select
    date_trunc('hour',block_timestamp) as hour,
    sum(amount_usd) as eth_to_alcx_usd
    from ethereum.dex_swaps
    where pool_address = '0xc3f279090a47e80990fe3a9c30d24cb117ef91a8' -- alcx eth slp
    and token_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' -- weth
    and amount_in > 0 -- subset to those swapping alcx for eth
    and block_timestamp > '2021-04-27 11:00:00'
    group by 1
    )

    select e.hour, e.eth_to_alcx_usd, a.alcx_to_eth_usd
    from alcxtoeth a join ethtoalcx e on a.hour = e.hour
    order by 1 desc;

    Run a query to Download Data