36 "session name, used in logs, journal file names and the status file (default \"fastmm\")"},
41 "CPU core of the engine thread; -1 = not pinned (default -1)"},
46 "CPU cores of the network threads, one per venue in order; venues given the same core run on "
47 "one thread when it polls (spin_mode = \"busy\", or net_spin_dedicated) and the core is not "
48 "the engine's; otherwise, with spin_mode = \"adaptive\", a thread whose core it shares with "
49 "the engine or another network thread blocks when idle instead of spinning (default [])"},
54 "fastmm-live, fastmm-gateway: CPU cores of the threads that are not the engine's or a "
55 "network thread's (journal, store, audit, treasury, resolvers, main); empty = every core but "
56 "cpu, net_cpus and the venues' md_copy_cpus, or, when those take every core, every core but "
57 "cpu and the cores of network threads that never block, with a warning (default [])"},
62 "busy (spin forever) | adaptive (spin briefly, then block until work arrives; use on WSL2 "
63 "and laptops) (default adaptive)"},
68 "event loop of fastmm-live and fastmm-sim-exchange: epoll | io_uring (Linux 5.13 or newer; "
69 "falls back to epoll with a warning) (default epoll)"},
74 "fastmm-live: split (engine and network threads, rings between them) | single (one venue; "
75 "its network loop, the engine and order sending run on the engine thread, cpu; net_cpus is "
76 "ignored) (default split)"},
81 "record every consumed event to a .fmj journal (default true)"},
82 {
"engine",
"journal_dir",
KeyType::String,
false,
"directory for journals (default \"runs\")"},
87 "how far a journal write is pushed: async (the kernel writes it back; survives the process "
88 "dying) | fdatasync (fdatasync every 100 ms; survives power loss) (default async)"},
93 "roll the journal over to the next part at this size, bytes; each part is a complete journal "
94 "(\"x.fmj\", \"x.1.fmj\", ...); 0 = one file per session (default 0)"},
96 "journal_retention_days",
99 "delete journals (.fmj and .fmj.zst) in journal_dir last written more than this many days "
100 "ago, at start and, in fastmm-live, every minute while it runs; 0 = keep everything "
106 "fastmm-live: none | zstd: compress each journal in journal_dir nobody is writing to "
107 "x.fmj.zst on a background thread, a minute after it was last written; the replay, "
108 "backtest and tools read either form (default none)"},
110 "journal_max_total_bytes",
113 "cap on the journals in journal_dir, bytes, compressed or not: the oldest go first, at start "
114 "and, in fastmm-live, every minute; a part being written is never deleted; 0 = no cap "
120 "with a journal, how often the engine writes a checkpoint to it: the strategy's state() (a "
121 "strategy that keeps state), the positions and the open orders, seconds of engine time; a "
122 "backtest can start from any of them (default 0: never)"},
127 "session epoch file, keeps client order ids unique across restarts (default "
128 "\"runs/session_epoch\")"},
133 "latched kill switch and cumulative PnL, so [risk] max_loss is a budget across restarts "
134 "(default \"<journal_dir>/<name>.kill\")"},
139 "fastmm-live: take an exclusive lock on lock_file before touching the account and refuse to "
140 "start (exit code 8) while another process holds it; --standby and --takeover take it "
141 "whatever this says (default false)"},
146 "the instance lock's file (default \"<journal_dir>/<name>.lock\")"},
148 "handoff_timeout_ms",
151 "fastmm-live --takeover: how long to wait for the running session to release the instance "
152 "lock once it accepted the handoff, ms (default 75000)"},
157 "with a store, the mid at each fill and this many ms after it, up to 4 horizons, in the "
158 "store's markouts table (fastmm-pnl ab); e.g. [1000, 10000, 60000] (default: none)"},
163 "fastmm-live: an engine thread that has not finished a turn of its loop for this long (a "
164 "strategy hook that never returns) is given up: every venue cancels all its orders and the "
165 "process exits with code 5, ms; 0 = never (default 10000)"},
170 "force-cancel an order whose ack has not arrived within this long, ms; 0 = off (default 0)"},
172 "queue_conservatism",
175 "the queue position estimate ctx.queue_ahead, from 0 to 1: at 0 a level's shrink is shared "
176 "between cancels ahead of and behind our order, at 1 cancels never move it up (default 1.0; "
177 "a backtest uses [backtest] queue_conservatism when set)"},
179 "flatten_interval_ms",
182 "how often an operator flatten looks at the position left and sends the next reduce-only "
183 "slice, ms (default 500)"},
185 "flatten_timeout_ms",
188 "how long an operator flatten keeps trying before it gives up and leaves the position, ms; "
189 "0 = until it is flat or an operator stops it (default 60000)"},
191 "flatten_slippage_bps",
194 "how far through the touch a flatten prices its orders when the command gives no "
195 "--max-slippage-bps, basis points (default 25)"},
200 "seed of the strategy random generator ctx.rng() (default 1)"},
205 "market-data ring per venue, bytes, a power of two (default 4194304)"},
210 "order-event ring per venue, bytes, a power of two (default 1048576)"},
212 "journal_ring_bytes",
215 "engine-to-journal ring, bytes, a power of two (default 16777216)"},
217 "max_events_per_step",
220 "events taken from each ring per engine iteration (default 64)"},
222 "feed_budget_per_ring",
225 "fastmm-live: events the engine takes from one input ring before the next ring's turn; 1 "
226 "interleaves the rings, so a burst of one account's order events does not hold up the "
227 "market data behind it (default 64)"},
229 "net_spin_dedicated",
232 "with spin_mode = \"adaptive\": a network thread pinned to a core of its own (net_cpus, "
233 "shared with neither the engine nor another network thread) polls without ever blocking, as "
234 "with \"busy\", and so does the one thread of the venues net_cpus gives one core; threads "
235 "on the engine's core or unpinned still block when idle (default false)"},
240 "tolerate a crossed book this long before pulling its quotes, ms (default 100)"},
242 "latency_publish_ms",
245 "latency histogram publish interval, ms (default 1000)"},
250 "fastmm-live: TSC recalibration period, s; 0 = off (default 10)"},
255 "fastmm-live: timer slack of its threads, ns; how late a timed wait may end (adaptive "
256 "spin_mode: the engine's idle wait, at most 1 ms, and with threading = \"single\" a 50 us "
257 "sleep); 0 = the kernel's, 50000 (default 0)"},
262 "carry the previous session's positions over from the store and replay the venue's executions "
263 "since its last recorded fill (venues that can replay executions); default true"},
268 "fastmm-live: mlockall() the process, so no page is swapped out or faulted in on the hot "
269 "path; needs ulimit -l above the process size, a warning otherwise (default false)"},
271 "cpu_dma_latency_us",
274 "fastmm-live: holds /dev/cpu_dma_latency at this many us for the session, so no CPU enters "
275 "an idle state that takes longer to wake; 0 keeps every CPU polling in C0; needs write "
276 "access to the device, a warning otherwise; -1 = no request (default -1)"},
281 "fastmm-live: SCHED_FIFO priority 1..99 of the engine thread (with threading = \"single\" it "
282 "also runs the network loop); needs CAP_SYS_NICE or ulimit -r at least as high, a warning "
283 "otherwise; a busy-spinning FIFO thread starves the kernel's threads on its core unless the "
284 "core is isolated; 0 = the default scheduler (default 0)"},
289 "fastmm-live: SCHED_FIFO priority 1..99 of the network threads, as rt_priority; ignored with "
290 "threading = \"single\"; 0 = the default scheduler (default 0)"},
295 "fastmm-live: at start, log each network interface's queue interrupts with the CPUs they may "
296 "run on and which of them are cpu or net_cpus, and warn about any that may run on the "
297 "engine's CPU; read only (default false)"},
302 "fastmm-live, fastmm-gateway: connect to the fastest of each venue host's addresses, as "
303 "measured by TCP connects to every address the lookups return; the default of every "
304 "[venues.<name>] endpoint_select (default false)"},
306 "endpoint_probe_interval_s",
309 "with endpoint selection: how often a background thread looks the hosts in use up again and "
310 "probes their addresses, s; connections also probe whenever they connect; 0 = only then "
313 "endpoint_probe_samples",
316 "with endpoint selection: TCP connects to each address per probe, ranked by their median, "
317 "1 to 100 (default 8)"},
319 "endpoint_spread_us",
322 "with endpoint selection: addresses this close to the fastest count as fast, and a new "
323 "connection takes the one of them with the fewest connections, so a venue's md_copies spread "
324 "over them, us (default 20)"},
326 "endpoint_switch_us",
329 "with endpoint selection: a live connection that rolls over (Binance) moves to the fastest "
330 "address, make-before-break, once its own is this much slower or no lookup returns it; "
331 "others move when they next connect; 0 = never moves, us (default 50)"},
336 "keep a resting quote whose price is within this many ticks of the desired price (default 1)"},
338 "min_requote_interval_ms",
341 "change the same quote slot at most this often, ms (default 50)"},
346 "keep a resting quote whose remaining quantity covers this share of the desired quantity, "
347 "bps (default 8000 = 80 %)"},
348 {
"engine",
"post_only",
KeyType::Bool,
false,
"send quotes as post-only orders (default true)"},
353 "let the quote manager amend orders in place where the venue supports it (default true)"},
358 "after the venue refuses a quote's new order or replace, other than a post-only cross or an "
359 "order it no longer has, or the price collar or fat-finger band refuses it, no new orders or "
360 "replaces on that side for this long, doubling with each further refusal, then the side "
362 "again, ms; 0 = off (default 1000)"},
364 "reject_backoff_max_ms",
367 "cap of the doubling reject backoff, ms (default 60000)"},
369 "quote_token_reserve",
372 "order tokens of [risk] orders_per_sec a quote that does not reduce the position leaves for "
373 "the strategy's own orders and for quotes that do; quotes short of a token wait and are "
374 "placed in turn as tokens return, not refused (default 0)"},
376 "send_token_reserve",
379 "order tokens of [risk] orders_per_sec every quote leaves for the orders the strategy sends "
380 "itself, which are refused without a token where quotes wait for one; a quote that does not "
381 "reduce the position leaves quote_token_reserve on top of it (default 0)"},
383 "quote_room_reserve",
386 "orders an account's venue order windows keep for quotes into empty levels and moves away "
387 "from the touch: with no more left, a resting quote is not moved towards the touch and stays "
388 "where it is; -1 = off (default 0: only when none is left)"},
393 "fastmm-live after a kill switch the engine trips itself ([risk] max_loss, a full ring, every "
394 "venue killed): exit (normal shutdown, exit code 6) | stay (keep running with quoting off) "
400 "open orders the engine does not know, found on its symbols at start-up and after a "
401 "reconnect: all (cancel every one; the account must be FastMM's alone) | own (cancel only "
402 "those with a FastMM client order id of this engine's epochs) (default all)"},
407 "a change of a spot instrument's base asset on its accounts that no fill and no transfer of "
408 "the engine's made (a token dividend, an airdrop, a deposit): off | report (log and journal "
409 "it) | adjust (and book it to the position at the mid) (default off)"},
411 "base_flows_settle_s",
414 "how long such a change must hold before it counts, s (default 30)"},
419 "what base_flows measures the accounts' balance against the position from: session (the "
420 "difference when the session's balances first settle) | zero (the position is to equal the "
421 "balance, a difference at the start included) (default session)"},
427 "name of a registered connector; the keys it adds to this section are its own "
428 "(see Connectors below)"},
429 {
"venues.*",
"ws_url",
KeyType::String,
false,
"market-data WebSocket URL"},
434 "order-entry WebSocket API URL, where the venue has one"},
436 {
"venues.*",
"api_key",
KeyType::String,
false,
"API key, written as \"${VARIABLE}\""},
437 {
"venues.*",
"api_secret",
KeyType::String,
false,
"API secret, written as \"${VARIABLE}\""},
442 "API key passphrase where the venue has one (OKX, Coinbase Exchange), written as "
448 "the endpoints are a testnet or demo environment (default true)"},
453 "the venue can amend an order in place (default false)"},
458 "skip TLS certificate verification; local simulator only (default false)"},
463 "extra CA certificate, for example tests/fixtures/tls/cert.pem for the local simulator"},
468 "market data only: no keys, no private sessions, no orders on this venue (default false)"},
473 "name of another [venues.<name>] of the same kind whose instruments this account takes orders "
474 "for, with its own keys, balances and order-count windows; no instruments or market data of "
475 "its own (default none)"},
480 "start in reduce-only mode for this venue's instruments: orders that would take a position "
481 "further from zero are refused until fastmm-ctl reduce-only off --venue <name> (default "
487 "validity window of signed requests, ms (default 3000)"},
492 "the venue's connections leave this host from this address, IPv4 or IPv6; it must be one of "
493 "the host's (default: the kernel chooses)"},
498 "the venue's connections leave this host from this network interface's address; exclusive "
499 "with source_ip (default: the kernel chooses)"},
504 "connect to the fastest of each of the venue's host's addresses ([engine] "
505 "endpoint_probe_interval_s and the other endpoint_ keys tune it); the connections keep the "
506 "host name for TLS and HTTP (default: [engine] endpoint_select)"},
511 "redundant market-data connections carrying the venue's top-of-book streams again; each "
512 "update reaches the engine once, from whichever connection delivered it first (connectors "
513 "with copies: binance, binance_usdm; 0 to 8, default 0)"},
518 "fastmm-live: CPU cores of network threads of their own for the copies, one per copy in "
519 "order; copies given the same core share a thread, -1 = a thread not pinned; copies past the "
520 "end of the list run on the venue's network thread (default [], all of them do)"},
522 "fill_audit_interval_s",
525 "fastmm-live compares the venue's trade history with the stored fills this often, s; 0 = off "
526 "(default 0, at least 10)"},
531 "a fill audit reads up to this long ago, s, so the execution replay has booked what it will "
537 "\"report\" logs and counts what differs; \"book\" also books the executions the engine "
539 "(default \"report\")"},
544 "a tick, lot, min_qty, max_qty or min_notional of [[instruments]] that differs from the "
545 "venue's at start-up: \"adopt\" the venue's (default), \"warn\" and keep the configured "
546 "one, or \"refuse\" to start"},
551 "[venues.<name>.fees] table: maker_bps and taker_bps, used for PnL"},
556 "maker fee, bps; negative = rebate (default 0)"},
557 {
"venues.*.fees",
"taker_bps",
KeyType::Float,
false,
"taker fee, bps (default 0)"},
562 "[venues.<primary>.treasury] table: transfers that keep one asset spread over the accounts "
563 "of the pool this venue is the primary of (fastmm-live)"},
564 {
"venues.*.treasury",
568 "move the asset between the pool's accounts (default false)"},
569 {
"venues.*.treasury",
573 "log and journal the planned transfers without sending them; needs no transfer key (default "
575 {
"venues.*.treasury",
579 "the asset kept spread, for example USDT; required when enabled"},
580 {
"venues.*.treasury",
584 "\"weights\": each account's target is its weight's share of the pool's free balance; "
585 "\"demand\": what the strategy's funding needs of the instruments homed there add up to "
586 "(ctx.set_funding_need), needs a [venues.<primary>.pool] table (default \"weights\")"},
587 {
"venues.*.treasury",
591 "demand targets: each account's need times (1 + headroom) (default 0.15)"},
592 {
"venues.*.treasury",
596 "the engine holds a planned transfer out of the payer's free balance until it resolves, so no "
597 "order spends it first (default false)"},
598 {
"venues.*.treasury",
602 "{ <account> = <weight>, ... }: each account's share of the pool's free balance (default 1 "
604 {
"venues.*.treasury",
608 "{ <account> = \"<decimal>\", ... }: free balance an account is topped up to and never gives "
609 "below (default 0)"},
610 {
"venues.*.treasury",
614 "an account is short below its target times (1 - threshold), 0 to 1 (default 0.2)"},
615 {
"venues.*.treasury",
619 "smallest transfer, decimal (default 0)"},
620 {
"venues.*.treasury",
624 "largest transfer, decimal; 0 = no cap (default 0)"},
625 {
"venues.*.treasury",
629 "transfer amounts round down to a multiple of it, decimal (default 0.01)"},
630 {
"venues.*.treasury",
634 "how often the balances are looked at and a transfer in flight is asked for, s (default 10)"},
635 {
"venues.*.treasury",
639 "least time between two transfers sent, s (default 60)"},
640 {
"venues.*.treasury",
644 "transfers sent in any hour; 0 = no limit (default 12)"},
645 {
"venues.*.treasury",
649 "no transfer for this long after one failed or timed out, s (default 300)"},
650 {
"venues.*.treasury",
654 "a transfer unresolved this long times out (cooldown_s; still asked for), and one the venue "
655 "has no record of fails, s (default 60)"},
656 {
"venues.*.treasury",
660 "longest wait after a transfer for both accounts' balances to report it, s (default 30)"},
661 {
"venues.*.treasury",
665 "the transfers in flight, the id counter and the limiter across restarts (default "
666 "<journal_dir>/<engine name>.<primary>.treasury)"},
671 "[venues.<primary>.pool] table: where the pool this venue is the primary of keeps each "
672 "instrument's position (home placement) and the planner that spreads the homes"},
677 "\"balance\": each new order to the account whose balance covers it with the most order "
678 "window left; \"home\": each instrument's position on one account, its home: an order goes "
679 "there unless it takes a piece on another account towards zero (default \"balance\")"},
684 "accounts that may carry reducing orders of one instrument and side at once; 1 offers a "
685 "piece alone until it is gone (default 1)"},
690 "\"never\": an order for a home that is down is refused HomeUnavailable; \"flat\": an "
691 "instrument flat over the pool and not pinned moves to the usable account with the most "
692 "order window first; \"busy\": a spot order that adds goes to the account the balance "
693 "routing picks when its home is down, past spill_at of its 10 s window, short of the "
694 "balance or priced out by [capacity], and the home stays (default \"never\")"},
699 "spill = \"busy\": the share of the home's 10 s order window, as its connector admits it, "
700 "from which adding orders go to another account (default 0.8)"},
705 "how often the planner moves homes to spread the orders the homes carry over the accounts' "
706 "10 s windows, s; 0 = no planner (default 30)"},
711 "hours of the engine's own orders the planner plans from (default 1)"},
716 "instruments the planner moves at most per plan (default 3)"},
721 "{ <symbol> = \"<account>\", ... }: pinned homes the planner and a spill never move "
727 "true: the engine moves a spot instrument's free base on another account of the pool to its "
728 "home by internal transfer, and sends reducing orders to the home; \"auto\": true when the "
729 "primary's connector has a transfer key (default false)"},
734 "a piece is swept once its holding and the free part of it have not changed for this long, "
735 "ms (default 3000)"},
740 "an amount below the tradable minimum is swept after this long, or with the delay when the "
741 "home holds a tradable amount, s (default 3600)"},
746 "after a refused transfer the payer's asset waits this long, s (default 30)"},
751 "[venues.<primary>.transfers] table: the budget and breaker of the transfers the engine makes "
752 "for the pool's sweep"},
753 {
"venues.*.transfers",
757 "transfers unresolved at once, at most 16; one per asset (default 8)"},
758 {
"venues.*.transfers",
762 "transfers created in any minute (default 20)"},
763 {
"venues.*.transfers",
767 "transfers created in any hour (default 300)"},
768 {
"venues.*.transfers",
772 "transfers created in any 24 h; once used, pieces trade off on their accounts (default "
774 {
"venues.*.transfers",
778 "the sweep pauses this long after 5 failures, 3 unknown answers or 10 refusals for want of "
779 "balance in 10 minutes, or a rate-limit answer; a second trip turns it off until fastmm-ctl "
780 "pool sweep on, s (default "
782 {
"venues.*.transfers",
786 "an unresolved transfer this old is reported late, and one the venue has no record of fails, "
788 {
"venues.*.transfers",
792 "a transfer not confirmed by both accounts' flows is asked for this often, s (default 10)"},
793 {
"venues.*.transfers",
797 "journal and count the transfers the sweep would make; hold and send nothing, and route as "
798 "without the sweep (default false)"},
799 {
"venues.*.transfers",
803 "the transfers in flight across restarts (default <journal_dir>/<engine "
804 "name>.<primary>.transfers)"},
806 {
"instruments[]",
"venue",
KeyType::String,
true,
"name of a [venues.<name>] table"},
807 {
"instruments[]",
"symbol",
KeyType::String,
true,
"venue symbol, for example BTCUSDT"},
808 {
"instruments[]",
"base",
KeyType::String,
false,
"base asset, for example BTC"},
809 {
"instruments[]",
"quote",
KeyType::String,
false,
"quote asset, for example USDT"},
814 "spot | perpetual (perp) | future (futures) | option | fx | equity (default spot)"},
815 {
"instruments[]",
"tick",
KeyType::Any,
true,
"price increment, decimal"},
816 {
"instruments[]",
"lot",
KeyType::Any,
true,
"quantity increment, decimal"},
817 {
"instruments[]",
"min_qty",
KeyType::Any,
false,
"smallest order quantity, decimal"},
818 {
"instruments[]",
"max_qty",
KeyType::Any,
false,
"largest order quantity, decimal"},
823 "smallest order value, settlement currency (base coin for an inverse contract), "
826 "contract_multiplier",
829 "units of the underlying per contract, decimal; PnL and notional use it (default 1)"},
834 "trade this instrument; false loads it without trading (default true)"},
835 {
"instruments[]",
"price_decimals",
KeyType::Int,
false,
"price display precision (default 8)"},
836 {
"instruments[]",
"expiry",
KeyType::String,
false,
"expiry of a derivative, ISO-8601"},
837 {
"instruments[]",
"strike",
KeyType::Any,
false,
"option strike, decimal"},
838 {
"instruments[]",
"option_type",
KeyType::String,
false,
"call | put"},
843 "maker fee of this instrument, bps; negative = rebate. Overrides the venue's fees table"},
848 "taker fee of this instrument, bps. Overrides the venue's fees table"},
853 "initial margin of a derivative, fraction of the notional (0.1 at 10x leverage), decimal; the "
854 "balance check and estimate use it (default: none, an order passes while the venue reports "
855 "margin available)"},
857 {
"strategy",
"name",
KeyType::String,
true,
"registered strategy name (see --list-strategies)"},
862 "disable quoting before the first parameter update and while none was applied for this long, "
863 "ms of engine time (default 0: off)"},
868 "file the strategy's state() is written to every state_interval_s and at the end, and "
869 "restore() reads at the start (a strategy that keeps state; default: none)"},
874 "how often the state is written, seconds of engine time (default 300)"},
879 "[strategy.params] table: the strategy's parameters"},
880 {
"strategy.params",
"*",
KeyType::Any,
false,
"strategy parameters (validated by the schema)"},
885 "[strategy.groups] table: name = [\"symbol\" or \"venue:symbol\", ...], instruments that "
886 "[strategy.overrides] and fastmm-ctl param --group name together"},
887 {
"strategy.groups",
"*",
KeyType::Any,
false,
"the instruments of one group"},
892 "[strategy.overrides.<key>] tables: parameters of one instrument (\"symbol\" or "
893 "\"venue:symbol\") or group on top of [strategy.params]; an instrument's own table wins over "
894 "its groups' (a strategy with a parameter set per instrument)"},
895 {
"strategy.overrides",
"*",
KeyType::Table,
false,
"the parameters of one instrument or group"},
896 {
"strategy.overrides.*",
"*",
KeyType::Any,
false,
"one strategy parameter"},
902 "name of the test, up to 32 letters, digits, '_', '-' or '.'; the store and journal record it "
903 "with every arm assignment"},
908 "instrument (each instrument stays in one arm, the arms balanced on weights) | time (every "
909 "instrument in the same arm, the arm changing each block) | crossover (instruments split as "
910 "with instrument, each one changing arm each block) | branch (a backtest only: one run per "
911 "arm over the same data and seed, every instrument in that arm from the start of trading)"},
916 "seed of the instrument split and of the order of the arms over the blocks (default 1)"},
921 "time, crossover: block length, s; blocks start at multiples of it since 1970-01-01 UTC, and "
922 "each run of as many blocks as there are arms gives every arm one, in an order drawn from "
924 "(required with time and crossover, refused with instrument)"},
929 "UTC time the test starts, YYYY-MM-DD, YYYY-MM-DDTHH:MM or YYYY-MM-DDTHH:MM:SSZ; before it "
930 "the configured parameters run (default: at the start of the session)"},
935 "UTC time the test ends, as start; after it the configured parameters run again (default: "
941 "[ab.weights] table: instrument, crossover: the weight of each instrument (\"venue:symbol\" "
942 "or \"symbol\" = number >= 0, e.g. its daily volume), every instrument or none; instruments "
943 "of similar weight go to different arms (default: equal weights)"},
944 {
"ab.weights",
"*",
KeyType::Float,
false,
"weight of one instrument"},
949 "[ab.assign] table: instrument, crossover: the arm of each instrument (\"venue:symbol\" or "
950 "\"symbol\" = arm name) instead of a drawn split; an instrument not listed stays out of the "
951 "test (default: drawn, balanced on weights)"},
957 "time, crossover: blocks start this many seconds after the multiples of block_s, 0 to "
958 "block_s - 1; with block_s = 86400, 79200 starts each day at 22:00 UTC (default 0)"},
963 "[[ab.arms]] tables, 2 to 16, in order: arm 0 is the control the readout compares the others "
965 {
"ab.arms[]",
"name",
KeyType::String,
true,
"arm name, up to 16 letters, digits, '_' or '-'"},
970 "[ab.arms.params] table: the arm's strategy parameters on top of [strategy.params] (default: "
971 "none, the configured values); the parameters the arms name, 32 at most, belong to the test "
973 {
"ab.arms[].params",
"*",
KeyType::Any,
false,
"one strategy parameter of the arm"},
975 {
"risk",
"max_order_qty",
KeyType::Any,
false,
"largest order quantity, decimal"},
977 "max_order_notional",
980 "largest order value, settlement currency (base coin for an inverse contract), decimal"},
985 "largest absolute position per instrument, counting same-side open orders, decimal"},
986 {
"risk",
"max_open_orders",
KeyType::Int,
false,
"open orders per instrument"},
991 "refuse limit prices further than this from the mid, bps"},
996 "refuse limit prices further than this from the last trade, bps"},
1001 "refuse orders when the instrument's book is older than this, ms"},
1006 "trip the kill switch when net PnL falls to -max_loss, settlement currency (the "
1007 "[accounting] reporting_currency when set), decimal; latched across restarts in kill_file"},
1012 "what max_loss is a budget for: total (every session since kill_file was cleared) | utc_day "
1013 "(net PnL from 00:00 UTC; a trip stays latched across the day) (default total)"},
1015 "max_gross_notional",
1018 "refuse an order that would take the portfolio's summed |position| at the last marks past "
1019 "this, settlement currency (or reporting_currency), decimal"},
1024 "refuse an order that would take the portfolio's signed position sum further past this, "
1025 "settlement currency (or reporting_currency), decimal"},
1026 {
"risk",
"orders_per_sec",
KeyType::Int,
false,
"token-bucket order rate, orders/s"},
1031 "token-bucket capacity, orders (default orders_per_sec)"},
1036 "self-trade prevention against our own resting orders (default true)"},
1041 "pull a venue's quotes and refuse orders that could rest there without reducing the "
1042 "position while its market data arrives this much later than its baseline, ms; resumes "
1043 "100 ms after the last message over it (default 0: off)"},
1045 "fill_cluster_names",
1048 "the fill-cluster guard: when maker fills of our quotes on one side cover this many distinct "
1049 "instruments within fill_cluster_window_ms, that side's quotes are pulled on every instrument "
1050 "for fill_cluster_hold_ms, then put back (0 to 16; default 0: off)"},
1052 "fill_cluster_window_ms",
1055 "the fill-cluster guard's window, ms (default 500)"},
1057 "fill_cluster_hold_ms",
1060 "how long the fill-cluster guard holds the side after the last fill that completed a cluster, "
1061 "ms (default 500)"},
1066 "[[risk.hazard]] tables, 16 at most: groups of instruments whose quotes on one side are "
1067 "pulled together when evidence that the side is being picked off reaches a threshold "
1069 {
"risk.hazard[]",
"name",
KeyType::String,
true,
"group name, for the log"},
1074 "the members: \"symbol\", \"venue:symbol\" or the name of a [strategy.groups] group; an "
1075 "instrument belongs to one hazard group at most"},
1080 "[risk.hazard.weights] \"symbol\" or \"venue:symbol\" = number: what a unit of notional on "
1081 "that member adds to the score (default 1 for each member)"},
1086 "the score that pulls a side, in quote notional times weight; the score is the sum of the "
1087 "evidence, each piece halving every half_life_ms"},
1092 "half-life of the score, ms (default 20)"},
1097 "how long the side stays pulled after the last evidence that found the score at the "
1098 "threshold, ms (default 500)"},
1103 "the sides the group scores and pulls: \"bid\", \"ask\" or \"both\" (default \"both\")"},
1108 "count a public print that reaches a quote of ours when it arrives before the fill's own "
1109 "report (default true)"},
1114 "\"pull\" cancels the side's quotes and holds it; \"log\" keeps the score and only logs "
1115 "what it would have pulled and the fills that arrived meanwhile (default \"pull\")"},
1120 "refuse an order the venue's reported balance, less this session's orders and fills since, "
1121 "cannot cover; off for a venue until it reports balances (default true)"},
1126 "start in reduce-only mode for every instrument: orders that would take a position further "
1127 "from zero are refused until fastmm-ctl reduce-only off (default false)"},
1132 "let fastmm-live trade with real keys without max_position (or max_order_notional) and "
1133 "max_loss; without it such a session refuses to start, exit code 3 (default false)"},
1138 "one [risk.underlying.BTC] table per base asset: a net position limit over every instrument "
1139 "and venue that trades it"},
1140 {
"risk.underlying.*",
1144 "refuse an order that would take the net position in this base asset, open orders on the "
1145 "order's side included, further past this; base units (contracts times contract_multiplier, "
1146 "inverse contracts at the mark), decimal; 0: tracked, no limit"},
1152 "fastmm-gateway: new orders and replaces per second per venue, over every attached strategy "
1153 "(default 0: off)"},
1158 "fastmm-gateway: token-bucket capacity of orders_per_sec, orders (default orders_per_sec)"},
1160 "max_open_notional",
1163 "fastmm-gateway: refuse an order that would take the notional working at its venue, over "
1164 "every attached strategy and both sides, past this; settlement currency, decimal"},
1169 "fastmm-gateway: trip the account's kill switch when the net PnL of every strategy together, "
1170 "carried across restarts in the gateway's kill file, reaches -max_loss; decimal, in "
1171 "[accounting] reporting_currency when set"},
1173 "max_gross_notional",
1176 "fastmm-gateway: refuse an order that would take the sum of the account's |position| at the "
1177 "marks past this, unless it only closes its instrument's position (an order through zero "
1178 "counts what it opens); decimal"},
1183 "fastmm-gateway: refuse an order that would take the account's net position at the marks "
1184 "further past this, unless it only closes its instrument's position (an order through zero "
1185 "counts what it opens); decimal"},
1190 "fastmm-gateway: one [gateway.underlying.BTC] table per base asset: the account's net limit, "
1191 "over every strategy and venue"},
1196 "fastmm-gateway: refuse an order the venue's reported balance, less the orders and fills of "
1197 "every attached strategy since, cannot cover (default true)"},
1198 {
"gateway.underlying.*",
1202 "fastmm-gateway: refuse an order that would take the account's net position in this base "
1203 "asset, working orders on the order's side included, further past this; base units, decimal"},
1208 "fastmm-gateway: one [gateway.shared.\"venue:symbol\"] table per instrument that several "
1209 "strategies may trade at once (default: one strategy per instrument)"},
1210 {
"gateway.shared.*",
1214 "fastmm-gateway: [engine] name of the strategy that books this instrument's events naming no "
1215 "order (funding, liquidation fills, executions of orders placed elsewhere); default none: "
1216 "the account alone books them"},
1222 "the window's name, 1 to 32 letters, digits, '_', '-' or '.', for the log and the status"},
1227 "the time zone of start, end and the dates: an IANA name (\"America/New_York\") of the "
1228 "tzdata compiled into the build, or a POSIX TZ rule (\"EST5EDT,M3.2.0,M11.1.0\")"},
1233 "the local weekdays an occurrence starts on: \"mon\" ... \"sun\"; give days or dates"},
1238 "the local dates an occurrence starts on, \"YYYY-MM-DD\"; give days or dates"},
1243 "local time the window opens, \"HH:MM\" or \"HH:MM:SS\"; a time the clock skips opens at the "
1244 "jump, one it shows twice opens at the first"},
1249 "local time it closes, \"HH:MM[:SS]\": the same day when later than start, otherwise the "
1250 "next; give end or duration"},
1255 "how long it stays open in wall-clock time, \"30m\", \"1h30m\", \"2d\" (units d, h, m, s), "
1256 "more than 0 and at most 7d; give end or duration"},
1261 "first local date an occurrence may start on, \"YYYY-MM-DD\" (default: no limit)"},
1266 "last local date an occurrence may start on, \"YYYY-MM-DD\" (default: no limit)"},
1271 "local dates no occurrence starts on, \"YYYY-MM-DD\" (default none)"},
1276 "\"pull\": no quotes in the scope while open, as fastmm-ctl pull; \"reduce_only\": orders "
1277 "that add to a position are refused, as fastmm-ctl reduce-only on (default \"pull\")"},
1282 "the scope: every instrument of these [venues.<name>] (default: with no instruments either, "
1283 "the whole session)"},
1288 "the scope: \"symbol\", \"venue:symbol\" or a [strategy.groups] name (default: with no venues "
1289 "either, the whole session)"},
1296 "off | observe (price every new order and move, count and record what it would refuse, "
1297 "refuse nothing) | new (refuse new orders below their price, observe moves) | enforce "
1298 "(refuse both) (default off)"},
1303 "the value of a quote level whose strategy states none: off (worth any price) | learned "
1304 "(notional x the filled per placed notional of its instrument, side and size class x "
1305 "margin_bps) (default off)"},
1310 "orders each account's window admits; the window's price rises as its share is used "
1311 "(Binance Spot 100) (default 0: the window is not priced)"},
1316 "the [venues.<name>] whose accounts are priced, with their pools' members; the others' "
1317 "orders are neither priced nor counted (default []: every venue)"},
1322 "the account window's length, ms; windows start at multiples of it since 1970-01-01 UTC "
1328 "an order's first fill gives its slot back to its window, as Binance's unfilled order count "
1329 "does (default false)"},
1334 "orders each account may send per UTC day; a day price keeps the day's demand within it "
1335 "(Binance Spot 200000) (default 0: no day price per account)"},
1340 "the strategy's orders per UTC day over every account; a day price keeps the day's demand "
1341 "within it (default 0: no budget)"},
1346 "request weight per minute shared by a pool's accounts (one IP); a new order, a replace and "
1347 "a cancel count 1 each (default 0: not priced)"},
1352 "what a filled unit of notional earns, rebate plus edge, bps; scales the learned values and "
1353 "the price floor (default 1)"},
1358 "a move towards the touch of this many bps is worth a whole new order when the strategy "
1359 "states no keep value; a smaller move buys that share of the level's value (default 10)"},
1361 "reporting_currency",
1364 "currency the PnL totals, [risk] max_loss and the exposure caps (and fastmm-gateway's) are in "
1365 "when instruments settle in more than one; every other settlement currency needs a source in "
1366 "[accounting.fx] (default unset: no conversion)"},
1371 "[accounting.fx] table: one entry per other settlement currency, the instrument whose mid "
1372 "prices it in reporting_currency (BTC = \"binance:BTCUSDT\"; a pair quoted the other way "
1373 "round, USDTBTC, is inverted)"},
1374 {
"accounting.fx",
"*",
KeyType::String,
false,
"FX source of one settlement currency"},
1379 "what a derivative's position is valued at for the unrealized PnL, max_loss and the "
1380 "exposure caps (fastmm-gateway's too): venue (its venue's mark price while it is fresh, else "
1381 "the book's mid) | mid (default venue)"},
1386 "a venue's mark or index price older than this is stale: ctx.mark and ctx.index flag it and "
1387 "the position is valued at the mid, ms (default 15000)"},
1392 "a venue's funding rate older than this is stale (ctx.funding flags it), ms (default "
1398 "an [accounting.fx] rate whose source's book has not updated for this long is not current: "
1399 "an order that adds exposure in that currency is refused; ms (default 60000; 0: a valid "
1400 "book is enough). Not [risk] stale_md_ms: a quiet FX book can go seconds without a change"},
1406 "trace | debug | info | warn (or warning) | error | off (default info)"},
1407 {
"logging",
"file",
KeyType::String,
false,
"log file; empty = stderr only"},
1412 "records at or above this level are also written to stderr (default warn)"},
1414 "status_interval_s",
1417 "seconds between the per-venue status lines, 0 = none (default 1 with a log file, 10 on "
1424 "fastmm-live starts fastmm-shadow from its own directory, which follows the session's journal "
1425 "in a process of its own (default false)"},
1430 "the program fastmm-live starts: an application's own fastmm::cli::shadow for its own "
1431 "strategies (default fastmm-shadow in fastmm-live's directory)"},
1436 "threads that step the points, at most 128 points each, plus one that reads the journal when "
1437 "there are two or more (default 1)"},
1442 "length of a comparison window, seconds: the error of the simulation and the variants' "
1443 "intervals are per window, and each window closes settle_s after its end (default 60)"},
1448 "how far behind the journal the simulation runs, seconds: what the journal says about a venue "
1449 "time (acks, fills, parameter updates) must arrive within this for the runs to equal a "
1450 "backtest of the finished journal; the report counts what came later (default 10)"},
1455 "behind the session by more than this and not catching up, the highest-numbered half of the "
1456 "variants stop, seconds; the live point never does; 0 = never (default 300)"},
1461 "a shadow fastmm-live started leaves when no session has written for this long, seconds "
1467 "CPU cores the process may use; empty = every core but [engine] cpu and net_cpus (default "
1469 {
"shadow",
"nice",
KeyType::Int,
false,
"the process's nice value (default 10)"},
1474 "the report, rewritten as each window closes (default \"<journal_dir>/<name>.shadow.json\"), "
1475 "and beside it one line per window (.jsonl)"},
1480 "the status file fastmm-top reads (default \"/dev/shm/fastmm-<name>.shadow\")"},
1485 "variants, the cartesian product of <key> = [values]: strategy parameters and the backtest "
1486 "settings a sweep can vary"},
1491 "more variants, [[shadow.points]] with one table of <key> = value each"},
1493 {
"sim",
"*",
KeyType::Any,
false,
"simulator settings"},
1494 {
"sim.*",
"*",
KeyType::Any,
false,
"simulator sub-tables"},
1495 {
"backtest",
"*",
KeyType::Any,
false,
"backtester settings"},
1496 {
"backtest.*",
"*",
KeyType::Any,
false,
"backtester sub-tables"},
1499[[nodiscard]]
inline std::span<const KeySpec>
config_schema() noexcept {
Definition strategy.hpp:23
constexpr KeySpec kConfigSchema[]
Definition schema.hpp:32
std::span< const KeySpec > config_schema() noexcept
Definition schema.hpp:1501
KeyType
Definition schema.hpp:22
std::string_view key
Definition schema.hpp:26
std::string_view doc
Definition schema.hpp:29
KeyType type
Definition schema.hpp:27
std::string_view section
"engine", "venues.*", "instruments[]", "strategy", ...
Definition schema.hpp:25
bool required
Definition schema.hpp:28