0-MIDvelodrome Vs. sushiswap, LP UnStakers
    Updated 2023-04-13
    with act1 as (
    with tab1 as (
    select POOL_ADDRESS
    from ethereum.core.dim_dex_liquidity_pools
    where PLATFORM='sushiswap'),
    tab2 as (
    select BLOCK_TIMESTAMP::date as date,ORIGIN_FROM_ADDRESS,FROM_ADDRESS,CONTRACT_ADDRESS
    from ethereum.core.ez_token_transfers
    where ORIGIN_TO_ADDRESS='0xc2edad668740f1aa35e4d8f227fb8e17dca888cd'
    and FROM_ADDRESS=ORIGIN_TO_ADDRESS
    and SYMBOL='SLP'
    and date>=current_date-90)
    select date,count(distinct ORIGIN_FROM_ADDRESS)as lp_Unstakers,sum(lp_Unstakers)over(order by date asc)as total_lp_unstakers
    from tab1
    left join tab2
    on tab1.POOL_ADDRESS=tab2.CONTRACT_ADDRESS
    group by 1),
    act2 as (
    select BLOCK_TIMESTAMP::date as date,count(distinct LP_PROVIDER_ADDRESS)as lp_unst
    ,sum(lp_unst)over(order by date asc)as total
    from optimism.velodrome.ez_staking_actions
    where STAKING_ACTION_TYPE='withdraw'
    and date>=current_date-90
    group by 1)
    select act2.date,lp_Unstakers as sushi_lp_unstakers,total_lp_unstakers as total_sushi_lp_unstakers
    ,lp_unst as velodrome_lp_unstakers,total as total_velodrome_lp_unstakers
    from act1
    full outer join act2
    on act1.date=act2.date


    Run a query to Download Data