adriaparcerisasProfits for AMMs Sushiswap
    Updated 2022-04-20
    -- Q63. What is the total profit (in dollars) per day that is generated from swaps out of the liquidity pools in 2022?
    -- Do you see a trend? Can you compare sushiswap with Uniswap?

    with
    table1 as (
    SELECT
    trunc(block_timestamp,'day') as date,
    sum(amount_usd)*0.0025 as sushiswap_profits
    from ethereum.dex_swaps
    where block_timestamp>='2022-01-01'
    and platform='sushiswap'
    and amount_usd<1e9
    group by 1
    order by 1 asc
    ),
    table2 as (
    SELECT
    trunc(block_timestamp,'day') as date,
    sum(amount_usd)*0.003 as uniswapv2_profits
    from ethereum.dex_swaps
    where block_timestamp>='2022-01-01'
    and platform='uniswap-v2'
    and amount_usd<1e9
    group by 1
    order by 1 asc
    ),
    table3 as (
    SELECT
    trunc(block_timestamp,'day') as date,
    sum(amount_usd)*0.003 as uniswapv3_profits
    from ethereum.dex_swaps
    where block_timestamp>='2022-01-01'
    and platform='uniswap-v3'
    and amount_usd<1e9
    group by 1
    order by 1 asc
    Run a query to Download Data