MostlyData_Solana Sandwich Analysis - By Leader Slots
    Updated 2025-04-02
    -- forked from Solana Sandwich Analysis - general @ https://flipsidecrypto.xyz/studio/queries/a618941b-26bd-4a3f-9355-8dc072d803e8

    with date_filter as (
    select
    case
    when {{n_days}} != 0 then dateadd(day, -{{n_days}}, current_date())
    else to_timestamp('{{start_date}}')
    end start_date,
    case
    when {{n_days}} != 0 then current_date()
    else to_timestamp('{{end_date}}')
    end end_date
    )

    ,block_filter as(
    select
    rf.block_id

    from solana.gov.fact_rewards_fee rf
    join date_filter df

    where
    rf.block_timestamp between df.start_date and df.end_date
    and pubkey = '{{validator_pubkey}}'
    )

    ,tx_list as(
    select
    ft.tx_id,
    ft.block_id,
    ft.block_timestamp,
    ft.tx_index
    from block_filter bf
    join date_filter df
    inner join solana.core.fact_transactions ft
    Last run: 23 days ago
    No Data to Display
    0
    2B
    35s