Afonso_DiazOvertime
    Updated 2025-04-22
    WITH main AS (
    SELECT
    tx_id,
    block_timestamp,
    pool_address,
    provider_address AS user,
    pool_name,
    platform,
    token_a_amount_usd + token_b_amount_usd AS amount_usd,
    action_type AS event_name
    FROM
    solana.marinade.ez_liquidity_pool_actions
    )

    SELECT
    DATE_TRUNC('{{ period }}', block_timestamp) AS date,
    event_name,
    platform,
    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(SUM(amount_usd)) OVER (PARTITION BY platform, event_name ORDER BY DATE_TRUNC('{{ period }}', block_timestamp)) AS cumulative_volume_usd
    FROM
    main
    GROUP BY 1, 2, 3
    ORDER BY 1, 2, 3;

    Last run: about 1 month ago
    DATE
    EVENT_NAME
    PLATFORM
    TRANSACTIONS
    USERS
    VOLUME_USD
    AVERAGE_AMOUNT_USD
    CUMULATIVE_VOLUME_USD
    1
    2021-08-01 00:00:00.000depositorca2112112014033.622757189545.1830462425592014033.62275718
    2
    2021-08-01 00:00:00.000depositraydium39025841268.439071372063.421953568541268.43907137
    3
    2021-08-01 00:00:00.000withdraworca7171799673.8113442311263.01142738352799673.81134423
    4
    2021-08-01 00:00:00.000withdrawraydium23517655488.39934433264.02349084117655488.3993443
    5
    2021-09-01 00:00:00.000depositorca3242324220223066.6778833913419.42048963728722237100.30064057
    6
    2021-09-01 00:00:00.000depositraydium706547171835.938189691576.476497153119213104.37726106
    7
    2021-09-01 00:00:00.000withdraworca1185118512507527.4904181921490.5970625742113307201.30176242
    8
    2021-09-01 00:00:00.000withdrawraydium671532180602.629586642408.0350611552236091.02893094
    9
    2021-10-01 00:00:00.000depositmeteora27881416
    10
    2021-10-01 00:00:00.000depositorca3423517828548343706.590779523381.532772931074570580806.8914201
    11
    2021-10-01 00:00:00.000depositraydium170233661599781216.300086944010.949244209485599994320.6773479
    12
    2021-10-01 00:00:00.000withdrawmeteora1403941
    13
    2021-10-01 00:00:00.000withdraworca93177722334905010.20590959485.79222129823348212211.5076715
    14
    2021-10-01 00:00:00.000withdrawraydium62733384308638819.796666465348.04569059207308874910.8255973
    15
    2021-11-01 00:00:00.000depositmeteora485261
    16
    2021-11-01 00:00:00.000depositorca36359677461872729.24519092829.761227769993632453536.136611
    17
    2021-11-01 00:00:00.000depositraydium9049104922780245.33550393167.001992979828622774566.0128518
    18
    2021-11-01 00:00:00.000withdrawmeteora908613
    19
    2021-11-01 00:00:00.000withdraworca4572285750916244.9653266225951.19519129797399128456.4729981
    20
    2021-11-01 00:00:00.000withdrawraydium1925137827917784.0985760421491.750653253304336792694.92417336
    ...
    266
    28KB
    3s