kingharald-ethCompare daily average amount swap between Metamask and Sushiswap and Uniswap
    Updated 2022-06-25
    with metamask as (
    select date_trunc('day', a.block_timestamp) as date, avg(eth_value) as metamask_average_swap_amount from ethereum.core.fact_event_logs a
    join ethereum.core.fact_transactions b on a.tx_hash = b.tx_hash
    where a.tx_status = 'SUCCESS'
    and a.ORIGIN_TO_ADDRESS = '0x881d40237659c251811cec9c364ef91dc08d300c'
    and a.block_timestamp::date >= '2022-01-01'
    group by date
    ),
    sushiswap as (
    select date_trunc('day', a.block_timestamp) as date, avg(eth_value) as sushiswap_average_swap_amount from ethereum.core.fact_event_logs a
    join ethereum.core.fact_transactions b on a.tx_hash = b.tx_hash
    where a.tx_status = 'SUCCESS'
    and a.ORIGIN_TO_ADDRESS = '0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f'
    and a.block_timestamp::date >= '2022-01-01'
    and
    (
    a.ORIGIN_FUNCTION_SIGNATURE = '0x7ff36ab5' OR
    a.ORIGIN_FUNCTION_SIGNATURE = '0x18cbafe5'
    )
    group by date
    )
    ,

    uniswap as (
    select date_trunc('day', a.block_timestamp) as date, avg(eth_value) as uniswap_average_swap_amount from ethereum.core.fact_event_logs a
    join ethereum.core.fact_transactions b on a.tx_hash = b.tx_hash
    where a.tx_status = 'SUCCESS'
    and a.block_timestamp::date >= '2022-01-01'
    and a.ORIGIN_TO_ADDRESS = '0x7a250d5630b4cf539739df2c5dacb4c659f2488d'
    and
    (
    a.ORIGIN_FUNCTION_SIGNATURE = '0xfb3bdb41' OR
    a.ORIGIN_FUNCTION_SIGNATURE = '0x5c11d795' OR
    a.ORIGIN_FUNCTION_SIGNATURE = '0x7ff36ab5' OR
    a.ORIGIN_FUNCTION_SIGNATURE = '0x791ac947' OR
    a.ORIGIN_FUNCTION_SIGNATURE = '0x18cbafe5'
    Run a query to Download Data