maybeyonasuni_tvl_compare
    Updated 2022-01-22
    with
    sushi_quick_addresses as (
    select distinct * from (
    select distinct from_address as address,from_label as dex
    from polygon.udm_events
    where amount is not null
    and from_label in ('sushiswap','quickswap')
    union all
    select distinct to_address,to_label as dex
    from polygon.udm_events
    where amount is not null
    and to_label in ('sushiswap','quickswap')
    )
    ),
    uniswap_mint_txs as (
    select
    tx_id
    from polygon.transactions
    where to_address = '0xc36442b4a4522e871399cd717abdd847ab11fe88'
    ),
    uniswap_add_rem as (
    select
    tx_id,
    event_name
    from polygon.events_emitted
    where event_removed = 'FALSE'
    and tx_id in (select tx_id from uniswap_mint_txs)
    and event_name in ('DecreaseLiquidity','IncreaseLiquidity')
    limit 100
    ),
    uni_addresses as (
    select distinct * from (
    select distinct from_address as address,'uniswap' as dex
    from polygon.udm_events
    Run a query to Download Data