FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
fastmm::EngineConfig Struct Reference

#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)
 
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
 
Duration state_snapshot_interval {}
 [strategy] state_snapshot_interval_s: with a journal, the strategy's state() and the positions are written to it this often (StrategyStateMsg; zero: never).
 
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
 
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
 
std::uint32_t await_reconcile = 0
 Bit v: venue v's positions are not current until its first reconciliation ends.
 
int cpu = -1
 
SpinMode spin_mode = SpinMode::Busy
 
RiskLimits risk
 
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.
 

Member Data Documentation

◆ session_id

std::uint64_t fastmm::EngineConfig::session_id = 0

◆ rng_seed

std::uint64_t fastmm::EngineConfig::rng_seed = 1

◆ session_epoch

std::uint16_t fastmm::EngineConfig::session_epoch = 1

◆ max_events_per_step

std::uint32_t fastmm::EngineConfig::max_events_per_step = 64

◆ crossed_grace

Duration fastmm::EngineConfig::crossed_grace = milliseconds(100)

◆ latency_publish_interval

Duration fastmm::EngineConfig::latency_publish_interval = seconds(1)

◆ reject_log_interval

Duration fastmm::EngineConfig::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).

◆ max_param_age

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).

◆ state_file

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.

◆ state_interval

Duration fastmm::EngineConfig::state_interval = seconds(300)

◆ initial_state

std::string fastmm::EngineConfig::initial_state

◆ state_snapshot_interval

Duration fastmm::EngineConfig::state_snapshot_interval {}

[strategy] state_snapshot_interval_s: with a journal, the strategy's state() and the positions are written to it this often (StrategyStateMsg; zero: never).

The bytes handed to restore() are written once at the start whenever there are some.

◆ ack_timeout

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).

◆ flatten_interval

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.

◆ flatten_timeout

Duration fastmm::EngineConfig::flatten_timeout = seconds(60)

◆ flatten_slippage_bps

std::int64_t fastmm::EngineConfig::flatten_slippage_bps = 25

◆ queue_conservatism_bps

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.

◆ pnl_carry

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).

◆ quoting_enabled

bool fastmm::EngineConfig::quoting_enabled = true

◆ await_reconcile

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).

◆ cpu

int fastmm::EngineConfig::cpu = -1

◆ spin_mode

SpinMode fastmm::EngineConfig::spin_mode = SpinMode::Busy

◆ risk

RiskLimits fastmm::EngineConfig::risk

◆ quotes

QuoteParams fastmm::EngineConfig::quotes

◆ fx

FxPlan fastmm::EngineConfig::fx

[accounting]: the settlement currencies and their FX sources (inactive: nothing converted).

◆ fees

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.

◆ underlying

UnderlyingPlan fastmm::EngineConfig::underlying

[risk.underlying]: the underlyings with a net position limit and their instruments (inactive: none).

◆ balance

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).

◆ perp

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).

◆ pools

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.