FastMM documentation
FastMM C++ API 0.14.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
enums.hpp
Go to the documentation of this file.
1#pragma once
2// All engine enumerations. Every enum is `enum class` with a fixed underlying type so it
3// can be embedded in trivially copyable messages; to_string() is for logs/diagnostics.
4#include <cstddef>
5#include <cstdint>
6#include <string_view>
7
8namespace fastmm {
9
10enum class Side : std::uint8_t { Buy = 0, Sell = 1 };
11[[nodiscard]] constexpr Side opposite(Side s) noexcept {
14[[nodiscard]] constexpr int sign(Side s) noexcept {
15 return s == Side::Buy ? 1 : -1;
17[[nodiscard]] constexpr std::string_view to_string(Side s) noexcept {
18 return s == Side::Buy ? "Buy" : "Sell";
20
21enum class OrderType : std::uint8_t { Limit = 0, Market = 1, PostOnly = 2 };
22[[nodiscard]] constexpr std::string_view to_string(OrderType t) noexcept {
23 switch (t) {
25 return "Limit";
27 return "Market";
29 return "PostOnly";
30 }
31 return "?";
32}
33
34enum class TimeInForce : std::uint8_t { Gtc = 0, Ioc = 1, Fok = 2, Day = 3 };
35[[nodiscard]] constexpr std::string_view to_string(TimeInForce t) noexcept {
36 switch (t) {
38 return "GTC";
40 return "IOC";
42 return "FOK";
44 return "DAY";
45 }
46 return "?";
47}
48
49enum class AssetClass : std::uint8_t {
50 Spot = 0,
52 Future = 2,
53 Option = 3,
54 Fx = 4,
55 Equity = 5
56};
57[[nodiscard]] constexpr std::string_view to_string(AssetClass a) noexcept {
58 switch (a) {
60 return "Spot";
62 return "Perpetual";
64 return "Future";
66 return "Option";
67 case AssetClass::Fx:
68 return "Fx";
70 return "Equity";
71 }
72 return "?";
73}
74
75enum class OptionType : std::uint8_t { None = 0, Call = 1, Put = 2 };
76
77enum class OrderState : std::uint8_t {
78 PendingNew = 0,
79 Live = 1,
81 PendingCancel = 3,
83 Filled = 5,
84 Canceled = 6,
85 Rejected = 7,
86 Expired = 8,
87};
88[[nodiscard]] constexpr bool is_terminal(OrderState s) noexcept {
89 return s >= OrderState::Filled;
91[[nodiscard]] constexpr bool is_pending(OrderState s) noexcept {
94}
95[[nodiscard]] constexpr std::string_view to_string(OrderState s) noexcept {
96 switch (s) {
98 return "PendingNew";
100 return "Live";
102 return "PartiallyFilled";
104 return "PendingCancel";
106 return "PendingReplace";
108 return "Filled";
110 return "Canceled";
112 return "Rejected";
114 return "Expired";
115 }
116 return "?";
117}
118
119// Ordered exactly like RiskEngine::check_new evaluates them (5.7), followed by OMS /
120// transport / venue reasons.
121enum class RejectReason : std::uint8_t {
122 None = 0,
124 VenueKilled = 2,
126 InvalidTick = 4,
127 InvalidLot = 5,
129 StaleMarketData = 7,
130 PriceCollar = 8,
131 FatFinger = 9,
132 MaxOrderQty = 10,
133 MaxOrderNotional = 11,
134 MaxPosition = 12,
135 MaxOpenOrders = 13,
137 RateLimit = 15,
138 MaxLoss = 16,
139 MaxGrossNotional = 17, // portfolio |position| at the last marks, over every instrument
140 MaxNetNotional = 18,
141 // [accounting]: the rate of the order's settlement currency is unknown or stale, and the order
142 // would add to its exposure while max_loss or an exposure cap is set.
143 FxRateUnknown = 19,
144 // [risk] max_feed_lag_ms: the venue's market data is late (core/venue_health.hpp) and the order
145 // could rest there without reducing the position.
146 FeedLag = 20,
147 // [risk.underlying.<BASE>] max_net: the net position in the order's underlying, in base units
148 // over every instrument, with the open orders on the order's side and the order itself, would
149 // move further past the limit.
150 MaxUnderlyingNet = 21,
151 // The underlying cannot be measured: an inverse contract in it has a position or open orders (or
152 // is the order's instrument) and no current mark.
154 // The account's balance on the venue, as the venue last reported it less what the engine's own
155 // orders and fills took since (core/balance_book.hpp), does not cover the order: a spot sell
156 // above the free base asset, a spot buy whose notional plus taker fee is above the free quote
157 // asset, a derivative whose initial margin is above the available margin ([risk] check_balance).
158 BalanceShort = 23,
159 // Reduce-only mode (fastmm-ctl reduce-only, [risk] reduce_only) holds the order's instrument, and
160 // the order, with the open orders on its side, would leave the position no nearer zero.
161 ReduceOnly = 24,
162 // [capacity]: the order is worth less than the price of the order slot it takes now (its
163 // account's window, the day's budget; core/capacity_price.hpp).
164 PricedOut = 25,
165 // OMS / transport
166 PoolExhausted = 32,
167 UnknownOrder = 33,
168 InvalidState = 34,
169 DuplicateId = 35,
170 TransportFull = 36,
171 NotReconciled = 37,
172 InvalidTag = 38, // a direct order used a user_tag in the QuoteManager's range
173 // The connector's table of the orders it has sent is full: it could not record this one (whose
174 // fills, amends and replies it would then not map back), so it did not send it.
175 OrderTableFull = 39,
176 // NewOrderRequest::account names a venue that is neither the instrument's nor a member of its
177 // pool (core/account_pool.hpp); refused locally.
178 InvalidAccount = 40,
179 // [venues.<primary>.pool] placement = "home": the order goes to the instrument's home, whose
180 // order link is down or whose kill switch is engaged (core/pool_homes.hpp; spill = "flat"
181 // re-homes a flat instrument instead).
182 HomeUnavailable = 41,
183 // fastmm-gateway's account guards ([gateway]), refused before the order reached the connector
184 GatewayRateLimit = 48, // the venue's order rate, shared by every attached strategy
185 GatewayOpenNotional = 49, // the notional working at the venue, over every attached strategy
186 GatewayNotOwner = 50, // the instrument belongs to another attachment (or none)
187 GatewayAccountKilled = 51, // [gateway] max_loss tripped the account's kill switch
188 GatewayGrossNotional = 52, // the account's |position| at the marks, over every instrument
189 GatewayNetNotional = 53, // the account's signed position at the marks
190 GatewayFxRateUnknown = 54, // [accounting]: the order's currency has no current rate
191 GatewayUnderlyingNet = 55, // [gateway.underlying.<BASE>] max_net, over every strategy and venue
192 GatewayUnderlyingMarkUnknown = 56, // an inverse contract of the underlying has no current mark
193 GatewaySelfTrade = 57, // it would cross another attached strategy's resting order
194 GatewayBalanceShort = 58, // the account's balance, less every attached strategy's orders
195 // Venue-originated
196 VenueReject = 64,
199 VenueRateLimit = 67,
201};
202[[nodiscard]] constexpr std::string_view to_string(RejectReason r) noexcept {
203 switch (r) {
205 return "None";
207 return "KillSwitch";
209 return "VenueKilled";
211 return "InstrumentDisabled";
213 return "InvalidTick";
215 return "InvalidLot";
217 return "BelowMinNotional";
219 return "StaleMarketData";
221 return "PriceCollar";
223 return "FatFinger";
225 return "MaxOrderQty";
227 return "MaxOrderNotional";
229 return "MaxPosition";
231 return "MaxOpenOrders";
233 return "SelfTradePrevention";
235 return "RateLimit";
237 return "MaxLoss";
239 return "MaxGrossNotional";
241 return "MaxNetNotional";
243 return "FxRateUnknown";
245 return "FeedLag";
247 return "MaxUnderlyingNet";
249 return "UnderlyingMarkUnknown";
251 return "BalanceShort";
253 return "ReduceOnly";
255 return "PricedOut";
257 return "PoolExhausted";
259 return "UnknownOrder";
261 return "InvalidState";
263 return "DuplicateId";
265 return "TransportFull";
267 return "NotReconciled";
269 return "InvalidTag";
271 return "OrderTableFull";
273 return "InvalidAccount";
275 return "HomeUnavailable";
277 return "GatewayRateLimit";
279 return "GatewayOpenNotional";
281 return "GatewayNotOwner";
283 return "GatewayAccountKilled";
285 return "GatewayGrossNotional";
287 return "GatewayNetNotional";
289 return "GatewayFxRateUnknown";
291 return "GatewayUnderlyingNet";
293 return "GatewayUnderlyingMarkUnknown";
295 return "GatewaySelfTrade";
297 return "GatewayBalanceShort";
299 return "VenueReject";
301 return "PostOnlyWouldCross";
303 return "InsufficientBalance";
305 return "VenueRateLimit";
307 return "VenueUnknownOrder";
308 }
309 return "?";
310}
311
312// Message discriminator carried in EventHeader::type. BookDelta is 1 so the dispatch
313// switch's most likely case is the first compare.
314enum class EventType : std::uint8_t {
315 Padding = 0, // ring wrap filler, never dispatched
317 BookSnapshot = 2,
318 BookTicker = 3,
319 Trade = 4,
320 OrderAck = 5,
321 OrderReject = 6,
322 OrderCancelAck = 7,
324 OrderFill = 9,
325 OrderExpired = 10,
326 PositionUpdate = 11,
327 Timer = 12,
328 Control = 13,
329 ConnectionState = 14,
330 Reconcile = 15,
331 LatencySample = 16,
332 OutNewOrder = 17,
333 OutCancel = 18,
334 OutReplace = 19,
335 OrderAddL3 = 20,
336 OrderExecL3 = 21,
337 OrderCancelL3 = 22,
338 OrderReplaceL3 = 23,
339 OptionTicker = 24, // mark / implied vols / greeks of one option (OptionTickerMsg)
340 EngineTime = 25, // journal only: the engine clock at start / finish / a delta overflow
341 ParamUpdate = 26, // new strategy parameter values (ParamUpdateMsg)
342 Funding = 27, // a perpetual funding payment booked by the venue (FundingMsg)
343 Balance = 28, // the account's holding of one asset on one venue (BalanceMsg)
344 PerpState = 29, // mark, index and funding of one derivative (PerpStateMsg)
345 StrategyState = 30, // journal only: a checkpoint or a restored state (StrategyStateMsg)
346 AccountFlow = 31, // money in or out of an account other than by trades (AccountFlowMsg)
347 // Our resting quantity at the prices of one instrument's book as a simulated venue's feed shows
348 // it ([backtest] own_orders_in_feed; OwnLevelsMsg): the engine's book is the recorded one with it
349 // added.
350 OwnLevels = 32,
351 // A venue's trading rules or trading status of one instrument changed while the session ran
352 // (InstrumentRulesMsg): tick, lot, the order limits, trading or not.
353 InstrumentRules = 33,
354 Count = 34,
355};
356[[nodiscard]] constexpr std::string_view to_string(EventType t) noexcept {
357 switch (t) {
359 return "Padding";
361 return "BookDelta";
363 return "BookSnapshot";
365 return "BookTicker";
366 case EventType::Trade:
367 return "Trade";
369 return "OrderAck";
371 return "OrderReject";
373 return "OrderCancelAck";
375 return "OrderCancelReject";
377 return "OrderFill";
379 return "OrderExpired";
381 return "PositionUpdate";
382 case EventType::Timer:
383 return "Timer";
385 return "Control";
387 return "ConnectionState";
389 return "Reconcile";
391 return "LatencySample";
393 return "OutNewOrder";
395 return "OutCancel";
397 return "OutReplace";
399 return "OrderAddL3";
401 return "OrderExecL3";
403 return "OrderCancelL3";
405 return "OrderReplaceL3";
407 return "OptionTicker";
409 return "EngineTime";
411 return "ParamUpdate";
413 return "Funding";
415 return "Balance";
417 return "PerpState";
419 return "StrategyState";
421 return "AccountFlow";
423 return "OwnLevels";
425 return "InstrumentRules";
426 case EventType::Count:
427 return "Count";
428 }
429 return "?";
430}
431
432// Whether a venue takes orders on an instrument (Instrument::status, InstrumentRulesMsg). Anything
433// but Trading: the engine sends the instrument nothing, not even a cancel, until it trades again.
434enum class TradingStatus : std::uint8_t {
435 Trading = 0,
436 Halted = 1, // a break, a halt, an auction, before or after the session
437 Closed = 2, // the venue lists it no longer, or has closed it for the day
438};
439[[nodiscard]] constexpr std::string_view to_string(TradingStatus s) noexcept {
440 switch (s) {
442 return "trading";
444 return "halted";
446 return "closed";
447 }
448 return "?";
449}
450
451enum class ConnState : std::uint8_t {
452 Disconnected = 0,
454 Live = 2,
455 Stale = 3,
456 Resyncing = 4,
457 Dead = 5,
458};
459[[nodiscard]] constexpr std::string_view to_string(ConnState s) noexcept {
460 switch (s) {
462 return "Disconnected";
464 return "Connecting";
465 case ConnState::Live:
466 return "Live";
467 case ConnState::Stale:
468 return "Stale";
470 return "Resyncing";
471 case ConnState::Dead:
472 return "Dead";
473 }
474 return "?";
475}
476
477// The asset a fill's commission is charged in. Binance spot charges a buy in the base asset
478// (you receive less), a sell in the quote asset, and either in BNB when the discount is enabled.
479enum class FeeAsset : std::uint8_t { Quote = 0, Base = 1, Other = 2 };
480
481enum class Liquidity : std::uint8_t { Unknown = 0, Maker = 1, Taker = 2 };
482[[nodiscard]] constexpr std::string_view to_string(Liquidity l) noexcept {
483 switch (l) {
485 return "Unknown";
486 case Liquidity::Maker:
487 return "Maker";
488 case Liquidity::Taker:
489 return "Taker";
490 }
491 return "?";
492}
493
494enum class ControlCommand : std::uint8_t {
495 Stop = 0,
497 ResumeQuotes = 2,
498 TripKill = 3,
499 ResetKill = 4,
500 Reload = 5,
501 FlushStats = 6,
502 RecalibrateTsc = 7,
503 // A venue connector gave up on one venue (arg: KillReason, hdr.venue: the venue): the engine
504 // trips that venue's kill bit only. Sent through the venue's order ring, so it is journaled and
505 // replays like any other engine input.
506 TripVenueKill = 8,
507 // Operator flatten (arg: the slippage allowance in basis points, 0 takes [engine]
508 // flatten_slippage_bps; hdr.instrument: one instrument, invalid for every one): the engine
509 // stops quoting in that scope, cancels its orders and sends reduce-only IOC slices through the
510 // touch until the position is flat (core/engine.hpp).
511 Flatten = 9,
512 // New risk limits for RiskEngine::set_limits. The message is a ControlLimitsMsg: a ControlMsg
513 // with a RiskLimits payload (core/messages.hpp).
514 SetLimits = 10,
515 // Engine -> venue, on the outbound ring (hdr.venue: the venue): the engine and the venue
516 // disagree about an order (a cancel rejected more than three times), so the connector runs the
517 // reconciliation it runs after a reconnect. The engine ignores it as an input.
518 Reconcile = 11,
519 // A new [risk.underlying.<BASE>] max_net for RiskEngine::set_underlying_limit. The message is a
520 // ControlUnderlyingMsg: the underlying's index in the session's plan, and the limit in `arg`.
522 // A warm standby took the instance lock (fastmm-live --standby): arg is the PnL carried from
523 // earlier sessions (Notional raw, two's complement), read from the kill file once the session
524 // before it had written it last, and the strategy restores the state staged with
525 // Engine::stage_strategy_state (none in a replay).
526 TakeOver = 13,
527 // A pool treasury's transfer (core/treasury.hpp): planned, sent, done, failed or timed out. The
528 // message is a ControlTransferMsg; the engine counts it and changes nothing, so the journal holds
529 // every transfer next to the balances it moved.
530 Transfer = 14,
531 // A new [risk] max_loss period began (max_loss_period = "utc_day"): the engine measures net PnL
532 // from zero again, unrealized PnL included; a tripped kill switch stays tripped.
533 ResetLossBudget = 15,
534 // Reduce-only mode (arg: 1 on, 0 off; hdr.instrument: one instrument, else hdr.venue: one
535 // venue's instruments, else the whole session): new orders and replaces that would take a
536 // position further from zero are refused (RejectReason::ReduceOnly), and turning it on cancels
537 // the working orders on each instrument's adding side. An off without a scope clears every scope.
538 ReduceOnly = 16,
539 // An instrument's home in its account pool (core/pool_homes.hpp): hdr.instrument, arg
540 // pool_home_arg(to, source, from). From the planner and the operator; the engine journals its
541 // own (kSynthetic), which a replay does not take as input.
542 PoolHome = 17,
543 // A pool's sweep (core/transfer_lane.hpp): hdr.venue the pool's primary, arg kSweepOff, kSweepOn,
544 // kSweepPause or kSweepNow (hdr.instrument: the instrument whose pieces go home at the next
545 // look). From the operator (fastmm-ctl pool sweep).
546 PoolSweep = 18,
547 // A change of a spot instrument's base asset on its accounts that no fill and no transfer of the
548 // engine's made ([engine] base_flows): a token dividend, an airdrop, a venue's adjustment, a
549 // deposit. The message is a ControlBaseFlowMsg, a record the engine journals (kSynthetic): a
550 // replay finds the flow again from the balances.
551 BaseFlow = 19,
552};
553[[nodiscard]] constexpr std::string_view to_string(ControlCommand c) noexcept {
554 switch (c) {
556 return "Stop";
558 return "PullQuotes";
560 return "ResumeQuotes";
562 return "TripKill";
564 return "ResetKill";
566 return "Reload";
568 return "FlushStats";
570 return "RecalibrateTsc";
572 return "TripVenueKill";
574 return "Flatten";
576 return "SetLimits";
578 return "Reconcile";
580 return "SetUnderlyingLimit";
582 return "TakeOver";
584 return "Transfer";
586 return "ResetLossBudget";
588 return "ReduceOnly";
590 return "PoolHome";
592 return "PoolSweep";
594 return "BaseFlow";
595 }
596 return "?";
597}
598
599// Why a kill switch (global or one venue's) was tripped. The engine records the first reason per
600// flag; fastmm-live decides from it whether to exit ([engine] on_kill) and shows it in the status.
601enum class KillReason : std::uint8_t {
602 None = 0,
603 Requested = 1, // ControlCommand::TripKill: shutdown, operator
604 MaxLoss = 2, // [risk] max_loss
605 TransportFull = 3, // the outbound ring to a venue was full
606 JournalOverflow = 4, // the journal ring was full
607 AllVenuesKilled = 5, // every venue with instruments has its own kill bit set
608 VenueFatal = 6, // venue error map: bad key, signature, permission, failed auth
609 VenueHardStop = 7, // venue error map: REST stopped (IP ban)
610 OrderRingOverflow = 8, // fastmm-live: a venue's order-event ring overflowed
611 StrategyError = 9, // a strategy hook reported an error (Python hot hooks)
612 FeedLost = 10, // a multicast feed cannot rebuild its books (nasdaq_itch)
613 OrderIdsExhausted = 11, // the session's 32-bit client order id sequence is used up
614 DeadMansSwitchLost = 12, // the venue-side countdown could not be refreshed within its window
615 GatewayMaxLoss = 13, // fastmm-gateway: the account's [gateway] max_loss, over every strategy
616 GatewayOperator = 14, // fastmm-gateway: an operator's `kill` on the gateway's control socket
618 15, // fastmm-live: the store failed or dropped records ([storage] kill_on_failure)
619};
620// Kill reasons are kept per venue id for ids 0..kKillVenueSlots-1; higher ids share the last slot,
621// as they share the last kill bit (RiskEngine::venue_bit).
622inline constexpr std::size_t kKillVenueSlots = 31;
623[[nodiscard]] constexpr std::string_view to_string(KillReason r) noexcept {
624 switch (r) {
626 return "None";
628 return "Requested";
630 return "MaxLoss";
632 return "TransportFull";
634 return "JournalOverflow";
636 return "AllVenuesKilled";
638 return "VenueFatal";
640 return "VenueHardStop";
642 return "OrderRingOverflow";
644 return "StrategyError";
646 return "FeedLost";
648 return "OrderIdsExhausted";
650 return "DeadMansSwitchLost";
652 return "GatewayMaxLoss";
654 return "GatewayOperator";
656 return "StoreFailure";
657 }
658 return "?";
659}
660
661// How far an operator flatten (ControlCommand::Flatten) got. The engine publishes it with its
662// live stats and fastmm-live copies it into the status file and the control socket's `status`.
663enum class FlattenState : std::uint8_t {
664 Off = 0, // none was asked for in this session
665 Working = 1, // quoting is off in its scope and reduce-only slices are going out
666 Flat = 2, // it finished: no position left in its scope
667 TimedOut = 3, // [engine] flatten_timeout_ms elapsed with a position left; it gave up
668 Stopped = 4, // the operator resumed quoting before it finished
669};
670[[nodiscard]] constexpr std::string_view to_string(FlattenState s) noexcept {
671 switch (s) {
673 return "Off";
675 return "Working";
677 return "Flat";
679 return "TimedOut";
681 return "Stopped";
682 }
683 return "?";
684}
685
686enum class LogLevel : std::uint8_t { Trace = 0, Debug = 1, Info = 2, Warn = 3, Error = 4, Off = 5 };
687[[nodiscard]] constexpr std::string_view to_string(LogLevel l) noexcept {
688 switch (l) {
690 return "TRACE";
691 case LogLevel::Debug:
692 return "DEBUG";
693 case LogLevel::Info:
694 return "INFO";
695 case LogLevel::Warn:
696 return "WARN";
697 case LogLevel::Error:
698 return "ERROR";
699 case LogLevel::Off:
700 return "OFF";
701 }
702 return "?";
703}
704
705} // namespace fastmm
Definition strategy.hpp:23
OrderType
Definition enums.hpp:23
LogLevel
Definition enums.hpp:688
OrderState
Definition enums.hpp:79
constexpr bool is_pending(OrderState s) noexcept
Definition enums.hpp:93
TradingStatus
Whether a venue takes orders on an instrument (Instrument::status, InstrumentRulesMsg).
Definition enums.hpp:436
@ Closed
the venue lists it no longer, or has closed it for the day
@ Halted
a break, a halt, an auction, before or after the session
ConnState
Definition enums.hpp:453
AssetClass
Definition enums.hpp:51
FlattenState
How far an operator flatten (ControlCommand::Flatten) got.
Definition enums.hpp:665
@ Flat
it finished: no position left in its scope
@ Working
quoting is off in its scope and reduce-only slices are going out
@ TimedOut
[engine] flatten_timeout_ms elapsed with a position left; it gave up
@ Stopped
the operator resumed quoting before it finished
@ Off
none was asked for in this session
KillReason
Why a kill switch (global or one venue's) was tripped.
Definition enums.hpp:603
@ OrderIdsExhausted
the session's 32-bit client order id sequence is used up
@ TransportFull
the outbound ring to a venue was full
@ VenueHardStop
venue error map: REST stopped (IP ban)
@ VenueFatal
venue error map: bad key, signature, permission, failed auth
@ StoreFailure
fastmm-live: the store failed or dropped records ([storage] kill_on_failure)
@ AllVenuesKilled
every venue with instruments has its own kill bit set
@ OrderRingOverflow
fastmm-live: a venue's order-event ring overflowed
@ JournalOverflow
the journal ring was full
@ GatewayMaxLoss
fastmm-gateway: the account's [gateway] max_loss, over every strategy
@ MaxLoss
[risk] max_loss
@ DeadMansSwitchLost
the venue-side countdown could not be refreshed within its window
@ StrategyError
a strategy hook reported an error (Python hot hooks)
@ GatewayOperator
fastmm-gateway: an operator's kill on the gateway's control socket
@ FeedLost
a multicast feed cannot rebuild its books (nasdaq_itch)
@ Requested
ControlCommand::TripKill: shutdown, operator.
EventType
Message discriminator carried in EventHeader::type.
Definition enums.hpp:316
@ EngineTime
journal only: the engine clock at start / finish / a delta overflow
@ OwnLevels
Our resting quantity at the prices of one instrument's book as a simulated venue's feed shows it ([ba...
@ AccountFlow
money in or out of an account other than by trades (AccountFlowMsg)
@ Funding
a perpetual funding payment booked by the venue (FundingMsg)
@ Balance
the account's holding of one asset on one venue (BalanceMsg)
@ Padding
ring wrap filler, never dispatched
@ StrategyState
journal only: a checkpoint or a restored state (StrategyStateMsg)
@ OptionTicker
mark / implied vols / greeks of one option (OptionTickerMsg)
@ ParamUpdate
new strategy parameter values (ParamUpdateMsg)
@ PerpState
mark, index and funding of one derivative (PerpStateMsg)
@ InstrumentRules
A venue's trading rules or trading status of one instrument changed while the session ran (Instrument...
RejectReason
Ordered exactly like RiskEngine::check_new evaluates them (5.7), followed by OMS / transport / venue ...
Definition enums.hpp:123
@ GatewayUnderlyingMarkUnknown
an inverse contract of the underlying has no current mark
@ ReduceOnly
Reduce-only mode (fastmm-ctl reduce-only, [risk] reduce_only) holds the order's instrument,...
@ GatewayAccountKilled
[gateway] max_loss tripped the account's kill switch
@ PricedOut
[capacity]: the order is worth less than the price of the order slot it takes now (its account's wind...
@ GatewayNetNotional
the account's signed position at the marks
@ UnderlyingMarkUnknown
The underlying cannot be measured: an inverse contract in it has a position or open orders (or is the...
@ GatewayNotOwner
the instrument belongs to another attachment (or none)
@ GatewayUnderlyingNet
[gateway.underlying.<BASE>] max_net, over every strategy and venue
@ GatewayOpenNotional
the notional working at the venue, over every attached strategy
@ GatewayRateLimit
fastmm-gateway's account guards ([gateway]), refused before the order reached the connector
@ VenueReject
Venue-originated.
@ HomeUnavailable
[venues.
@ MaxUnderlyingNet
[risk.underlying.
@ GatewayBalanceShort
the account's balance, less every attached strategy's orders
@ GatewaySelfTrade
it would cross another attached strategy's resting order
@ FxRateUnknown
[accounting]: the rate of the order's settlement currency is unknown or stale, and the order would ad...
@ BalanceShort
The account's balance on the venue, as the venue last reported it less what the engine's own orders a...
@ FeedLag
[risk] max_feed_lag_ms: the venue's market data is late (core/venue_health.hpp) and the order could r...
@ MaxGrossNotional
portfolio |position| at the last marks, over every instrument
@ InvalidAccount
NewOrderRequest::account names a venue that is neither the instrument's nor a member of its pool (cor...
@ OrderTableFull
The connector's table of the orders it has sent is full: it could not record this one (whose fills,...
@ PoolExhausted
OMS / transport.
@ GatewayFxRateUnknown
[accounting]: the order's currency has no current rate
@ GatewayGrossNotional
the account's |position| at the marks, over every instrument
@ InvalidTag
a direct order used a user_tag in the QuoteManager's range
constexpr Side opposite(Side s) noexcept
Definition enums.hpp:13
Side
Definition enums.hpp:12
FeeAsset
The asset a fill's commission is charged in.
Definition enums.hpp:481
constexpr int sign(Side s) noexcept
Definition enums.hpp:16
constexpr bool is_terminal(OrderState s) noexcept
Definition enums.hpp:90
TimeInForce
Definition enums.hpp:36
constexpr std::string_view to_string(ParamType t) noexcept
Definition params.hpp:63
OptionType
Definition enums.hpp:77
constexpr std::size_t kKillVenueSlots
Kill reasons are kept per venue id for ids 0..kKillVenueSlots-1; higher ids share the last slot,...
Definition enums.hpp:624
Liquidity
Definition enums.hpp:483
ControlCommand
Definition enums.hpp:496
@ TripVenueKill
A venue connector gave up on one venue (arg: KillReason, hdr.venue: the venue): the engine trips that...
@ ReduceOnly
Reduce-only mode (arg: 1 on, 0 off; hdr.instrument: one instrument, else hdr.venue: one venue's instr...
@ SetLimits
New risk limits for RiskEngine::set_limits.
@ Flatten
Operator flatten (arg: the slippage allowance in basis points, 0 takes [engine] flatten_slippage_bps;...
@ PoolSweep
A pool's sweep (core/transfer_lane.hpp): hdr.venue the pool's primary, arg kSweepOff,...
@ Transfer
A pool treasury's transfer (core/treasury.hpp): planned, sent, done, failed or timed out.
@ SetUnderlyingLimit
A new [risk.underlying.
@ TakeOver
A warm standby took the instance lock (fastmm-live --standby): arg is the PnL carried from earlier se...
@ PoolHome
An instrument's home in its account pool (core/pool_homes.hpp): hdr.instrument, arg pool_home_arg(to,...
@ ResetLossBudget
A new [risk] max_loss period began (max_loss_period = "utc_day"): the engine measures net PnL from ze...
@ BaseFlow
A change of a spot instrument's base asset on its accounts that no fill and no transfer of the engine...
@ Reconcile
Engine -> venue, on the outbound ring (hdr.venue: the venue): the engine and the venue disagree about...