MostlyData_Time to Inclusion vs P. Fee - by leader
    Updated 2024-11-28
    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'
    ))

    )

    ,txs_generation_data_raw as(
    select
    tx.block_timestamp as inclusion_time,
    tx.block_id,
    tx.tx_id,
    tx.signers[0] as signer,
    (tx.fee - 5000) * pow(10,-9) AS priority_fee,
    tx.recent_block_hash

    from solana.core.fact_transactions tx

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