MLDZMNplatfrom_volume_overtime
    Updated 2022-06-25
    with tb1 as (
    SELECT
    *
    FROM ethereum.core.fact_transactions
    WHERE to_address = lower('0x881D40237659C251811CEC9c364ef91dC08D300C')
    and STATUS='SUCCESS'
    ),

    tb2 as (select
    BLOCK_TIMESTAMP::date as day,
    count(distinct tx_hash) as swap_meta,
    sum(AMOUNT_USD) as volume_meta,
    volume_meta/swap_meta as average_swap_meta
    from ethereum.core.ez_token_transfers
    where BLOCK_TIMESTAMP>='2022-05-01'
    and tx_hash in (select tx_hash from tb1)
    group by 1
    ),

    tb3 as (select
    BLOCK_TIMESTAMP::date as day,
    count(distinct tx_hash) as swap_uni,
    sum(AMOUNT_IN_USD) as volume_uni,
    volume_uni/swap_uni as average_swap_uni
    from ethereum.core.ez_dex_swaps
    where PLATFORM='uniswap-v2'
    and BLOCK_TIMESTAMP>='2022-05-01'
    and tx_hash not in (select tx_hash from tb1)
    group by 1
    ),

    tb4 as (select
    BLOCK_TIMESTAMP::date as day,
    count(distinct tx_hash) as swap_sushi,
    sum(AMOUNT_IN_USD) as volume_sushi,
    volume_sushi/swap_sushi as average_swap_sushi
    Run a query to Download Data