Afonso_DiazOvertime (Withdraw)
    Updated 2025-04-22
    with

    main as (
    select
    tx_id,
    block_timestamp,
    pool_address,
    provider_address as user,
    pool_name,
    platform,
    nvl(token_a_amount_usd, 0) + nvl(token_b_amount_usd, 0) as amount_usd,
    action_type as event_name
    from
    solana.marinade.ez_liquidity_pool_actions
    )

    select
    date_trunc('{{ period }}', block_timestamp) as date,
    pool_name,
    count(distinct tx_id) as transactions,
    count(distinct user) as users,
    sum(amount_usd) as volume_usd,
    avg(amount_usd) as average_amount_usd,
    sum(volume_usd) over (partition by pool_name order by date) as cumulative_volume_usd
    from
    main
    where
    event_name = 'withdraw'
    group by 1, 2
    order by 1, 2


    Last run: about 1 month ago
    DATE
    POOL_NAME
    TRANSACTIONS
    USERS
    VOLUME_USD
    AVERAGE_AMOUNT_USD
    CUMULATIVE_VOLUME_USD
    1
    2021-08-01 00:00:00.000MSOL-SOL207161808164.724397773904.177412549614808164.72439777
    2
    2021-08-01 00:00:00.000MSOL-USDC9990859571.326389148682.538650395354859571.32638914
    3
    2021-09-01 00:00:00.000MSOL-SOL119910878452921.757202817049.9764447062649261086.48160058
    4
    2021-09-01 00:00:00.000MSOL-USDC40838911241591.8358817527552.92116637683612101163.16227089
    5
    2021-09-01 00:00:00.000ORCA-MSOL2492491446538.284123085809.3906992894781446538.28412308
    6
    2021-10-01 00:00:00.000MNDE-MSOL2014175412625229.966688866268.73384641949412625229.96668886
    7
    2021-10-01 00:00:00.000MSOL-ETH31930542097987.91499128131968.6141535776842097987.91499128
    8
    2021-10-01 00:00:00.000MSOL-RAY74656922009762.6319016129503.70325992172722009762.63190161
    9
    2021-10-01 00:00:00.000MSOL-SOL42003724148028852.614920135244.96490831431157289939.0965207
    10
    2021-10-01 00:00:00.000MSOL-USDC32782452303770908.863555292669.58781682586315872072.0258261
    11
    2021-10-01 00:00:00.000MSOL-USDT1956951205715805.9290363105171.67992282019205715805.9290363
    12
    2021-10-01 00:00:00.000ORCA-MSOL1539147525092427.8082565916304.3715453259226538966.09237967
    13
    2021-10-01 00:00:00.000SOBTC-MSOL103465872171112.0367889169797.9806932194572171112.03678891
    14
    2021-10-01 00:00:00.000SOETH-MSOL50435932232977.0697374863954.3195828124632232977.06973748
    15
    2021-10-01 00:00:00.000SOL-MSOL140394142856638.6116638330546.42809099346442856638.61166383
    16
    2021-11-01 00:00:00.000MNDE-MSOL5194912216047.675164914269.84137796707114841277.64185377
    17
    2021-11-01 00:00:00.000MSOL-ETH35920821953446.6160321661151.6618830979464051434.53102344
    18
    2021-11-01 00:00:00.000MSOL-RAY3352961567405.1313434678.82128759104523577167.76324461
    19
    2021-11-01 00:00:00.000MSOL-SOL2103152527289614.0977831312976.516451632491184579553.1943038
    20
    2021-11-01 00:00:00.000MSOL-USDC79051116080223.097673120354.712781864684331952295.1234992
    ...
    1019
    92KB
    3s