MoeSushi mg - dep post
    Updated 2022-10-03
    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
    --,sum(amount)over(partition by pool_name order by days rows between unbounded preceding and current row ) as cum_amount
    from
    ethereum.core.ez_token_transfers t
    join sushi_pools p on to_address = pool_address
    where --days between '2022-09-01' and '2022-09-29'
    days between '2022-09-15' and '2022-09-29' and AMOUNT_USD is not null
    and
    tx_hash in (SELECT tx_hash
    FROM ethereum.core.fact_event_logs
    WHERE contract_address IN (SELECT pool_address FROM sushi_pools)
    AND event_name IN ('Mint'))
    group by 1,2,3


    Run a query to Download Data