Madigas v2/v3
    Updated 2022-10-26
    with df as (select
    a.BLOCK_TIMESTAMP as BLOCK_TIMESTAMP,
    a.TX_HASH as TX_HASH,
    b.platform as platform,
    a.TX_FEE as TX_FEE,
    a.GAS_PRICE as GAS_PRICE,
    a.GAS_USED as GAS_USED
    from
    ethereum.core.fact_transactions a
    join ethereum.core.ez_dex_swaps b
    on a.tx_hash = b.tx_hash)

    SELECT
    date_trunc('month', BLOCK_TIMESTAMP) as date,
    platform,
    sum(tx_fee) as total_tx_fee
    from df
    WHERE (platform = 'uniswap-v2' or platform = 'uniswap-v3') and date >= '2021-05-01'
    group by date, platform
    Run a query to Download Data