fantaSUSHI : Swap
    Updated 2022-05-24
    with swaps_from_sushi_amount as (select sum(amount_in),block_timestamp::date as dt
    from ethereum.dex_swaps
    where token_address='0x6b3595068778dd592e39a122f4f5a5cf09c90fe2' and amount_in is not null and block_timestamp::date >= '2022-05-01'
    group by dt)
    ,swaps_to_sushi_number as (select sum(amount_out),block_timestamp::date as dt
    from ethereum.dex_swaps
    where token_address='0x6b3595068778dd592e39a122f4f5a5cf09c90fe2' and amount_out is not null and block_timestamp::date >= '2022-05-01'
    group by dt)
    ,total_liquidity as (select sum(amount_usd) AS liquidity , platform
    FROM ethereum.dex_liquidity_pools
    LEFT JOIN ethereum.udm_events ON to_address = pool_address
    WHERE to_address = pool_address and amount_usd IS NOT NULL
    and token0='0x6b3595068778dd592e39a122f4f5a5cf09c90fe2' and ethereum.udm_events.block_timestamp::date >= '2022-05-01'
    group by platform)
    ,total_liquidity_overtime as (select sum(amount_usd) AS liquidity , platform,ethereum.udm_events.block_timestamp::date as dt
    FROM ethereum.dex_liquidity_pools
    LEFT JOIN ethereum.udm_events ON to_address = pool_address
    WHERE to_address = pool_address and amount_usd IS NOT NULL
    and token0='0x6b3595068778dd592e39a122f4f5a5cf09c90fe2' and ethereum.udm_events.block_timestamp::date >= '2022-05-01'
    group by platform,dt)
    ,staked as ( select sum(amount) as volume_usd, block_timestamp::date as dt
    from ethereum.udm_events
    where contract_address = '0x8798249c2e607446efb7ad49ec89dd1865ff4272'
    and ORIGIN_FUNCTION_SIGNATURE = '0xa59f3e0c'
    and symbol='xSUSHI'
    and amount is not null
    and block_timestamp >= '2022-05-01'
    group by dt )
    , unstake as (select sum(amount) as volume_usd,block_timestamp::date as dt
    from ethereum.udm_events
    where contract_address = '0x8798249c2e607446efb7ad49ec89dd1865ff4272'
    and ORIGIN_FUNCTION_SIGNATURE = '0x67dfd4c9'
    and symbol = 'xSUSHI'
    and amount is not null
    and block_timestamp >= '2022-05-01'
    group by dt)
    Run a query to Download Data