Afonso_DiazBy Platform Overtime
    Updated 2 days ago
    with

    main as (
    select
    tx_id,
    block_timestamp,
    swapper,
    swap_from_symbol as symbol_in,
    swap_to_symbol as symbol_out,
    abs(nvl(swap_from_amount_usd, swap_to_amount_usd)) as amount_usd,
    case
    when platform ilike 'jupiter%' then 'Jupiter'
    when platform ilike 'raydium%' then 'Raydium'
    when platform ilike 'meteora%' then 'Meteora'
    when platform ilike 'saber%' then 'Saber'
    when platform ilike 'orca%' then 'Orca'
    else initcap(platform)
    end as platform
    from
    solana.marinade.ez_swaps
    where
    succeeded
    and 'MSOL' in (symbol_in, symbol_out)
    )

    select
    date_trunc('{{ period }}', block_timestamp) as date,
    platform,
    count(distinct tx_id) as swaps,
    count(distinct swapper) as swappers,
    sum(amount_usd) as volume_usd,
    avg(amount_usd) as average_amount_usd,
    sum(volume_usd) over (partition by platform order by date) as cumulative_volume_usd
    from
    main
    group by 1, 2
    Last run: 2 days ago
    DATE
    PLATFORM
    SWAPS
    SWAPPERS
    VOLUME_USD
    AVERAGE_AMOUNT_USD
    CUMULATIVE_VOLUME_USD
    1
    2022-07-01 00:00:00.000Jupiter31030134723510880.59413.92395404923510880.59
    2
    2022-07-01 00:00:00.000Orca1191153626522.9495.275019763626522.9
    3
    2022-07-01 00:00:00.000Raydium6858217542057.8278.650293093542057.82
    4
    2022-07-01 00:00:00.000Saber183711387880.7211.148992923387880.7
    5
    2022-08-01 00:00:00.000Jupiter37442011295273272203.6420.407779489296783084.19
    6
    2022-08-01 00:00:00.000Orca217868599507896.35421.87941385310134419.25
    7
    2022-08-01 00:00:00.000Raydium8038316845053951.3962.3759798335596009.21
    8
    2022-08-01 00:00:00.000Saber3930711041912.08263.5083662111429792.78
    9
    2022-09-01 00:00:00.000Jupiter4576039526215845146.8256.56144871512628230.99
    10
    2022-09-01 00:00:00.000Orca150457836864607.93428.34193997316999027.18
    11
    2022-09-01 00:00:00.000Raydium6450916783351940.0451.2889806298947949.25
    12
    2022-09-01 00:00:00.000Saber162035276119.05169.1905943631705911.83
    13
    2022-10-01 00:00:00.000Jupiter187494482984982416.17273.679516711597610647.16
    14
    2022-10-01 00:00:00.000Raydium8950015605098874.4154.0386876314046823.66
    15
    2022-10-01 00:00:00.000Orca103608074097472.71364.05799289221096499.89
    16
    2022-10-01 00:00:00.000Saber64532110332.92167.4247647951816244.75
    17
    2022-11-01 00:00:00.000Jupiter84637711511140455961.9791.56172574738066609.13
    18
    2022-11-01 00:00:00.000Raydium233994496914774368.1158.10618099228821191.77
    19
    2022-11-01 00:00:00.000Orca30623122013911898.49411.4728923435008398.38
    20
    2022-11-01 00:00:00.000Saber13610772329651.19170.1096159184145895.94
    ...
    205
    16KB
    7s