#[non_exhaustive]pub struct PreTradeLock { /* private fields */ }Expand description
Stable lock context captured during pre-trade reservation.
PreTradeLock is not just a copy of request input. It is the serialized context of
what the engine actually reserved and how that reservation must later be
reconciled.
Policies may need to persist data that is known at reservation time but will also be required later, when execution reports arrive and the engine must release, consume, or re-price the remaining reserved state correctly. Typical examples include the reservation price, translated quantities, or any other policy-specific values that describe how funds were locked.
The lock context must travel together with the order lifecycle. If a policy relies on execution report fill details to reconcile the reservation, the lock produced during pre-trade must be stored until the final execution report for that order has been processed. Dropping it too early breaks the engine’s ability to correctly unlock the unused remainder or finalize the reserved state using the same assumptions that were applied when the order was accepted.
A common case is price-sensitive reservation. The engine may reserve funds using a worst execution price known during pre-trade. Later, when partial fills and the final terminal report arrive, that same price must still be available to compute how much reserved amount remains to be released. Without the stored lock context, post-trade reconciliation would need to guess, which is not a valid contract for deterministic risk handling.
In other words, PreTradeLock is the continuation token of reservation logic. It
captures the policy context that must survive from pre-trade acceptance to
the last execution report relevant for that reservation.
This crate exposes Serde compatibility only when the serde feature is
enabled. Applications embedding openpit choose the concrete transport
format themselves.
JSON is the canonical format for external bindings. Binary transports such as MessagePack and CBOR are selected by the consuming application. Bincode remains Rust-only and is outside the cross-language compatibility contract.
Implementations§
Trait Implementations§
Source§impl Clone for PreTradeLock
impl Clone for PreTradeLock
Source§fn clone(&self) -> PreTradeLock
fn clone(&self) -> PreTradeLock
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more