24 std::string_view text)
noexcept {
32 m.hdr.t0_cycles =
rdtscp();
33 static_cast<void>(sink.push(m.hdr));
42 std::string_view text)
noexcept {
50 m.hdr.t0_cycles =
rdtscp();
51 static_cast<void>(sink.push(m.hdr));
64 std::string_view venue_order_id,
65 std::uint8_t flags = 0,
70 m.venue_order_id.assign(venue_order_id);
72 m.hdr.exch_ts = venue_ts;
74 m.hdr.t0_cycles =
rdtscp();
75 static_cast<void>(sink.push(m.hdr));
83 std::string_view venue_order_id,
89 m.venue_order_id.assign(venue_order_id);
91 m.hdr.exch_ts = venue_ts;
93 m.hdr.t0_cycles =
rdtscp();
94 static_cast<void>(sink.push(m.hdr));
109 std::string_view venue_order_id,
110 std::string_view exec_id,
117 std::int64_t trade_time_ms,
118 std::uint8_t extra_flags = 0) noexcept {
121 m.hdr.exch_ts =
Timestamp{trade_time_ms * 1'000'000};
123 m.venue_order_id.assign(venue_order_id);
124 m.exec_id.assign(exec_id);
129 m.liquidity = liquidity;
130 m.fee_asset = fee_asset;
133 m.hdr.t0_cycles =
rdtscp();
134 static_cast<void>(sink.push(m.hdr));
142 std::string_view funding_id,
144 std::string_view asset,
145 std::int64_t time_ms,
146 bool replayed)
noexcept {
149 m.hdr.exch_ts =
Timestamp{time_ms * 1'000'000};
151 m.funding_id.assign(funding_id);
152 m.asset.assign(asset);
155 m.hdr.t0_cycles =
rdtscp();
156 static_cast<void>(sink.push(m.hdr));
167 m.arg =
static_cast<std::uint64_t
>(reason);
169 m.hdr.t0_cycles =
rdtscp();
170 static_cast<void>(sink.push(m.hdr));
176 std::uint8_t channel,
178 std::int32_t reason = 0) noexcept {
183 m.reason_code = reason;
185 static_cast<void>(sink.push(m.hdr));
Exact decimal helpers for venue payloads (6.2).
EventSink (5.15): the net -> engine seam.
Event bus message structs (5.5).
void emit_replayed_fill(EventSink &sink, VenueId venue, InstrumentId inst, ClientOrderId id, std::string_view venue_order_id, std::string_view exec_id, Side side, Price price, Qty qty, Notional fee, FeeAsset fee_asset, Liquidity liquidity, std::int64_t trade_time_ms, std::uint8_t extra_flags=0) noexcept
An execution from the venue's trade history (Venue::request_executions), not from the private stream.
Definition order_events.hpp:107
void emit_order_reject(EventSink &sink, VenueId venue, InstrumentId inst, ClientOrderId id, RejectReason reason, int code, std::string_view text) noexcept
Definition order_events.hpp:20
void emit_funding(EventSink &sink, VenueId venue, InstrumentId inst, std::string_view funding_id, Notional amount, std::string_view asset, std::int64_t time_ms, bool replayed) noexcept
A funding payment (FundingMsg): amount signed in asset, negative paid.
Definition order_events.hpp:141
void emit_connection_state(EventSink &sink, VenueId venue, std::uint8_t channel, ConnState state, std::int32_t reason=0) noexcept
channel: 0 = market data, 1 = order/user stream (ConnectionStateMsg contract).
Definition order_events.hpp:176
void emit_order_ack(EventSink &sink, VenueId venue, InstrumentId inst, ClientOrderId id, std::string_view venue_order_id, std::uint8_t flags=0, Timestamp venue_ts=Timestamp{}) noexcept
flags: OrderAckMsg::kAmendedInPlace when the venue amended the resting order rather than creating a n...
Definition order_events.hpp:62
void emit_cancel_reject(EventSink &sink, VenueId venue, InstrumentId inst, ClientOrderId id, RejectReason reason, int code, std::string_view text) noexcept
Definition order_events.hpp:38
void emit_cancel_ack(EventSink &sink, VenueId venue, InstrumentId inst, ClientOrderId id, std::string_view venue_order_id, Qty cum_qty, Timestamp venue_ts=Timestamp{}) noexcept
venue_ts as for emit_order_ack.
Definition order_events.hpp:81
void emit_venue_kill(EventSink &sink, VenueId venue, KillReason reason) noexcept
The connector cannot trade on this venue any more (error map HardStop / Fatal, failed authentication)...
Definition order_events.hpp:165
ConnState
Definition enums.hpp:404
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
Timestamp wall_now() noexcept
CLOCK_REALTIME via vDSO (~20 ns). Implemented in src/core/time.cpp.
constexpr void init_header(M &m, EventType type, InstrumentId inst={}, VenueId venue={}, std::uint32_t len=static_cast< std::uint32_t >(sizeof(M))) noexcept
For fixed-size messages len defaults to sizeof(M); BookDeltaMsg passes size_for().
Definition messages.hpp:75
Side
Definition enums.hpp:12
FeeAsset
The asset a fill's commission is charged in.
Definition enums.hpp:432
FASTMM_FORCE_INLINE Cycles rdtscp() noexcept
Serialising read (rdtscp) is what latency hops want: it waits for prior loads to retire.
Definition time.hpp:66
Liquidity
Definition enums.hpp:434
@ TripVenueKill
A venue connector gave up on one venue (arg: KillReason, hdr.venue: the venue): the engine trips that...
StrongId< struct VenueTag, std::uint8_t > VenueId
Definition strong_id.hpp:39
Definition messages.hpp:452
Definition messages.hpp:383
A perpetual funding payment the venue booked on the account's position in hdr.instrument (EventType::...
Definition messages.hpp:286
static constexpr std::uint8_t kReplayed
From the venue's history (Venue::request_executions), not the private stream.
Definition messages.hpp:288
Definition messages.hpp:188
Definition messages.hpp:213
Definition messages.hpp:222
Definition messages.hpp:233
static constexpr std::uint8_t kReplayed
The execution comes from the venue's trade history (Venue::request_executions), not from the private ...
Definition messages.hpp:237
Definition messages.hpp:202
static constexpr StrongId invalid() noexcept
Definition strong_id.hpp:30