Crate sdk
Expand description
SDK: Strategy trait, context, events, and order intents.
This is the stable boundary between the platform and proprietary strategies. Strategies depend only on this crate.
Re-exports§
pub use context::Clock;pub use context::FeatureStore;pub use context::FlowMetrics;pub use context::NullFeatureStore;pub use context::RegimeState;pub use context::ReplayClock;pub use context::StrategyConfig;pub use context::StrategyContext;pub use context::SystemClock;pub use event::Event;pub use intents::IntentAction;pub use intents::OrderIntent;pub use intents::TimeInForce;pub use strategy::Strategy;
Modules§
- context
- Strategy context: read-only state, clock, and feature store.
- convert
- SDK → core OrderIntent conversion.
- event
- Curated event view for strategy consumption.
- indicators
- Common technical indicators for strategy use.
- intents
- Strategy-facing order intents.
- strategy
- The core strategy trait.
Structs§
- Asset
- Currency or token identifier (e.g.
USD,BTC,ETH). - Client
Intent Id - Client-generated intent identifier for idempotency.
- FeeDetail
- Fee breakdown attached to a fill.
- Fill
- §8.10 — Trade execution (partial/full).
- Instrument
- Rich instrument metadata.
- Instrument
Id - Canonical stable instrument key.
- Invalid
Instrument Id - Invalid
Venue Id - L2Book
- In-memory L2 order book keyed by price.
- L2Update
- A level-2 order book update (delta or snapshot).
- Liquidation
Event - Observed liquidation event from a venue.
- Market
Event - §8.4 — Canonical market data.
- Ohlcv
Bar - A completed OHLCV bar (candlestick) from a venue.
- Order
- A tracked order in the engine state.
- OrderId
- Venue-assigned order identifier.
- Order
State Event - §8.11 — Explicit order state transition.
- Pending
Intent - Cached intent data for constructing an
OrderwhenExecutionAckarrives. - Portfolio
State - Top-level derived state maintained by the reducer.
- Position
- A position on a specific venue + instrument.
- Position
Key - Key for position lookup: (venue_id, instrument_id).
- Risk
State Event - §8.13 — Risk stop-state transition.
- Trade
- A single trade observed from a venue.
- VenueId
- Extensible venue identifier.
Enums§
- Core
Intent Action - Platform-core
IntentActionused inPendingIntentandOrder. - Instrument
Kind - Product classification for an instrument.
- Invalid
Instrument - Market
Data - Typed market data payload. Serializes with an internal
market_typetag so the journal record includes an explicit discriminant per JOURNAL_SPEC §8.4. - Market
Data Type - Discriminant for
MarketDatavariants, used to declare which market data types a strategy consumes (see [Strategy::market_types]). - Mode
- Engine operating mode (JOURNAL_SPEC §4).
- Order
Lifecycle State - Order lifecycle state (§8.11).
- Order
Type - Order type (§8.5).
- Risk
Stop State - Risk stop state (§8.13).
- Side
- Order / trade side.
Constants§
- VERSION
- SDK crate version, sourced from
Cargo.tomlat compile time.