Expand description
Event store and authoritative log of state-affecting messages for NautilusTrader.
The nautilus-event-store crate provides an embedded, append-only event store that captures
commands, events, venue reports, and correlations flowing across the message bus. Combined with
cache snapshots, it provides stable restarts via tail-replay, deterministic incident replay,
end-to-end audit of agent decisions, and counterfactual research.
See README.md for the high-level specification.
§NautilusTrader
NautilusTrader is an open-source, production-grade, Rust-native engine for multi-asset, multi-venue trading systems.
The system spans research, deterministic simulation, and live execution within a single event-driven architecture, providing research-to-live semantic parity.
Re-exports§
pub use backend::AppendEntry;pub use backend::EventStore;pub use backend::IndexKey;pub use backend::IndexKind;pub use backend::MemoryBackend;pub use backend::RedbBackend;pub use backend::ScanDirection;pub use capture::BusCaptureAdapter;pub use capture::CaptureError;pub use capture::Encode;pub use capture::EncodeError;pub use capture::EncodedPayload;pub use capture::EncoderRegistry;pub use capture::PAYLOAD_TYPE_ACCOUNT_STATE;pub use capture::PAYLOAD_TYPE_FILL_REPORT;pub use capture::PAYLOAD_TYPE_ORDER_FILLED;pub use capture::PAYLOAD_TYPE_ORDER_STATUS_REPORT;pub use capture::PAYLOAD_TYPE_POSITION_STATUS_REPORT;pub use capture::PAYLOAD_TYPE_SUBMIT_ORDER;pub use capture::TypedEncoder;pub use capture::default_registry;pub use capture::encode_account_state;pub use capture::encode_fill_report;pub use capture::encode_order_filled;pub use capture::encode_order_status_report;pub use capture::encode_position_status_report;pub use capture::encode_submit_order;pub use capture::register_default;pub use entry::EventStoreEntry;pub use entry::PayloadType;pub use entry::Topic;pub use error::EventStoreError;pub use hash::EntryHash;pub use hash::compute_entry_hash;pub use headers::Headers;pub use kernel::BootError;pub use kernel::EventStoreLifecycle;pub use kernel::EventStoreLifecycleOptions;pub use kernel::EventStoreSession;pub use kernel::HaltSignal;pub use kernel::KernelError;pub use kernel::RecoveredRun;pub use kernel::RecoveryOutcome;pub use kernel::build_run_id;pub use kernel::open_run;pub use kernel::open_run_with_options;pub use kernel::recover_predecessors;pub use manifest::RunManifest;pub use manifest::RunStatus;pub use markers::CursorState;pub use markers::DEFAULT_MARKER_CHANNEL_CAPACITY;pub use markers::DEFAULT_MARKER_MAX_BATCH;pub use markers::DEFAULT_MARKER_MAX_LATENCY;pub use markers::DataClass;pub use markers::DataCursorSnapshot;pub use markers::DataMarkerCapture;pub use markers::DataMarkerExtractor;pub use markers::DataMarkerExtractorRegistry;pub use markers::HiFiMarker;pub use markers::MarkerBackend;pub use markers::MarkerCountKind;pub use markers::MarkerFinding;pub use markers::MarkerGap;pub use markers::MarkerGapReason;pub use markers::MarkerManifest;pub use markers::MarkerMsg;pub use markers::MarkerReader;pub use markers::MarkerRecordKind;pub use markers::MarkerVerifier;pub use markers::MarkerVerifyReport;pub use markers::MarkerWriter;pub use markers::MarkerWriterConfig;pub use markers::MemoryMarkerBackend;pub use markers::RedbMarkerBackend;pub use markers::StoredMarkerRecord;pub use markers::StreamCursor;pub use markers::StreamDictEntry;pub use markers::StreamSlot;pub use markers::compute_dict_hash;pub use markers::compute_gap_hash;pub use markers::compute_hifi_hash;pub use markers::compute_marker_hash;pub use markers::JoinedStream;pub use markers::join_at_entry;pub use reader::DEFAULT_SCAN_CHUNK_SIZE;pub use reader::EventStoreReader;pub use reader::RangeScan;pub use reader::SnapshotReplayPlan;pub use replay::ParquetReplayCatalog;pub use replay::CacheReplayError;pub use replay::CacheReplayReport;pub use replay::CatalogReplayData;pub use replay::CatalogReplayRecord;pub use replay::CatalogReplaySlice;pub use replay::CatalogSliceCoverage;pub use replay::CatalogSlicePlan;pub use replay::CatalogSliceQuery;pub use replay::CatalogSliceSelector;pub use replay::EventStoreReplayReport;pub use replay::ReplayCatalog;pub use replay::ReplayInputError;pub use replay::ReplayInputPlan;pub use replay::ReplayInputs;pub use replay::ReplaySeqRange;pub use replay::ReplayTimeRange;pub use replay::apply_cache_replay_entry;pub use replay::load_catalog_replay_inputs;pub use replay::load_forensics_replay_inputs;pub use replay::open_event_store_replay_source;pub use replay::plan_catalog_replay_inputs;pub use replay::plan_forensics_replay_inputs;pub use replay::replay_cache_snapshot_tail;pub use replay::restore_cache_from_sealed_run;pub use replay::restore_cache_snapshot_and_replay_tail;pub use replay::restore_cache_snapshot_blob;pub use replay::validate_event_store_replay_source;pub use retention::RetentionPlan;pub use retention::RetentionRun;pub use retention::SnapshotAnchorStatus;pub use retention::list_redb_sealed_runs;pub use retention::plan_redb_retention;pub use retention::plan_retention;pub use snapshot::SnapshotAnchor;pub use snapshot::compute_snapshot_content_hash;pub use verifier::GapRange;pub use verifier::IndexDrift;pub use verifier::ManifestField;pub use verifier::Verifier;pub use verifier::VerifyError;pub use verifier::VerifyFinding;pub use verifier::VerifyReport;pub use writer::DEFAULT_CHANNEL_CAPACITY;pub use writer::DEFAULT_HALT_THRESHOLD;pub use writer::DEFAULT_MAX_BATCH_ENTRIES;pub use writer::DEFAULT_MAX_BATCH_LATENCY;pub use writer::EntryDraft;pub use writer::EventStoreWriter;pub use writer::HaltCallback;pub use writer::HaltReason;pub use writer::SubmitError;pub use writer::WriterConfig;pub use writer::noop_halt;
Modules§
- backend
- Backend abstraction for the event store.
- capture
- Bus capture adapter: the seam that converts dispatched bus messages into event store entries.
- entry
- The captured event store entry.
- error
- Error types for the event store.
- hash
- Canonical entry hashing for the event store.
- headers
- First-class correlation headers propagated end-to-end across the system.
- kernel
- Run lifecycle and kernel boot integration for the event store.
- manifest
- The per-run manifest stored alongside captured entries.
- markers
- Data marker sidecar capture, schema types, canonical content hashes, and writer lane.
- reader
- Reader for the event store.
- replay
- Bootstrap replay for restoring cache state after a cache-owned snapshot.
- retention
- Non-destructive retention planning for sealed event-store run files.
- snapshot
- Snapshot anchors recorded by the event store.
- verifier
- Off-trader verifier that proves a run file’s integrity before the trader opens it.
- writer
- Dedicated writer for the event store.
Structs§
- Data
Marker Config - Opt-in data-marker sidecar settings for an event-store run.
- Event
Store Config - Configuration for the kernel-managed event store run lifecycle.
- Registered
Components - The component manifest captured into the event-store
RunStartedentry. - RunIdentity
- Per-run identification data the kernel populates from build metadata.
Enums§
- Data
Marker Class - Market-data class enabled for data-marker capture.
- Retention
Mode - How the supervisor prunes sealed run files.
Constants§
- DEFAULT_
DATA_ MARKER_ CHANNEL_ CAPACITY - Default capacity of the data-marker writer’s bounded submit channel.
- DEFAULT_
DATA_ MARKER_ SAFETY_ FLUSH_ INTERVAL - Default maximum interval between data-marker cursor snapshots when no entry boundary occurs.
Type Aliases§
- RunId
- The id of a captured run:
<start_ts_init>-<short_uuid>, sortable by start time.