Skip to main content

jito_bundle/config/
tip_strategy.rs

1use crate::constants::{DEFAULT_TIP_LAMPORTS, MAX_TIP_LAMPORTS};
2
3/// Strategy for selecting bundle tip lamports.
4#[derive(Debug, Clone)]
5pub enum TipStrategy {
6    /// Uses a fixed tip amount.
7    Fixed(u64),
8    /// Uses raw fetched tip floor value.
9    FetchFloor,
10    /// Uses fetched floor clamped to configured min/max.
11    FetchFloorWithCap {
12        /// Minimum tip in lamports.
13        min: u64,
14        /// Maximum tip in lamports.
15        max: u64,
16    },
17}
18
19impl Default for TipStrategy {
20    /// Returns default capped floor strategy.
21    fn default() -> Self {
22        TipStrategy::FetchFloorWithCap {
23            min: DEFAULT_TIP_LAMPORTS,
24            max: MAX_TIP_LAMPORTS,
25        }
26    }
27}