Moesmg 4
    Updated 2022-10-02
    select * ,
    sum(amount)over(partition by pool_name order by days rows between unbounded preceding and current row ) as cum_amount
    from
    (with sushi_pools as
    (select
    POOL_ADDRESS ,pool_name
    from
    ethereum.core.dim_dex_liquidity_pools
    where PLATFORM ilike 'sushiswap')


    select
    BLOCK_TIMESTAMP::date as days ,
    'deposit' as type,
    pool_name,
    count(distinct tx_hash) as txs,
    count(distinct to_address) as users,
    sum(amount_usd) as amount
    from
    ethereum.core.ez_token_transfers t
    join sushi_pools p on to_address = pool_address
    where
    days <'2022-09-15' and AMOUNT_USD is not null
    and origin_function_signature in ('0xf305d719','0xe8e33700')
    and
    to_address in (SELECT POOL_ADDRESS from sushi_pools)
    group by 1,2,3)
    Run a query to Download Data