MLDZMNvelod3
    Updated 2022-11-17
    SELECT
    date_trunc('week',block_timestamp) as date,
    'Deposit' as actions,
    count(DISTINCT tx_hash) as no_actions,
    count(distinct ORIGIN_FROM_ADDRESS) as wallets,
    sum(TOKEN0_AMOUNT_USD+TOKEN1_AMOUNT_USD) as volume
    FROM optimism.velodrome.ez_lp_actions where LP_ACTION='deposit'
    GROUP BY 1,2
    union all
    SELECT
    date_trunc('week',block_timestamp) as date,
    'Withdraw' as actions,
    -count(DISTINCT tx_hash) as no_actions,
    -count(distinct ORIGIN_FROM_ADDRESS) as wallets,
    -sum(TOKEN0_AMOUNT_USD+TOKEN1_AMOUNT_USD) as volume
    FROM optimism.velodrome.ez_lp_actions where LP_ACTION='withdraw'
    GROUP BY 1,2
    Run a query to Download Data