pub struct CreateSessionParams {
pub start_slot: u64,
pub end_slot: u64,
pub signer_filter: BTreeSet<Address>,
pub send_summary: bool,
pub reroute: Option<RerouteParams>,
pub capacity_wait_timeout_secs: Option<u16>,
pub disconnect_timeout_secs: Option<u16>,
pub extra_compute_units: Option<u32>,
pub discoveries: Vec<DiscoveryFilter>,
pub actions: Vec<ScheduledAction>,
pub replay_account_state: bool,
pub diagnostic_probes: Vec<DiagnosticProbeParams>,
}Expand description
Parameters required to start a new backtest session.
Fields§
§start_slot: u64First slot (inclusive) to replay.
end_slot: u64Last slot (inclusive) to replay.
signer_filter: BTreeSet<Address>Skip transactions signed by these addresses.
send_summary: boolWhen true, include a session summary with transaction statistics in client-facing
Completed responses. Summary generation remains enabled internally for metrics.
reroute: Option<RerouteParams>Re-quote historical swaps through the metis router. Absent: plain replay.
capacity_wait_timeout_secs: Option<u16>Maximum seconds to wait for ECS capacity-related startup retries before failing session creation. If not set (or 0), capacity errors fail immediately.
disconnect_timeout_secs: Option<u16>Maximum seconds to keep the session alive after the control websocket disconnects.
If not set (or 0), the session tears down immediately on disconnect.
Clamped to MAX_DISCONNECT_TIMEOUT_SECS (900 seconds / 15 minutes).
extra_compute_units: Option<u32>Extra compute units to add to each transaction’s SetComputeUnitLimit budget.
Useful when replaying with an account override whose program uses more CU than
the original, causing otherwise-healthy transactions to run out of budget.
Only applied when a SetComputeUnitLimit instruction is already present.
discoveries: Vec<DiscoveryFilter>Events of interest the session should watch for. When an upcoming
batch matches any filter, the server emits
BacktestResponse::DiscoveryBatch (and its session-event twins)
ahead of execution so the client can follow up with
BacktestRequest::ContinueTo to pause before the batch. Empty
means no batch discoveries are performed (existing behaviour).
actions: Vec<ScheduledAction>Transactions the server runs automatically during the backtest, with
results streamed over actionSubscribe.
Compressed as a whole rather than per action: a per-slot schedule repeats near-identical account bytes thousands of times, and that redundancy is only visible across actions. Compressing each action alone leaves a 10k-slot schedule near the websocket message limit; compressing the vector takes the same schedule from ~28 MiB to ~1 MiB.
replay_account_state: boolReplay accounts states for this range instead of executing transactions — a state-only acceleration.
diagnostic_probes: Vec<DiagnosticProbeParams>Implementations§
Source§impl CreateSessionParams
impl CreateSessionParams
Sourcepub fn builder() -> CreateSessionParamsBuilder
pub fn builder() -> CreateSessionParamsBuilder
Create an instance of CreateSessionParams using the builder syntax
Source§impl CreateSessionParams
impl CreateSessionParams
Sourcepub fn requires_sidecar(&self) -> bool
pub fn requires_sidecar(&self) -> bool
Whether a session needs the metis sidecar (reroute quotes through it). Only metis re-quoting needs the sidecar; a direct-fill-only run prices without a router.
Sourcepub fn requires_diagnostic_endpoint(&self) -> bool
pub fn requires_diagnostic_endpoint(&self) -> bool
Whether the sidecar has to start metis with --enable-diagnostic. A reroute run asks for
the same endpoint through an operator variable the sidecar inherits; probes are a session
parameter, so they have to ask through the launch spec.
pub fn validate_diagnostic_probes(&self) -> Result<(), DiagnosticProbeError>
Sourcepub fn warms_account_universe(&self) -> bool
pub fn warms_account_universe(&self) -> bool
Whether the session should warm its account universe before replaying.
pub fn reroute_order_flow(&self) -> bool
Sourcepub fn override_schedule(&self) -> Result<OverrideSchedule, String>
pub fn override_schedule(&self) -> Result<OverrideSchedule, String>
The Override actions in Self::actions, compiled into the slot-keyed schedule the
reroute layer consumes. Same-slot actions merge account-wise, later wins.
Sourcepub fn reroute_filter(&self) -> Option<&RerouteFilter>
pub fn reroute_filter(&self) -> Option<&RerouteFilter>
The mint pairs re-quoting is restricted to, if the run named any.