pub struct CreateSessionParams {
pub start_slot: u64,
pub end_slot: u64,
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 session: the params of createBacktestSession, or the
request of a CreateBacktestSessionRequestV1. Fields are camelCase on the wire.
Build one with CreateSessionParams::builder; only start_slot and end_slot are
required. List the ranges you can replay with GET /available-ranges (AvailableRange).
Fields§
§start_slot: u64First slot (inclusive) to replay. A single session must start exactly at an available
range’s bundle_start_slot. A parallel run may start inside a range; its first session
then starts at that range’s bundle_start_slot.
end_slot: u64Last slot (inclusive) to replay, at most the range’s max_bundle_end_slot.
send_summary: boolSend a SessionSummary with completed. Default false: completed carries none.
reroute: Option<RerouteParams>Reroute historical swaps. Absent: plain replay.
capacity_wait_timeout_secs: Option<u16>Seconds to keep retrying while the server has no capacity for a new session, before failing the create. Unset or 0: fail at once when the server is busy.
disconnect_timeout_secs: Option<u16>Seconds the session waits for you to reattach after the session control channel drops.
Unset: 30 (900 for a parallel run). 0: the session ends with the connection and responses
carry no sequence number; otherwise they are wrapped in a SequencedResponse. Clamped to
MAX_DISCONNECT_TIMEOUT_SECS (900 seconds).
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: no
discoveryBatch events.
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 recorded account state for this range instead of executing its transactions,
which is faster. Needs an account-state bundle for the range (BundleKind::AccountState).
Nothing executes, so sending transactions, kind: send actions and transaction lookups
are rejected; simulations still work.
diagnostic_probes: Vec<DiagnosticProbeParams>Markets to probe through the router as the session runs, streamed over
diagnosticSubscribe.
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_diagnostic_endpoint(&self) -> bool
pub fn requires_diagnostic_endpoint(&self) -> bool
Whether the sidecar has to start the router with --enable-diagnostic. A rerouting session
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.
Sourcepub fn validate_diagnostic_probes(&self) -> Result<(), DiagnosticProbeError>
pub fn validate_diagnostic_probes(&self) -> Result<(), DiagnosticProbeError>
Checks every Self::diagnostic_probes entry, as the server does.
Sourcepub fn validate_action_resolvers(&self) -> Result<(), ActionResolveError>
pub fn validate_action_resolvers(&self) -> Result<(), ActionResolveError>
Checks every action’s resolver; see validate_resolvers.
Sourcepub fn reroute_order_flow(&self) -> bool
pub fn reroute_order_flow(&self) -> bool
Whether the session reroutes swaps, that is whether Self::reroute is set.
Sourcepub fn reroute_filter(&self) -> Option<&RerouteFilter>
pub fn reroute_filter(&self) -> Option<&RerouteFilter>
The mint pairs rerouting is restricted to, if the session named any.