|
FastMM C++ API 0.14.0
Public headers, tier 1 and tier 2
|
#include <fastmm/core/engine_config.hpp>
Public Attributes | |
| std::uint64_t | session_id = 0 |
| std::uint64_t | rng_seed = 1 |
| std::uint16_t | session_epoch = 1 |
| std::uint32_t | max_events_per_step = 64 |
| Duration | crossed_grace = milliseconds(100) |
| Duration | latency_publish_interval = seconds(1) |
| bool | publish_live = true |
| The monitors' snapshots (live_stats(), the latency percentiles) are published every latency_publish_interval and on every change an operator sees. | |
| Duration | reject_log_interval = seconds(10) |
| Risk rejects are logged at WARN: the first of each reason, then at most one line per reason per interval with the number suppressed in between (0 logs every reject). | |
| Duration | max_param_age {} |
| [strategy] max_param_age_ms: quoting is disabled before the first ParamUpdate and while none was applied for this long (zero: off). | |
| std::string | state_file |
| [strategy] state_file / state_interval_s (strategies/hooks.hpp KeepsState): the engine takes the strategy's state() every state_interval and at the end for whoever runs it to write to state_file (Engine::take_strategy_state; empty: never), and hands initial_state to restore() once, after on_start (empty: nothing to restore). | |
| Duration | state_interval = seconds(300) |
| std::string | initial_state |
| std::uint32_t | initial_state_version = 0 |
| The state_version initial_state was written with (the state file's head, a checkpoint's record): a backtest and a live session refuse bytes of another version before they start. | |
| Duration | checkpoint_interval {} |
| [engine] checkpoint_s: with a journal, a checkpoint is written to it this often (StrategyStateMsg Kind::Snapshot: the strategy's state() when it keeps state, the positions and the open orders; zero: never). | |
| std::vector< std::int64_t > | markout_ms |
| [engine] markout_ms: after each fill the record stream gets the instrument's mid at the fill and at each of these horizons (MarkoutRecord), at most kMaxMarkoutHorizons; empty: none. | |
| Duration | ack_timeout {} |
| [engine] ack_timeout_ms: an order still waiting for its ack this long is force-cancelled, so a lost request cannot hold a pool slot, a max_open_orders slot and max_position exposure for good (zero: off). | |
| Duration | flatten_interval = milliseconds(500) |
Operator flatten (ControlCommand::Flatten, the control socket's flatten): how often the engine looks at the remaining position and sends the next reduce-only slice, how long it keeps trying (zero: until it is flat or the operator stops it) and the slippage allowance a flatten without --max-slippage-bps uses. | |
| Duration | flatten_timeout = seconds(60) |
| std::int64_t | flatten_slippage_bps = 25 |
| bool | cancel_unknown_own = false |
| [engine] cancel_unknown = "own": an open order a reconciliation (or an ack) reports that the OMS does not know is cancelled only when its client order id is FastMM's with an epoch from 1 to session_epoch; any other is left alone. | |
| BaseFlows | base_flows = BaseFlows::Off |
| [engine] base_flows, base_flows_settle_s, base_flows_from: for every base asset of the spot instruments (one that is no instrument's quote), the accounts' total of it less the position of its instruments is measured once a second; a change that holds for base_flows_settle is a flow. | |
| Duration | base_flows_settle = seconds(30) |
| bool | base_flows_from_zero = false |
| std::int64_t | queue_conservatism_bps = 10'000 |
| [engine] queue_conservatism (a backtest: [backtest] queue_conservatism), in bps of 1: how much of a level's shrink ahead of our order the queue estimate (StrategyContext::queue_ahead) credits to cancels ahead of it. | |
| Notional | pnl_carry {} |
| Net PnL carried over from earlier sessions ([risk] max_loss is a budget for the deployment, not per process); fastmm-live reads it from the durable kill state (core/session_state.hpp). | |
| bool | quoting_enabled = true |
| bool | reduce_only = false |
| [risk] reduce_only: the session starts in reduce-only mode for every instrument (ControlCommand::ReduceOnly turns it off). | |
| std::uint32_t | reduce_only_venues = 0 |
| [venues.<x>] reduce_only: ... for the instruments of these venues, bit per venue id. | |
| std::uint32_t | await_reconcile = 0 |
| Bit v: venue v's positions are not current until its first reconciliation ends. | |
| std::vector< std::string > | venue_names |
| The venues' names ([venues. | |
| int | cpu = -1 |
| SpinMode | spin_mode = SpinMode::Busy |
| RiskLimits | risk |
| FillClusterConfig | fill_cluster |
| [risk] fill_cluster_names, fill_cluster_window_ms, fill_cluster_hold_ms: quote fills on one side over that many instruments within the window hold the side everywhere for the hold (core/fill_cluster.hpp; names 0: off). | |
| HazardConfig | hazard |
| [[risk.hazard]]: groups of instruments with a hazard score per side; evidence that takes it to the group's threshold pulls that side's quotes on the members for the hold (core/hazard.hpp; none: off). | |
| WindowsConfig | windows |
| [[windows]]: recurring windows that pull a scope's quotes or hold it reduce-only while open, on the engine's clock (core/windows.hpp; none: off). | |
| QuoteParams | quotes |
| FxPlan | fx |
| [accounting]: the settlement currencies and their FX sources (inactive: nothing converted). | |
| FeeTable | fees |
| Maker/taker rates per instrument (fee_table, config/config.hpp), what StrategyContext::fees reports. | |
| UnderlyingPlan | underlying |
| [risk.underlying]: the underlyings with a net position limit and their instruments (inactive: none). | |
| BalanceConfig | balance |
| [risk] check_balance and the initial margin rates ([[instruments]] initial_margin) the balance check and the estimate use (core/balance_book.hpp). | |
| PerpConfig | perp |
| [accounting] mark, stale_mark_ms, stale_funding_ms: what a derivative's position is valued at and when the venue's mark, index and funding are stale (core/perp_book.hpp). | |
| PoolPlan | pools |
| [venues. | |
| PoolHomesPlan | homes |
| [venues. | |
| CapacityConfig | capacity |
| [capacity]: the price of an order slot (core/capacity_price.hpp); mode off: none. | |
| std::uint64_t fastmm::EngineConfig::session_id = 0 |
| std::uint64_t fastmm::EngineConfig::rng_seed = 1 |
| std::uint16_t fastmm::EngineConfig::session_epoch = 1 |
| std::uint32_t fastmm::EngineConfig::max_events_per_step = 64 |
| Duration fastmm::EngineConfig::crossed_grace = milliseconds(100) |
| bool fastmm::EngineConfig::publish_live = true |
The monitors' snapshots (live_stats(), the latency percentiles) are published every latency_publish_interval and on every change an operator sees.
A backtest, which nobody watches, turns them off: what it records and computes is the same.
Risk rejects are logged at WARN: the first of each reason, then at most one line per reason per interval with the number suppressed in between (0 logs every reject).
| Duration fastmm::EngineConfig::max_param_age {} |
[strategy] max_param_age_ms: quoting is disabled before the first ParamUpdate and while none was applied for this long (zero: off).
| std::string fastmm::EngineConfig::state_file |
[strategy] state_file / state_interval_s (strategies/hooks.hpp KeepsState): the engine takes the strategy's state() every state_interval and at the end for whoever runs it to write to state_file (Engine::take_strategy_state; empty: never), and hands initial_state to restore() once, after on_start (empty: nothing to restore).
The loader reads the file, not the engine.
| std::string fastmm::EngineConfig::initial_state |
| std::uint32_t fastmm::EngineConfig::initial_state_version = 0 |
The state_version initial_state was written with (the state file's head, a checkpoint's record): a backtest and a live session refuse bytes of another version before they start.
| Duration fastmm::EngineConfig::checkpoint_interval {} |
[engine] checkpoint_s: with a journal, a checkpoint is written to it this often (StrategyStateMsg Kind::Snapshot: the strategy's state() when it keeps state, the positions and the open orders; zero: never).
The bytes handed to restore() are written once at the start whenever there are some.
| std::vector<std::int64_t> fastmm::EngineConfig::markout_ms |
[engine] markout_ms: after each fill the record stream gets the instrument's mid at the fill and at each of these horizons (MarkoutRecord), at most kMaxMarkoutHorizons; empty: none.
| Duration fastmm::EngineConfig::ack_timeout {} |
[engine] ack_timeout_ms: an order still waiting for its ack this long is force-cancelled, so a lost request cannot hold a pool slot, a max_open_orders slot and max_position exposure for good (zero: off).
| Duration fastmm::EngineConfig::flatten_interval = milliseconds(500) |
Operator flatten (ControlCommand::Flatten, the control socket's flatten): how often the engine looks at the remaining position and sends the next reduce-only slice, how long it keeps trying (zero: until it is flat or the operator stops it) and the slippage allowance a flatten without --max-slippage-bps uses.
| std::int64_t fastmm::EngineConfig::flatten_slippage_bps = 25 |
| bool fastmm::EngineConfig::cancel_unknown_own = false |
[engine] cancel_unknown = "own": an open order a reconciliation (or an ack) reports that the OMS does not know is cancelled only when its client order id is FastMM's with an epoch from 1 to session_epoch; any other is left alone.
False ("all"): every one is cancelled.
| BaseFlows fastmm::EngineConfig::base_flows = BaseFlows::Off |
[engine] base_flows, base_flows_settle_s, base_flows_from: for every base asset of the spot instruments (one that is no instrument's quote), the accounts' total of it less the position of its instruments is measured once a second; a change that holds for base_flows_settle is a flow.
Measured from the session's first settled value, or from zero (from_zero: the position is to equal the accounts' balance, an offset at the start included).
| bool fastmm::EngineConfig::base_flows_from_zero = false |
| std::int64_t fastmm::EngineConfig::queue_conservatism_bps = 10'000 |
[engine] queue_conservatism (a backtest: [backtest] queue_conservatism), in bps of 1: how much of a level's shrink ahead of our order the queue estimate (StrategyContext::queue_ahead) credits to cancels ahead of it.
10000: none.
| Notional fastmm::EngineConfig::pnl_carry {} |
Net PnL carried over from earlier sessions ([risk] max_loss is a budget for the deployment, not per process); fastmm-live reads it from the durable kill state (core/session_state.hpp).
| bool fastmm::EngineConfig::quoting_enabled = true |
| bool fastmm::EngineConfig::reduce_only = false |
[risk] reduce_only: the session starts in reduce-only mode for every instrument (ControlCommand::ReduceOnly turns it off).
| std::uint32_t fastmm::EngineConfig::reduce_only_venues = 0 |
[venues.<x>] reduce_only: ... for the instruments of these venues, bit per venue id.
| std::uint32_t fastmm::EngineConfig::await_reconcile = 0 |
Bit v: venue v's positions are not current until its first reconciliation ends.
A live session sets it for the venues that replay executions at connect: until then the position is the store's plus whatever the replay has booked so far, and an order sized, hedged or risk-checked on it could double a hedge or pass a limit. No order is sent and quoting stays off until every such venue has reconciled (journal header await_reconcile, so a replay does the same).
| std::vector<std::string> fastmm::EngineConfig::venue_names |
The venues' names ([venues.
<name>]), indexed by venue id: log lines name an instrument venue:symbol (Engine::venue_name; "venue \<id\>" for an id without one).
| int fastmm::EngineConfig::cpu = -1 |
| SpinMode fastmm::EngineConfig::spin_mode = SpinMode::Busy |
| RiskLimits fastmm::EngineConfig::risk |
| FillClusterConfig fastmm::EngineConfig::fill_cluster |
[risk] fill_cluster_names, fill_cluster_window_ms, fill_cluster_hold_ms: quote fills on one side over that many instruments within the window hold the side everywhere for the hold (core/fill_cluster.hpp; names 0: off).
| HazardConfig fastmm::EngineConfig::hazard |
[[risk.hazard]]: groups of instruments with a hazard score per side; evidence that takes it to the group's threshold pulls that side's quotes on the members for the hold (core/hazard.hpp; none: off).
| WindowsConfig fastmm::EngineConfig::windows |
[[windows]]: recurring windows that pull a scope's quotes or hold it reduce-only while open, on the engine's clock (core/windows.hpp; none: off).
| QuoteParams fastmm::EngineConfig::quotes |
| FxPlan fastmm::EngineConfig::fx |
[accounting]: the settlement currencies and their FX sources (inactive: nothing converted).
| FeeTable fastmm::EngineConfig::fees |
Maker/taker rates per instrument (fee_table, config/config.hpp), what StrategyContext::fees reports.
The simulated venue charges fills with the same table; a live venue reports its own.
| UnderlyingPlan fastmm::EngineConfig::underlying |
[risk.underlying]: the underlyings with a net position limit and their instruments (inactive: none).
| BalanceConfig fastmm::EngineConfig::balance |
[risk] check_balance and the initial margin rates ([[instruments]] initial_margin) the balance check and the estimate use (core/balance_book.hpp).
| PerpConfig fastmm::EngineConfig::perp |
[accounting] mark, stale_mark_ms, stale_funding_ms: what a derivative's position is valued at and when the venue's mark, index and funding are stale (core/perp_book.hpp).
| PoolPlan fastmm::EngineConfig::pools |
[venues.
<x>] pool_of: the accounts behind each venue (core/account_pool.hpp). A new order on an instrument whose venue has members goes to one of them (NewOrderRequest::account, else by balance and remaining order window), and the order keeps it.
| PoolHomesPlan fastmm::EngineConfig::homes |
[venues.
<primary>.pool]: each pool's placement, its planner's settings and the pinned homes (core/pool_homes.hpp). A pool without the table routes by balance and keeps no homes.
| CapacityConfig fastmm::EngineConfig::capacity |
[capacity]: the price of an order slot (core/capacity_price.hpp); mode off: none.