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

#include <fastmm/config/config.hpp>

Public Attributes

std::string name = "fastmm"
 
int cpu = -1
 
std::vector< int > net_cpus
 
std::vector< int > aux_cpus
 Cores of every other thread (live/thread_affinity.hpp); empty: the cores no hot thread is pinned to.
 
std::string spin_mode = "adaptive"
 
bool restore_position = true
 Carry the previous session's positions over from the store (venues that replay executions).
 
std::string net_backend = "epoll"
 net::Reactor backend: "epoll" | "io_uring"
 
std::string threading = "split"
 fastmm-live: "split" runs the engine and each venue's network loop on their own threads; "single" runs the one venue's network loop, the engine and order sending on the engine thread.
 
bool journal = true
 
std::string journal_dir = "runs"
 
std::string journal_sync = "async"
 "async" | "fdatasync" (core/journal.hpp)
 
std::size_t journal_max_bytes = 0
 roll over to the next part at this size (0: never)
 
int journal_retention_days = 0
 delete journals older than this (0: keep)
 
std::string journal_compress = "none"
 "none" | "zstd" (core/journal_archive.hpp)
 
std::uint64_t journal_max_total_bytes = 0
 cap on the journals in journal_dir (0: none)
 
std::int64_t checkpoint_s = 0
 journal checkpoints this often (0: none)
 
std::string epoch_file = "runs/session_epoch"
 
std::string kill_file
 Latched kill switch and cumulative PnL; empty = "\<journal_dir\>/\<name\>.kill".
 
bool instance_lock = false
 fastmm-live: an exclusive flock(2) on lock_file (empty = "\<journal_dir\>/\<name\>.lock") taken before the session touches the account, so one process of this engine name trades at a time (live/instance_lock.hpp).
 
std::string lock_file
 
int handoff_timeout_ms = 75'000
 --takeover: how long the new process waits for the running one to release the lock after it accepted handoff, ms.
 
std::vector< std::int64_t > markout_ms
 The store's markouts: the mid this many ms after each fill (core/record_stream.hpp).
 
int stall_ms = 10'000
 fastmm-live: the engine thread stuck inside one turn of its loop this long (Engine::heartbeat has not moved) cancels every venue's orders and exits with kExitRuntime, ms; 0: never.
 
std::uint64_t rng_seed = 1
 
std::size_t md_ring_bytes = 4U << 20
 
std::size_t order_ring_bytes = 1U << 20
 
std::size_t journal_ring_bytes = 16U << 20
 
std::uint32_t max_events_per_step = 64
 
std::uint32_t feed_budget_per_ring = 64
 RingFeed: events per ring before the next one's turn.
 
bool net_spin_dedicated = false
 Adaptive: a network thread alone on its pinned core never blocks (net_never_blocks).
 
int crossed_grace_ms = 100
 
int ack_timeout_ms = 0
 force-cancel an order without an ack after this long; 0 = off
 
int flatten_interval_ms = 500
 Operator flatten (fastmm-ctl flatten): the sweep period, how long the engine keeps working the position off (0 = until it is flat or an operator stops it) and the default slippage.
 
int flatten_timeout_ms = 60000
 
int flatten_slippage_bps = 25
 
double queue_conservatism = 1.0
 queue position estimate (ctx.queue_ahead), 0..1
 
int latency_publish_ms = 1000
 
int tsc_recalibrate_s = 10
 fastmm-live: TSC recalibration period, 0 = never
 
std::int64_t timer_slack_ns = 0
 fastmm-live: PR_SET_TIMERSLACK of its threads, 0 = kernel's
 
bool lock_memory = false
 fastmm-live: mlockall(MCL_CURRENT | MCL_FUTURE)
 
int cpu_dma_latency_us = -1
 fastmm-live: PM QoS CPU latency request (/dev/cpu_dma_latency) held for the session, us; -1 = none.
 
int rt_priority = 0
 fastmm-live: SCHED_FIFO priority of the engine thread and of the network threads, 0 = off.
 
int net_rt_priority = 0
 
bool log_irq_affinity = false
 fastmm-live: log the NICs' interrupt CPUs against the pinned ones.
 
bool endpoint_select = false
 Endpoint selection (net/endpoint_selector.hpp): connect to the fastest of a venue host's addresses.
 
int endpoint_probe_interval_s = 300
 
int endpoint_probe_samples = 8
 
int endpoint_spread_us = 20
 
int endpoint_switch_us = 50
 
int min_requote_ticks = 1
 
int min_requote_interval_ms = 50
 
int min_qty_bps = 8000
 
bool post_only = true
 
bool supports_replace = true
 
int reject_backoff_ms = 1000
 QuoteManager: pause a side after a venue reject (0 = off)
 
int reject_backoff_max_ms = 60000
 doubling cap
 
int quote_token_reserve = 0
 [risk] order tokens quotes that add risk leave to others
 
int send_token_reserve = 0
 [risk] order tokens every quote leaves for ctx.send orders
 
int quote_room_reserve = 0
 venue order-window room below which quotes do not chase (-1 off)
 
std::string on_kill = "exit"
 fastmm-live after a kill switch it did not ask for (risk limit, internal failure, every venue killed): "exit" shuts down like SIGTERM and exits with code 6; "stay" keeps running with quoting off and logs an ERROR line every 10 s.
 
std::string cancel_unknown = "all"
 Open orders a reconciliation finds on the session's symbols that the engine does not know: "all" cancels every one; "own" only those whose client order id FastMM minted with an epoch up to this session's, and leaves the rest (manual orders, another program's) alone.
 
std::string base_flows = "off"
 A change of a spot instrument's base asset on its accounts that no fill or transfer of the engine's made (EngineConfig::base_flows): "off" | "report" | "adjust"; how long a change must hold first; and what it is measured from: "session" (the first settled offset) or "zero".
 
int base_flows_settle_s = 30
 
std::string base_flows_from = "session"
 

Member Data Documentation

◆ name

std::string fastmm::EngineSection::name = "fastmm"

◆ cpu

int fastmm::EngineSection::cpu = -1

◆ net_cpus

std::vector<int> fastmm::EngineSection::net_cpus

◆ aux_cpus

std::vector<int> fastmm::EngineSection::aux_cpus

Cores of every other thread (live/thread_affinity.hpp); empty: the cores no hot thread is pinned to.

◆ spin_mode

std::string fastmm::EngineSection::spin_mode = "adaptive"

◆ restore_position

bool fastmm::EngineSection::restore_position = true

Carry the previous session's positions over from the store (venues that replay executions).

◆ net_backend

std::string fastmm::EngineSection::net_backend = "epoll"

net::Reactor backend: "epoll" | "io_uring"

◆ threading

std::string fastmm::EngineSection::threading = "split"

fastmm-live: "split" runs the engine and each venue's network loop on their own threads; "single" runs the one venue's network loop, the engine and order sending on the engine thread.

◆ journal

bool fastmm::EngineSection::journal = true

◆ journal_dir

std::string fastmm::EngineSection::journal_dir = "runs"

◆ journal_sync

std::string fastmm::EngineSection::journal_sync = "async"

"async" | "fdatasync" (core/journal.hpp)

◆ journal_max_bytes

std::size_t fastmm::EngineSection::journal_max_bytes = 0

roll over to the next part at this size (0: never)

◆ journal_retention_days

int fastmm::EngineSection::journal_retention_days = 0

delete journals older than this (0: keep)

◆ journal_compress

std::string fastmm::EngineSection::journal_compress = "none"

"none" | "zstd" (core/journal_archive.hpp)

◆ journal_max_total_bytes

std::uint64_t fastmm::EngineSection::journal_max_total_bytes = 0

cap on the journals in journal_dir (0: none)

◆ checkpoint_s

std::int64_t fastmm::EngineSection::checkpoint_s = 0

journal checkpoints this often (0: none)

◆ epoch_file

std::string fastmm::EngineSection::epoch_file = "runs/session_epoch"

◆ kill_file

std::string fastmm::EngineSection::kill_file

Latched kill switch and cumulative PnL; empty = "\<journal_dir\>/\<name\>.kill".

◆ instance_lock

bool fastmm::EngineSection::instance_lock = false

fastmm-live: an exclusive flock(2) on lock_file (empty = "\<journal_dir\>/\<name\>.lock") taken before the session touches the account, so one process of this engine name trades at a time (live/instance_lock.hpp).

--standby and --takeover take it whatever this says.

◆ lock_file

std::string fastmm::EngineSection::lock_file

◆ handoff_timeout_ms

int fastmm::EngineSection::handoff_timeout_ms = 75'000

--takeover: how long the new process waits for the running one to release the lock after it accepted handoff, ms.

◆ markout_ms

std::vector<std::int64_t> fastmm::EngineSection::markout_ms

The store's markouts: the mid this many ms after each fill (core/record_stream.hpp).

◆ stall_ms

int fastmm::EngineSection::stall_ms = 10'000

fastmm-live: the engine thread stuck inside one turn of its loop this long (Engine::heartbeat has not moved) cancels every venue's orders and exits with kExitRuntime, ms; 0: never.

◆ rng_seed

std::uint64_t fastmm::EngineSection::rng_seed = 1

◆ md_ring_bytes

std::size_t fastmm::EngineSection::md_ring_bytes = 4U << 20

◆ order_ring_bytes

std::size_t fastmm::EngineSection::order_ring_bytes = 1U << 20

◆ journal_ring_bytes

std::size_t fastmm::EngineSection::journal_ring_bytes = 16U << 20

◆ max_events_per_step

std::uint32_t fastmm::EngineSection::max_events_per_step = 64

◆ feed_budget_per_ring

std::uint32_t fastmm::EngineSection::feed_budget_per_ring = 64

RingFeed: events per ring before the next one's turn.

◆ net_spin_dedicated

bool fastmm::EngineSection::net_spin_dedicated = false

Adaptive: a network thread alone on its pinned core never blocks (net_never_blocks).

◆ crossed_grace_ms

int fastmm::EngineSection::crossed_grace_ms = 100

◆ ack_timeout_ms

int fastmm::EngineSection::ack_timeout_ms = 0

force-cancel an order without an ack after this long; 0 = off

◆ flatten_interval_ms

int fastmm::EngineSection::flatten_interval_ms = 500

Operator flatten (fastmm-ctl flatten): the sweep period, how long the engine keeps working the position off (0 = until it is flat or an operator stops it) and the default slippage.

◆ flatten_timeout_ms

int fastmm::EngineSection::flatten_timeout_ms = 60000

◆ flatten_slippage_bps

int fastmm::EngineSection::flatten_slippage_bps = 25

◆ queue_conservatism

double fastmm::EngineSection::queue_conservatism = 1.0

queue position estimate (ctx.queue_ahead), 0..1

◆ latency_publish_ms

int fastmm::EngineSection::latency_publish_ms = 1000

◆ tsc_recalibrate_s

int fastmm::EngineSection::tsc_recalibrate_s = 10

fastmm-live: TSC recalibration period, 0 = never

◆ timer_slack_ns

std::int64_t fastmm::EngineSection::timer_slack_ns = 0

fastmm-live: PR_SET_TIMERSLACK of its threads, 0 = kernel's

◆ lock_memory

bool fastmm::EngineSection::lock_memory = false

fastmm-live: mlockall(MCL_CURRENT | MCL_FUTURE)

◆ cpu_dma_latency_us

int fastmm::EngineSection::cpu_dma_latency_us = -1

fastmm-live: PM QoS CPU latency request (/dev/cpu_dma_latency) held for the session, us; -1 = none.

◆ rt_priority

int fastmm::EngineSection::rt_priority = 0

fastmm-live: SCHED_FIFO priority of the engine thread and of the network threads, 0 = off.

◆ net_rt_priority

int fastmm::EngineSection::net_rt_priority = 0

◆ log_irq_affinity

bool fastmm::EngineSection::log_irq_affinity = false

fastmm-live: log the NICs' interrupt CPUs against the pinned ones.

◆ endpoint_select

bool fastmm::EngineSection::endpoint_select = false

Endpoint selection (net/endpoint_selector.hpp): connect to the fastest of a venue host's addresses.

endpoint_select is the default of every venue; the rest tune the probes.

◆ endpoint_probe_interval_s

int fastmm::EngineSection::endpoint_probe_interval_s = 300

◆ endpoint_probe_samples

int fastmm::EngineSection::endpoint_probe_samples = 8

◆ endpoint_spread_us

int fastmm::EngineSection::endpoint_spread_us = 20

◆ endpoint_switch_us

int fastmm::EngineSection::endpoint_switch_us = 50

◆ min_requote_ticks

int fastmm::EngineSection::min_requote_ticks = 1

◆ min_requote_interval_ms

int fastmm::EngineSection::min_requote_interval_ms = 50

◆ min_qty_bps

int fastmm::EngineSection::min_qty_bps = 8000

◆ post_only

bool fastmm::EngineSection::post_only = true

◆ supports_replace

bool fastmm::EngineSection::supports_replace = true

◆ reject_backoff_ms

int fastmm::EngineSection::reject_backoff_ms = 1000

QuoteManager: pause a side after a venue reject (0 = off)

◆ reject_backoff_max_ms

int fastmm::EngineSection::reject_backoff_max_ms = 60000

doubling cap

◆ quote_token_reserve

int fastmm::EngineSection::quote_token_reserve = 0

[risk] order tokens quotes that add risk leave to others

◆ send_token_reserve

int fastmm::EngineSection::send_token_reserve = 0

[risk] order tokens every quote leaves for ctx.send orders

◆ quote_room_reserve

int fastmm::EngineSection::quote_room_reserve = 0

venue order-window room below which quotes do not chase (-1 off)

◆ on_kill

std::string fastmm::EngineSection::on_kill = "exit"

fastmm-live after a kill switch it did not ask for (risk limit, internal failure, every venue killed): "exit" shuts down like SIGTERM and exits with code 6; "stay" keeps running with quoting off and logs an ERROR line every 10 s.

◆ cancel_unknown

std::string fastmm::EngineSection::cancel_unknown = "all"

Open orders a reconciliation finds on the session's symbols that the engine does not know: "all" cancels every one; "own" only those whose client order id FastMM minted with an epoch up to this session's, and leaves the rest (manual orders, another program's) alone.

◆ base_flows

std::string fastmm::EngineSection::base_flows = "off"

A change of a spot instrument's base asset on its accounts that no fill or transfer of the engine's made (EngineConfig::base_flows): "off" | "report" | "adjust"; how long a change must hold first; and what it is measured from: "session" (the first settled offset) or "zero".

◆ base_flows_settle_s

int fastmm::EngineSection::base_flows_settle_s = 30

◆ base_flows_from

std::string fastmm::EngineSection::base_flows_from = "session"