Ariooptimism and ftx - velodrome - 4
    Updated 2022-11-18
    with deposit as (
    select
    BLOCK_TIMESTAMP::date as date,
    --concat(TOKEN0_SYMBOL, '-', TOKEN1_SYMBOL) as "Pool",
    LP_ACTION,
    sum(TOKEN0_AMOUNT_USD + TOKEN1_AMOUNT_USD) as "deposit-USD"
    from optimism.velodrome.ez_lp_actions
    where BLOCK_TIMESTAMP >= CURRENT_DATE - 17
    and LP_ACTION = 'deposit'
    group by 1,2
    ),
    withdraw as (
    select
    BLOCK_TIMESTAMP::date as date,
    --concat(TOKEN0_SYMBOL, '-', TOKEN1_SYMBOL) as "Pool",
    LP_ACTION,
    sum(TOKEN0_AMOUNT_USD + TOKEN1_AMOUNT_USD) as "withdraw-USD"
    from optimism.velodrome.ez_lp_actions
    where BLOCK_TIMESTAMP >= CURRENT_DATE - 17
    and LP_ACTION = 'withdraw'
    group by 1,2
    )
    select
    date,
    case
    when date between '2022-11-02' and '2022-11-06' then 'CoinDesk report'
    when date between '2022-11-07' and '2022-11-08' then 'Binance decided to sell its FTT holding'
    when date between '2022-11-09' and '2022-11-10' then 'Binance announced plans to acquire FTX but...'
    when date like '2022-11-11%' then 'FTX filed for Chapter 11 bankruptcy protection'
    when date between '2022-11-12' and '2022-11-13' then 'FTX Hacked'
    when date like '2022-11-14%' then 'Softbank wrote down a $100 million investment in FTX'
    else 'Not Special News'
    end as status,
    "deposit-USD" - "withdraw-USD" as "Net LP Volume Change",
    sum("Net LP Volume Change") over(order by date) as "Cumulative Net LP Volume Change"
    from deposit join withdraw using (date)
    Run a query to Download Data