Skip to main content

Crate sdk

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).
ClientIntentId
Client-generated intent identifier for idempotency.
FeeDetail
Fee breakdown attached to a fill.
Fill
§8.10 — Trade execution (partial/full).
Instrument
Rich instrument metadata.
InstrumentId
Canonical stable instrument key.
InvalidInstrumentId
InvalidVenueId
L2Book
In-memory L2 order book keyed by price.
L2Update
A level-2 order book update (delta or snapshot).
LiquidationEvent
Observed liquidation event from a venue.
MarketEvent
§8.4 — Canonical market data.
OhlcvBar
A completed OHLCV bar (candlestick) from a venue.
Order
A tracked order in the engine state.
OrderId
Venue-assigned order identifier.
OrderStateEvent
§8.11 — Explicit order state transition.
PendingIntent
Cached intent data for constructing an Order when ExecutionAck arrives.
PortfolioState
Top-level derived state maintained by the reducer.
Position
A position on a specific venue + instrument.
PositionKey
Key for position lookup: (venue_id, instrument_id).
RiskStateEvent
§8.13 — Risk stop-state transition.
Trade
A single trade observed from a venue.
VenueId
Extensible venue identifier.

Enums§

CoreIntentAction
Platform-core IntentAction used in PendingIntent and Order.
InstrumentKind
Product classification for an instrument.
InvalidInstrument
MarketData
Typed market data payload. Serializes with an internal market_type tag so the journal record includes an explicit discriminant per JOURNAL_SPEC §8.4.
MarketDataType
Discriminant for MarketData variants, used to declare which market data types a strategy consumes (see [Strategy::market_types]).
Mode
Engine operating mode (JOURNAL_SPEC §4).
OrderLifecycleState
Order lifecycle state (§8.11).
OrderType
Order type (§8.5).
RiskStopState
Risk stop state (§8.13).
Side
Order / trade side.

Constants§

VERSION
SDK crate version, sourced from Cargo.toml at compile time.

Type Aliases§

Fee
Fee amount. Always Decimal — no floats.
Price
Price in quote currency. Always Decimal — no floats.
Qty
Quantity in base currency. Always Decimal — no floats.