Expand description
Canonical events delivered by the engine to strategies.
Events are the read-side API for strategies. Market polling, fill polling, account snapshots, and exchange health changes are normalized into this enum before strategy code sees them.
§Example
use bot_core::{Event, ExchangeId, InstrumentId, Price, QuoteEvent};
use rust_decimal::Decimal;
let event = Event::Quote(QuoteEvent {
exchange: ExchangeId::new("hyperliquid"),
instrument: InstrumentId::new("BTC-PERP"),
bid: Price::new(Decimal::new(64_990, 0)),
ask: Price::new(Decimal::new(65_010, 0)),
ts: 1_700_000_000_000,
});
assert_eq!(event.instrument().unwrap().as_str(), "BTC-PERP");
assert_eq!(event.ts(), 1_700_000_000_000);Structs§
- Exchange
State Changed Event - Exchange state changed (Active <-> Halted)
- Funding
Rate Event - Funding rate changed
- Order
Accepted Event - Order accepted by exchange
- Order
Canceled Event - Order canceled
- Order
Completed Event - Order completed (terminal: fully filled)
- Order
Filled Event - Order filled (partial or full) - derived from userFills
- Order
Rejected Event - Order rejected by exchange (or locally by engine)
- Quote
Event - Quote update (bid/ask)
Enums§
- Event
- Events that strategies can receive.