|
FastMM C++ API 0.14.0
Public headers, tier 1 and tier 2
|
#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" |
| std::string fastmm::EngineSection::name = "fastmm" |
| int fastmm::EngineSection::cpu = -1 |
| std::vector<int> fastmm::EngineSection::net_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.
| std::string fastmm::EngineSection::spin_mode = "adaptive" |
| bool fastmm::EngineSection::restore_position = true |
Carry the previous session's positions over from the store (venues that replay executions).
| std::string fastmm::EngineSection::net_backend = "epoll" |
net::Reactor backend: "epoll" | "io_uring"
| 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.
| bool fastmm::EngineSection::journal = true |
| std::string fastmm::EngineSection::journal_dir = "runs" |
| std::string fastmm::EngineSection::journal_sync = "async" |
"async" | "fdatasync" (core/journal.hpp)
| std::size_t fastmm::EngineSection::journal_max_bytes = 0 |
roll over to the next part at this size (0: never)
| int fastmm::EngineSection::journal_retention_days = 0 |
delete journals older than this (0: keep)
| std::string fastmm::EngineSection::journal_compress = "none" |
"none" | "zstd" (core/journal_archive.hpp)
| std::uint64_t fastmm::EngineSection::journal_max_total_bytes = 0 |
cap on the journals in journal_dir (0: none)
| std::int64_t fastmm::EngineSection::checkpoint_s = 0 |
journal checkpoints this often (0: none)
| std::string fastmm::EngineSection::epoch_file = "runs/session_epoch" |
| std::string fastmm::EngineSection::kill_file |
Latched kill switch and cumulative PnL; empty = "\<journal_dir\>/\<name\>.kill".
| 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.
| std::string fastmm::EngineSection::lock_file |
| 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.
| 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).
| 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.
| std::uint64_t fastmm::EngineSection::rng_seed = 1 |
| std::size_t fastmm::EngineSection::md_ring_bytes = 4U << 20 |
| std::size_t fastmm::EngineSection::order_ring_bytes = 1U << 20 |
| std::size_t fastmm::EngineSection::journal_ring_bytes = 16U << 20 |
| std::uint32_t fastmm::EngineSection::max_events_per_step = 64 |
| std::uint32_t fastmm::EngineSection::feed_budget_per_ring = 64 |
RingFeed: events per ring before the next one's turn.
| bool fastmm::EngineSection::net_spin_dedicated = false |
Adaptive: a network thread alone on its pinned core never blocks (net_never_blocks).
| int fastmm::EngineSection::crossed_grace_ms = 100 |
| int fastmm::EngineSection::ack_timeout_ms = 0 |
force-cancel an order without an ack after this long; 0 = off
| 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.
| int fastmm::EngineSection::flatten_timeout_ms = 60000 |
| int fastmm::EngineSection::flatten_slippage_bps = 25 |
| double fastmm::EngineSection::queue_conservatism = 1.0 |
queue position estimate (ctx.queue_ahead), 0..1
| int fastmm::EngineSection::latency_publish_ms = 1000 |
| int fastmm::EngineSection::tsc_recalibrate_s = 10 |
fastmm-live: TSC recalibration period, 0 = never
| std::int64_t fastmm::EngineSection::timer_slack_ns = 0 |
fastmm-live: PR_SET_TIMERSLACK of its threads, 0 = kernel's
| bool fastmm::EngineSection::lock_memory = false |
fastmm-live: mlockall(MCL_CURRENT | MCL_FUTURE)
| 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.
| int fastmm::EngineSection::rt_priority = 0 |
fastmm-live: SCHED_FIFO priority of the engine thread and of the network threads, 0 = off.
| int fastmm::EngineSection::net_rt_priority = 0 |
| bool fastmm::EngineSection::log_irq_affinity = false |
fastmm-live: log the NICs' interrupt CPUs against the pinned ones.
| 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.
| int fastmm::EngineSection::endpoint_probe_interval_s = 300 |
| int fastmm::EngineSection::endpoint_probe_samples = 8 |
| int fastmm::EngineSection::endpoint_spread_us = 20 |
| int fastmm::EngineSection::endpoint_switch_us = 50 |
| int fastmm::EngineSection::min_requote_ticks = 1 |
| int fastmm::EngineSection::min_requote_interval_ms = 50 |
| int fastmm::EngineSection::min_qty_bps = 8000 |
| bool fastmm::EngineSection::post_only = true |
| bool fastmm::EngineSection::supports_replace = true |
| int fastmm::EngineSection::reject_backoff_ms = 1000 |
QuoteManager: pause a side after a venue reject (0 = off)
| int fastmm::EngineSection::reject_backoff_max_ms = 60000 |
doubling cap
| int fastmm::EngineSection::quote_token_reserve = 0 |
[risk] order tokens quotes that add risk leave to others
| int fastmm::EngineSection::send_token_reserve = 0 |
[risk] order tokens every quote leaves for ctx.send orders
| int fastmm::EngineSection::quote_room_reserve = 0 |
venue order-window room below which quotes do not chase (-1 off)
| 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.
| 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.
| 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".
| int fastmm::EngineSection::base_flows_settle_s = 30 |
| std::string fastmm::EngineSection::base_flows_from = "session" |