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,
}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.
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).
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.
Trait Implementations§
Source§impl Clone for CreateSessionParams
impl Clone for CreateSessionParams
Source§fn clone(&self) -> CreateSessionParams
fn clone(&self) -> CreateSessionParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CreateSessionParams
impl Debug for CreateSessionParams
Source§impl<'de> Deserialize<'de> for CreateSessionParams
impl<'de> Deserialize<'de> for CreateSessionParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<CreateSessionParams> for CreateBacktestSessionRequest
impl From<CreateSessionParams> for CreateBacktestSessionRequest
Source§fn from(value: CreateSessionParams) -> Self
fn from(value: CreateSessionParams) -> Self
Auto Trait Implementations§
impl Freeze for CreateSessionParams
impl RefUnwindSafe for CreateSessionParams
impl Send for CreateSessionParams
impl Sync for CreateSessionParams
impl Unpin for CreateSessionParams
impl UnsafeUnpin for CreateSessionParams
impl UnwindSafe for CreateSessionParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more