MostlyData_Time to Inclusion vs P. Fee (Jito NOT swQoS) - by leader
    Updated 2024-11-28
    -- forked from Time to Inclusion vs P. Fee (Jito NOT Trader API) - by leader @ https://flipsidecrypto.xyz/studio/queries/83a1eab6-7607-46f9-ba31-b356718672c9
    with leader_blocks as(
    select
    block_id

    from solana.gov.fact_rewards_fee

    where
    vote_pubkey = '{{leader}}'
    and ( (
    '{{n_days}}' = 0
    and block_timestamp >= cast('{{start_date}}' as timestamp)
    and block_timestamp < cast('{{end_date}}' as timestamp)
    )
    or
    (
    '{{n_days}}' != 0
    and block_timestamp > current_date() - interval '{{n_days}} days'
    ))

    )

    ,jito_tipers as (
    select
    distinct(tx_from) as sender_address

    from solana.core.fact_transfers tr

    where
    ( (
    '{{n_days}}' = 0
    and block_timestamp >= cast('{{start_date}}' as timestamp)
    and block_timestamp < cast('{{end_date}}' as timestamp)
    )
    or
    (
    QueryRunArchived: QueryRun has been archived