25#include "fastmm/core/engine_runner.hpp"
61 std::uint32_t
pid = 0;
105 [[nodiscard]]
virtual std::string_view
name() const noexcept = 0;
112 std::uint64_t session_id, std::span<const
Instrument> table) = 0;
115 virtual
void begin() = 0;
130 virtual void commit() = 0;
133 virtual void close() = 0;
135 [[nodiscard]]
virtual std::uint64_t
rows() const noexcept = 0;
136 [[nodiscard]] virtual std::uint64_t
errors() const noexcept = 0;
Definition backend.hpp:100
virtual void reject(const RejectRecord &)
An order refused by the pre-trade checks or by its venue. The default drops it.
Definition backend.hpp:131
virtual void begin()=0
One batch. StoreThread calls begin(), then zero or more records, then commit().
virtual ~Backend()=default
Backend & operator=(const Backend &)=delete
virtual Result< void, std::string > session_close(const SessionClose &s)=0
virtual Result< void, std::string > open(const BackendOptions &opts)=0
Opens or creates the store and brings its schema up to date.
virtual void position(const PositionRecord &r)=0
virtual void param(const ParamRecord &)
A strategy parameter update the engine applied. The default drops it.
Definition backend.hpp:129
virtual std::uint64_t errors() const noexcept=0
virtual void order(const OrderRecord &r)=0
virtual void replayed(const ReplayedRecord &)
A venue's execution replay ended complete.
Definition backend.hpp:127
virtual Result< void, std::string > instruments(std::uint64_t session_id, std::span< const Instrument > table)=0
The instrument table of this session, by dense id.
virtual void funding(const FundingRecord &)
A funding payment.
Definition backend.hpp:124
virtual std::string last_error() const =0
virtual void kill(const KillRecord &r)=0
virtual std::string_view name() const noexcept=0
virtual Result< void, std::string > session_open(const SessionOpen &s)=0
virtual void fill(const FillRecord &r)=0
virtual std::uint64_t rows() const noexcept=0
Typed configuration (8.7).
Minimal expected<T, E>: the hot path never throws, it returns Result.
Instrument: the single definition of a tradable contract (5.3 / 5.15).
Definition backend.hpp:39
KillReason
Why a kill switch (global or one venue's) was tripped.
Definition enums.hpp:523
Record stream: the engine's second outbound queue, next to the journal.
One execution.
Definition record_stream.hpp:106
A funding payment the engine booked (FundingMsg): amount in the instrument's settlement currency,...
Definition record_stream.hpp:160
Free-form section used by the sim / backtest libraries: dotted keys -> stringified value.
Definition config.hpp:287
Definition instrument.hpp:29
A kill switch trip. hdr.flags & kVenue marks a per-venue trip (hdr.venue names it).
Definition record_stream.hpp:174
The OMS record after a transition.
Definition record_stream.hpp:137
A strategy parameter update the engine applied (ParamUpdateMsg): after the header,...
Definition record_stream.hpp:203
One instrument's position and the portfolio totals at the same instant.
Definition record_stream.hpp:144
One order refused: by the pre-trade checks (the engine's) or by its venue (an OrderReject),...
Definition record_stream.hpp:272
A venue's execution replay ended complete (a reconciliation began with ReconcileMsg::kExecutionsExact...
Definition record_stream.hpp:194
What a backend is built with.
Definition backend.hpp:43
const GenericSection * config
Definition backend.hpp:44
std::string default_dir
[engine] journal_dir; where a backend may default its files
Definition backend.hpp:46
bool read_only
opened by a query tool, not by a session
Definition backend.hpp:47
std::string engine_name
[engine] name
Definition backend.hpp:45
Written once, after the last record.
Definition backend.hpp:88
RunnerStats stats
Definition backend.hpp:97
std::uint64_t session_id
Definition backend.hpp:89
std::vector< std::string > journal_paths
every part, in order
Definition backend.hpp:96
int exit_code
Definition backend.hpp:91
KillReason kill_reason
Definition backend.hpp:92
bool journal_complete
the journal was closed cleanly
Definition backend.hpp:94
std::int64_t stopped_ns
Definition backend.hpp:90
std::uint64_t journal_bytes
Definition backend.hpp:95
bool kill_latched
Definition backend.hpp:93
The strategy's parameter table in schema order: a ParamRecord's field index names an entry.
Definition backend.hpp:70
std::string name
Definition backend.hpp:71
std::uint8_t type
Definition backend.hpp:72
The parameters the session starts with.
Definition backend.hpp:77
std::string text
Definition backend.hpp:79
std::int64_t raw
Definition backend.hpp:80
bool has_raw
Definition backend.hpp:81
std::string name
Definition backend.hpp:78
Written once, before any record.
Definition backend.hpp:51
std::string host
Definition backend.hpp:62
std::vector< ParamField > param_table
Definition backend.hpp:74
std::string journal_path
first journal part; empty when journaling is off
Definition backend.hpp:61
std::uint64_t session_id
Definition backend.hpp:52
std::vector< std::string > venues
[venues.
Definition backend.hpp:66
std::string build_info
compiler, flags, build type
Definition backend.hpp:58
std::vector< ParamValue > params
Definition backend.hpp:83
bool params_complete
Definition backend.hpp:84
std::uint16_t session_epoch
Definition backend.hpp:53
std::uint32_t pid
Definition backend.hpp:63
std::string config_toml
effective configuration, secrets omitted
Definition backend.hpp:60
std::string version
FASTMM_VERSION_STRING.
Definition backend.hpp:57
std::int64_t pnl_carry_raw
net PnL carried in from earlier sessions
Definition backend.hpp:65
std::int64_t started_ns
Definition backend.hpp:54
std::string strategy
Definition backend.hpp:56
std::uint64_t config_hash
Definition backend.hpp:59
std::string engine_name
Definition backend.hpp:55
bool dry_run
Definition backend.hpp:64