FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
record_stream.hpp
Go to the documentation of this file.
1#pragma once
2// Record stream: the engine's second outbound queue, next to the journal.
3//
4// engine thread --RecordWriter--> MsgRing --store thread--> a storage backend
5//
6// The journal is the byte-exact stream a replay consumes; this is the interpreted one, the fills,
7// orders, positions and kill events a store turns into rows. Both are written the same way: the
8// engine copies a trivially copyable record into an SPSC ring and never waits. A full ring drops
9// the record and counts it (EngineStats::records_dropped); nothing in the trading path depends on
10// a record being consumed, so a slow or broken store cannot stall or kill a session. The journal
11// is the authority for anything a drop lost (docs/reference/storage.md).
12//
13// Records share the MsgRing prefix (4-byte length, 1-byte non-zero type) and are a multiple of 64
14// bytes, like the event messages, but they carry their own RecordType space and version: the store
15// format is free to change without touching the journal format.
16#include "fastmm/core/config_macros.hpp"
17#include "fastmm/core/enums.hpp"
20#include "fastmm/core/msg_ring.hpp"
21#include "fastmm/core/order.hpp"
24#include "fastmm/core/time.hpp"
25
26#include <cstddef>
27#include <cstdint>
28#include <cstring>
29#include <string_view>
30#include <type_traits>
31
32namespace fastmm {
33
34inline constexpr std::uint8_t kRecordVersion = 1;
35
36// Never 0: the ring reserves type 0 for padding.
37enum class RecordType : std::uint8_t {
38 Fill = 1,
39 Order = 2,
40 Position = 3,
41 Kill = 4,
42 Funding = 5,
43 Replayed = 6,
44 Param = 7,
45 Reject = 8,
46};
47[[nodiscard]] constexpr std::string_view to_string(RecordType t) noexcept {
48 switch (t) {
50 return "Fill";
52 return "Order";
54 return "Position";
56 return "Kill";
58 return "Funding";
60 return "Replayed";
62 return "Param";
64 return "Reject";
65 }
66 return "?";
67}
68
69struct RecordHeader {
70 enum Flags : std::uint8_t {
71 kSynthetic = 1U << 0, // booked by the engine, not reported by the venue (a cum_qty jump)
72 kLate = 1U << 1, // fill for an order that was already terminal; on an order record,
73 // that fill's update of the order (only cum_qty and state are valid)
74 kUnknown = 1U << 2, // fill for an order id the OMS does not know
75 kTerminal = 1U << 3, // the order reached a terminal state with this record
76 kVenue = 1U << 4, // kill record: one venue's switch, not the global one
77 kReplayed = 1U << 5, // funding record: from the venue's history, not its private stream
78 };
80 std::uint32_t len; // total bytes, a multiple of 64 (offset 0)
81 RecordType type; // (4)
82 std::uint8_t version; // kRecordVersion (5)
83 VenueId venue; // (6)
84 std::uint8_t flags; // (7)
85 InstrumentId instrument; // invalid when the record is not per instrument (8)
86 std::uint8_t aux[4]; // record-specific small fields (12)
87 std::uint64_t seq; // record order within the session, from 1 (16)
88 Timestamp engine_ts; // the engine clock the record was made at (24)
89 Timestamp wall_ts; // wall clock at the same point (32)
90 std::uint64_t session_id; // (40)
91 // The venue's time of the event behind the record (a fill: the trade time the venue reported),
92 // 0 when there is none. A restart resumes the venue's execution replay from it
93 // (store/reader.hpp).
94 Timestamp exch_ts; // (48)
95 std::uint8_t pad_[8]; // -> 64
96};
97static_assert(sizeof(RecordHeader) == 64 && std::is_trivially_copyable_v<RecordHeader>);
98static_assert(offsetof(RecordHeader, len) == 0 && offsetof(RecordHeader, type) == 4 &&
99 offsetof(RecordHeader, seq) == 16 && offsetof(RecordHeader, exch_ts) == 48);
100
101// One execution. `fee` is the engine's booked fee in the instrument's settlement currency;
102// `fee_amount` is what the venue reported, in units of `fee_asset` (a commission in a third asset
103// is reported but not booked, so `fee` is then zero).
104struct FillRecord {
108 Qty qty; // 80 this execution, as the venue reported it
109 Qty booked_qty; // 88 what the position moved by (base-asset fees deducted)
112 Notional fee; // 112 settlement currency, booked
113 Notional fee_amount; // 120 as reported, in fee_asset units
114 Qty position_qty; // 128 the instrument's position after this fill
118 Side side; // 160
121 std::uint8_t pad0_[5]; // 163 -> 168
123 ExecId exec_id; // 209 -> 250
124 std::uint8_t pad_[6]; // -> 256
126static_assert(sizeof(FillRecord) == 256 && std::is_trivially_copyable_v<FillRecord>);
127static_assert(offsetof(FillRecord, venue_order_id) == 168 && offsetof(FillRecord, exec_id) == 209);
128
129// The OMS record after a transition. hdr.aux[0] is the previous OrderState, hdr.aux[1] the
130// OmsAction as an integer, and hdr.aux[2] is 1 when this closes the client order id a
131// cancel-replace superseded (order.cl_ord_id is that id; every other field belongs to the order
132// that carries on, so a store updates only the state). With RecordHeader::kLate the order had
133// already ended and a fill that arrived after it changed its cum_qty, and its state when the fill
134// completed it (Filled instead of Canceled): a store updates those two.
135struct OrderRecord {
139static_assert(sizeof(OrderRecord) == 192 && std::is_trivially_copyable_v<OrderRecord>);
140
141// One instrument's position and the portfolio totals at the same instant.
142struct PositionRecord {
144 Position pos; // 64 -> 128
148 Notional pnl_carry; // 152 carried in from earlier sessions (EngineConfig::pnl_carry)
149 Notional funding; // 160 this instrument's funding so far, part of pos.realized
150 Notional total_funding; // 168 over every instrument, part of total_realized
151 std::uint8_t pad_[16]; // -> 192
153static_assert(sizeof(PositionRecord) == 192 && std::is_trivially_copyable_v<PositionRecord>);
154
155// A funding payment the engine booked (FundingMsg): `amount` in the instrument's settlement
156// currency, negative paid. hdr.exch_ts is the venue's time of it; hdr.flags kReplayed when it came
157// from the venue's history. A position record follows it.
158struct FundingRecord {
161 Qty position_qty; // 72 the position it was paid on
162 Notional position_realized; // 80 the instrument's realized after it
163 Notional position_funding; // 88 the instrument's funding after it
164 Notional total_funding; // 96 over every instrument
165 ExecId funding_id; // 104 -> 145
166 FixedString<8> asset; // 145 -> 154
167 std::uint8_t pad_[38]; // -> 192
169static_assert(sizeof(FundingRecord) == 192 && std::is_trivially_copyable_v<FundingRecord>);
170
171// A kill switch trip. hdr.flags & kVenue marks a per-venue trip (hdr.venue names it).
172struct KillRecord {
175 std::uint8_t pad0_[3]; // -> 68
176 std::uint32_t kill_flags; // 68 RiskEngine::kill_flags()
177 std::uint64_t kills; // 72 global trips so far
178 std::uint64_t venue_kills; // 80
183 std::uint8_t pad_[8]; // -> 128
185static_assert(sizeof(KillRecord) == 128 && std::is_trivially_copyable_v<KillRecord>);
186
187// A venue's execution replay ended complete (a reconciliation began with
188// ReconcileMsg::kExecutionsExact): every execution the venue made before it is in the records
189// before this one. hdr.venue is the venue. A restart reads it as "this session got past its replay
190// on that venue": the fills of a session without one may have a hole behind them (it died while
191// the replay was still reading), and the next replay starts before them (store/reader.hpp).
192struct ReplayedRecord {
195static_assert(sizeof(ReplayedRecord) == 64 && std::is_trivially_copyable_v<ReplayedRecord>);
196
197// A strategy parameter update the engine applied (ParamUpdateMsg): after the header, the message's
198// bytes past its own header, so the fields sit at the same offsets. hdr.instrument is the update's
199// target, invalid for every instrument. The store names the fields through the session's
200// parameter table (SessionOpen::param_table).
201struct ParamRecord {
203 std::uint32_t count; // 64 pairs used
205 std::uint8_t pad0_[3]; //
206 std::uint64_t publish_seq; // 72
207 std::uint16_t field[ParamUpdateMsg::kMaxFields]; // 80 index in the parameter table
208 char source[ParamUpdateMsg::kSourceLen]; // 144 NUL-terminated
209 std::uint8_t pad1_[8]; //
210 std::int64_t value[ParamUpdateMsg::kMaxFields]; // 192 raw value of each pair
212 [[nodiscard]] std::string_view source_view() const noexcept {
213 std::size_t n = 0;
214 while (n < ParamUpdateMsg::kSourceLen && source[n] != '\0') ++n;
215 return {source, n};
216 }
217};
218static_assert(sizeof(ParamRecord) == sizeof(ParamUpdateMsg) &&
219 std::is_trivially_copyable_v<ParamRecord>);
220static_assert(offsetof(ParamRecord, count) == offsetof(ParamUpdateMsg, count) &&
221 offsetof(ParamRecord, origin) == offsetof(ParamUpdateMsg, origin) &&
222 offsetof(ParamRecord, publish_seq) == offsetof(ParamUpdateMsg, publish_seq) &&
223 offsetof(ParamRecord, field) == offsetof(ParamUpdateMsg, field) &&
224 offsetof(ParamRecord, source) == offsetof(ParamUpdateMsg, source) &&
225 offsetof(ParamRecord, value) == offsetof(ParamUpdateMsg, value));
226
227// What refused an order (RejectRecord::source): the limit behind a rate-limit refusal, or the
228// side that refused it otherwise. Rate limits stay apart by where they are counted: the engine's
229// [risk] bucket, the engine's view of an account's order windows (ctx.order_budget, pool routing),
230// the connector's own limiter (never sent), and the venue's answer.
231enum class RejectSource : std::uint8_t {
232 Risk = 0, // a pre-trade check other than the rate limits (`reason` says which)
233 RiskBucket = 1, // the [risk] orders_per_sec token bucket, shared by every account
234 AccountPaused = 2, // the account's connector is paused (429 Retry-After, 418)
235 AccountOrders10s = 3, // the account's order window at the connector's cap
236 AccountOrders1m = 4,
237 AccountOrders1d = 5,
238 VenueLocal = 6, // the connector's own limiter refused it before sending (OrderReject text)
239 Venue = 7, // the venue refused it (venue_code, text)
240};
241[[nodiscard]] constexpr std::string_view to_string(RejectSource s) noexcept {
242 switch (s) {
244 return "risk";
246 return "risk_bucket";
248 return "account_paused";
250 return "account_orders_10s";
252 return "account_orders_1m";
254 return "account_orders_1d";
256 return "venue_local";
258 return "venue";
259 }
260 return "?";
261}
262
263// One order refused: by the pre-trade checks (the engine's) or by its venue (an OrderReject),
264// with the account's order budget as the engine saw it then (ctx.order_budget). hdr.venue is the
265// account the order went to or was routed to, hdr.instrument its instrument. Refusals of the
266// same instrument, side, account, reason, source and flags within RejectRecord::kFoldNs of the
267// last one recorded for them are counted into the next record's `folded` rather than recorded one
268// by one: the counts stay exact per account, a strategy retrying on every event does not fill the
269// store.
270struct RejectRecord {
271 static constexpr std::int64_t kFoldNs = 100'000'000;
272 enum Flags : std::uint8_t {
273 kReplace = 1U << 0, // a replace, not a new order
274 kReduces = 1U << 1, // with the open orders on its side, it only takes the position to zero
275 kReduceOnly = 1U << 2,
276 kFromVenue = 1U << 3, // an OrderReject, not a pre-trade check
277 };
279 RejectReason reason; // 64
281 Side side; // 66
282 std::uint8_t flags; // 67
283 std::uint32_t folded; // 68 refusals of the same key folded in since the last record
285 Qty qty; // 80
286 ClientOrderId cl_ord_id; // 88 the venue's refusals; 0 for a pre-trade one
287 std::int64_t local_tokens; // 96 [risk] bucket tokens left (OrderBudget::kUnlimited: off)
288 std::int64_t local_wait_ns; // 104
289 // The account's windows: used and what the connector admits (RateWindow::admits; 0 unknown).
290 std::int64_t orders_10s_used; // 112
291 std::int64_t orders_10s_admits; // 120
292 std::int64_t orders_1m_used; // 128
293 std::int64_t orders_1m_admits; // 136
294 std::int64_t orders_1d_used; // 144
295 std::int64_t orders_1d_admits; // 152
296 std::int64_t weight_used; // 160
297 std::int64_t weight_admits; // 168
298 std::int32_t venue_code; // 176 the venue's error code (OrderRejectMsg::venue_code)
299 std::uint8_t budget_known; // 180 the account's connector has published a budget
300 std::uint8_t paused; // 181
301 std::uint8_t pad0_[2]; //
302 FixedString<40> text; // 184 the venue's text (OrderRejectMsg::text)
303 std::uint8_t pad_[31]; // -> 256
305static_assert(sizeof(RejectRecord) == 256 && std::is_trivially_copyable_v<RejectRecord>);
306
307// Engine-side producer. Every method is allocation-free, wait-free and safe to call from the
308// trading thread; a full ring increments dropped() and returns false.
309class RecordWriter {
310 public:
311 explicit RecordWriter(MsgRing* ring = nullptr, std::uint64_t session_id = 0) noexcept
312 : ring_(ring), session_id_(session_id) {}
314 [[nodiscard]] bool enabled() const noexcept { return ring_ != nullptr; }
315 [[nodiscard]] std::uint64_t written() const noexcept { return written_; }
316 [[nodiscard]] std::uint64_t dropped() const noexcept { return dropped_; }
318 [[nodiscard]] FASTMM_FORCE_INLINE bool put(const RecordHeader& r) noexcept {
319 if (ring_ == nullptr) return true; // disabled: callers guard with enabled()
320 std::byte* p = ring_->try_reserve(r.len);
321 if (FASTMM_UNLIKELY(p == nullptr)) {
322 ++dropped_;
323 return false;
324 }
325 std::memcpy(p, &r, r.len);
326 auto* h = reinterpret_cast<RecordHeader*>(p);
328 h->seq = ++written_;
329 h->session_id = session_id_;
330 ring_->commit();
331 return true;
332 }
333
334 // Fills in the parts every record shares. The caller sets the record-specific fields and calls
335 // put(). `len` is sizeof the record.
336 template <class R>
337 FASTMM_FORCE_INLINE void init(R& r,
338 RecordType type,
340 VenueId venue,
341 Timestamp engine_ts,
342 Timestamp wall_ts) noexcept {
343 static_assert(std::is_trivially_copyable_v<R> && sizeof(R) % 64 == 0);
344 r.hdr = RecordHeader{};
345 r.hdr.len = static_cast<std::uint32_t>(sizeof(R));
346 r.hdr.type = type;
347 r.hdr.version = kRecordVersion;
348 r.hdr.instrument = inst;
349 r.hdr.venue = venue;
350 r.hdr.engine_ts = engine_ts;
351 r.hdr.wall_ts = wall_ts;
352 }
353
354 private:
355 MsgRing* ring_;
356 std::uint64_t session_id_;
357 std::uint64_t written_ = 0;
358 std::uint64_t dropped_ = 0;
359};
360
361} // namespace fastmm
Engine-side producer.
Definition record_stream.hpp:311
bool enabled() const noexcept
Definition record_stream.hpp:316
FASTMM_FORCE_INLINE bool put(const RecordHeader &r) noexcept
Definition record_stream.hpp:320
std::uint64_t written() const noexcept
Definition record_stream.hpp:317
std::uint64_t dropped() const noexcept
Definition record_stream.hpp:318
FASTMM_FORCE_INLINE void init(R &r, RecordType type, InstrumentId inst, VenueId venue, Timestamp engine_ts, Timestamp wall_ts) noexcept
Fills in the parts every record shares.
Definition record_stream.hpp:339
All engine enumerations.
Fixed<Tag>: int64 fixed point with a global 1e-8 scale (ADR-0001).
Event bus message structs (5.5).
Definition strategy.hpp:16
RejectSource
What refused an order (RejectRecord::source): the limit behind a rate-limit refusal,...
Definition record_stream.hpp:233
@ VenueLocal
the connector's own limiter refused it before sending (OrderReject text)
@ Risk
a pre-trade check other than the rate limits (reason says which)
@ AccountPaused
the account's connector is paused (429 Retry-After, 418)
@ Venue
the venue refused it (venue_code, text)
@ RiskBucket
the [risk] orders_per_sec token bucket, shared by every account
@ AccountOrders10s
the account's order window at the connector's cap
FixedString< 40 > VenueOrderId
Definition strong_id.hpp:42
KillReason
Why a kill switch (global or one venue's) was tripped.
Definition enums.hpp:523
@ Funding
a perpetual funding payment booked by the venue (FundingMsg)
RejectReason
Ordered exactly like RiskEngine::check_new evaluates them (5.7), followed by OMS / transport / venue ...
Definition enums.hpp:123
RecordType
Never 0: the ring reserves type 0 for padding.
Definition record_stream.hpp:39
Side
Definition enums.hpp:12
FeeAsset
The asset a fill's commission is charged in.
Definition enums.hpp:432
constexpr std::uint8_t kRecordVersion
Definition record_stream.hpp:36
FixedString< 40 > ExecId
Definition strong_id.hpp:44
constexpr std::string_view to_string(ParamType t) noexcept
Definition params.hpp:63
Liquidity
Definition enums.hpp:434
Order: the OMS's 128-byte record for one order across its lifetime.
Position tracking, average-cost method (5.8).
Strongly typed identifiers.
One execution.
Definition record_stream.hpp:106
std::uint8_t pad_[6]
-> 256
Definition record_stream.hpp:126
Side side
160
Definition record_stream.hpp:120
ExecId exec_id
209 -> 250
Definition record_stream.hpp:125
Qty leaves_qty
104
Definition record_stream.hpp:113
Price price
72
Definition record_stream.hpp:109
ClientOrderId cl_ord_id
64
Definition record_stream.hpp:108
std::uint8_t pad0_[5]
163 -> 168
Definition record_stream.hpp:123
Notional fee
112 settlement currency, booked
Definition record_stream.hpp:114
Liquidity liquidity
161
Definition record_stream.hpp:121
Price position_avg_px
136
Definition record_stream.hpp:117
Notional fee_amount
120 as reported, in fee_asset units
Definition record_stream.hpp:115
Qty booked_qty
88 what the position moved by (base-asset fees deducted)
Definition record_stream.hpp:111
RecordHeader hdr
Definition record_stream.hpp:107
Qty position_qty
128 the instrument's position after this fill
Definition record_stream.hpp:116
Qty cum_qty
96
Definition record_stream.hpp:112
FeeAsset fee_asset
162
Definition record_stream.hpp:122
Qty qty
80 this execution, as the venue reported it
Definition record_stream.hpp:110
Notional position_realized
144
Definition record_stream.hpp:118
Notional position_fees
152
Definition record_stream.hpp:119
VenueOrderId venue_order_id
168 -> 209
Definition record_stream.hpp:124
One execution as a strategy sees it (on_fill).
Definition hooks.hpp:56
A funding payment the engine booked (FundingMsg): amount in the instrument's settlement currency,...
Definition record_stream.hpp:160
Notional position_realized
80 the instrument's realized after it
Definition record_stream.hpp:164
Notional amount
64
Definition record_stream.hpp:162
ExecId funding_id
104 -> 145
Definition record_stream.hpp:167
RecordHeader hdr
Definition record_stream.hpp:161
FixedString< 8 > asset
145 -> 154
Definition record_stream.hpp:168
Notional position_funding
88 the instrument's funding after it
Definition record_stream.hpp:165
std::uint8_t pad_[38]
-> 192
Definition record_stream.hpp:169
Qty position_qty
72 the position it was paid on
Definition record_stream.hpp:163
Notional total_funding
96 over every instrument
Definition record_stream.hpp:166
A kill switch trip. hdr.flags & kVenue marks a per-venue trip (hdr.venue names it).
Definition record_stream.hpp:174
RecordHeader hdr
Definition record_stream.hpp:175
std::uint8_t pad_[8]
-> 128
Definition record_stream.hpp:185
Notional unrealized
96
Definition record_stream.hpp:182
std::uint8_t pad0_[3]
-> 68
Definition record_stream.hpp:177
std::uint64_t venue_kills
80
Definition record_stream.hpp:180
std::uint64_t kills
72 global trips so far
Definition record_stream.hpp:179
Notional pnl_carry
112
Definition record_stream.hpp:184
Notional fees
104
Definition record_stream.hpp:183
KillReason reason
64
Definition record_stream.hpp:176
std::uint32_t kill_flags
68 RiskEngine::kill_flags()
Definition record_stream.hpp:178
Notional realized
88
Definition record_stream.hpp:181
The OMS record after a transition.
Definition record_stream.hpp:137
RecordHeader hdr
Definition record_stream.hpp:138
Order order
Definition record_stream.hpp:139
Definition order.hpp:15
A strategy parameter update the engine applied (ParamUpdateMsg): after the header,...
Definition record_stream.hpp:203
std::uint8_t pad0_[3]
Definition record_stream.hpp:207
std::uint64_t publish_seq
72
Definition record_stream.hpp:208
RecordHeader hdr
Definition record_stream.hpp:204
ParamUpdateMsg::Origin origin
68
Definition record_stream.hpp:206
char source[ParamUpdateMsg::kSourceLen]
144 NUL-terminated
Definition record_stream.hpp:210
std::int64_t value[ParamUpdateMsg::kMaxFields]
192 raw value of each pair
Definition record_stream.hpp:212
std::uint32_t count
64 pairs used
Definition record_stream.hpp:205
std::string_view source_view() const noexcept
Definition record_stream.hpp:214
std::uint16_t field[ParamUpdateMsg::kMaxFields]
80 index in the parameter table
Definition record_stream.hpp:209
std::uint8_t pad1_[8]
Definition record_stream.hpp:211
Origin
Definition messages.hpp:579
static constexpr std::size_t kMaxFields
Definition messages.hpp:575
static constexpr std::size_t kSourceLen
source, NUL-terminated
Definition messages.hpp:576
One instrument's position and the portfolio totals at the same instant.
Definition record_stream.hpp:144
Position pos
64 -> 128
Definition record_stream.hpp:146
RecordHeader hdr
Definition record_stream.hpp:145
Notional pnl_carry
152 carried in from earlier sessions (EngineConfig::pnl_carry)
Definition record_stream.hpp:150
Notional total_unrealized
136
Definition record_stream.hpp:148
Notional total_funding
168 over every instrument, part of total_realized
Definition record_stream.hpp:152
Notional funding
160 this instrument's funding so far, part of pos.realized
Definition record_stream.hpp:151
Notional total_fees
144
Definition record_stream.hpp:149
Notional total_realized
128
Definition record_stream.hpp:147
std::uint8_t pad_[16]
-> 192
Definition record_stream.hpp:153
Definition position.hpp:20
Definition record_stream.hpp:71
std::uint32_t len
total bytes, a multiple of 64 (offset 0)
Definition record_stream.hpp:82
std::uint64_t seq
record order within the session, from 1 (16)
Definition record_stream.hpp:89
Timestamp wall_ts
wall clock at the same point (32)
Definition record_stream.hpp:91
std::uint8_t pad_[8]
-> 64
Definition record_stream.hpp:97
std::uint8_t flags
(7)
Definition record_stream.hpp:86
Timestamp exch_ts
The venue's time of the event behind the record (a fill: the trade time the venue reported),...
Definition record_stream.hpp:96
RecordType type
(4)
Definition record_stream.hpp:83
std::uint8_t aux[4]
record-specific small fields (12)
Definition record_stream.hpp:88
std::uint64_t session_id
(40)
Definition record_stream.hpp:92
std::uint8_t version
kRecordVersion (5)
Definition record_stream.hpp:84
Flags
Definition record_stream.hpp:72
@ kLate
fill for an order that was already terminal; on an order record, that fill's update of the order (onl...
Definition record_stream.hpp:74
@ kReplayed
funding record: from the venue's history, not its private stream
Definition record_stream.hpp:79
@ kSynthetic
booked by the engine, not reported by the venue (a cum_qty jump)
Definition record_stream.hpp:73
@ kTerminal
the order reached a terminal state with this record
Definition record_stream.hpp:77
@ kVenue
kill record: one venue's switch, not the global one
Definition record_stream.hpp:78
@ kUnknown
fill for an order id the OMS does not know
Definition record_stream.hpp:76
InstrumentId instrument
invalid when the record is not per instrument (8)
Definition record_stream.hpp:87
VenueId venue
(6)
Definition record_stream.hpp:85
Timestamp engine_ts
the engine clock the record was made at (24)
Definition record_stream.hpp:90
One order refused: by the pre-trade checks (the engine's) or by its venue (an OrderReject),...
Definition record_stream.hpp:272
Qty qty
80
Definition record_stream.hpp:287
FixedString< 40 > text
184 the venue's text (OrderRejectMsg::text)
Definition record_stream.hpp:304
Side side
66
Definition record_stream.hpp:283
std::int64_t orders_1d_used
144
Definition record_stream.hpp:296
std::int64_t orders_10s_admits
120
Definition record_stream.hpp:293
RejectReason reason
64
Definition record_stream.hpp:281
std::uint8_t pad0_[2]
Definition record_stream.hpp:303
std::int64_t local_tokens
96 [risk] bucket tokens left (OrderBudget::kUnlimited: off)
Definition record_stream.hpp:289
ClientOrderId cl_ord_id
88 the venue's refusals; 0 for a pre-trade one
Definition record_stream.hpp:288
std::uint8_t budget_known
180 the account's connector has published a budget
Definition record_stream.hpp:301
RejectSource source
65
Definition record_stream.hpp:282
std::int64_t weight_used
160
Definition record_stream.hpp:298
std::int64_t local_wait_ns
104
Definition record_stream.hpp:290
std::int64_t orders_1m_used
128
Definition record_stream.hpp:294
std::int64_t weight_admits
168
Definition record_stream.hpp:299
Price price
72
Definition record_stream.hpp:286
std::int64_t orders_10s_used
The account's windows: used and what the connector admits (RateWindow::admits; 0 unknown).
Definition record_stream.hpp:292
Flags
Definition record_stream.hpp:274
@ kFromVenue
an OrderReject, not a pre-trade check
Definition record_stream.hpp:278
@ kReduceOnly
Definition record_stream.hpp:277
@ kReplace
a replace, not a new order
Definition record_stream.hpp:275
@ kReduces
with the open orders on its side, it only takes the position to zero
Definition record_stream.hpp:276
std::uint32_t folded
68 refusals of the same key folded in since the last record
Definition record_stream.hpp:285
std::int64_t orders_1m_admits
136
Definition record_stream.hpp:295
std::int64_t orders_1d_admits
152
Definition record_stream.hpp:297
std::uint8_t pad_[31]
-> 256
Definition record_stream.hpp:305
static constexpr std::int64_t kFoldNs
Definition record_stream.hpp:273
std::int32_t venue_code
176 the venue's error code (OrderRejectMsg::venue_code)
Definition record_stream.hpp:300
std::uint8_t paused
181
Definition record_stream.hpp:302
std::uint8_t flags
67
Definition record_stream.hpp:284
RecordHeader hdr
Definition record_stream.hpp:280
A venue's execution replay ended complete (a reconciliation began with ReconcileMsg::kExecutionsExact...
Definition record_stream.hpp:194
RecordHeader hdr
Definition record_stream.hpp:195
Definition time.hpp:45
Time primitives.