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

#include <fastmm/config/config.hpp>

Public Types

using LoadOptions = ConfigLoadOptions
 

Public Member Functions

const VenueSection * venue (std::string_view name) const noexcept
 
VenueId venue_id (std::string_view name) const noexcept
 invalid if unknown
 
PoolPlan pool_plan () const noexcept
 The account pools ([venues.<x>] pool_of), by venue id; inactive without any.
 
TreasuryConfig treasury_config (std::string_view primary) const
 The treasury of the pool whose primary is primary ([venues.
 
RiskLimits risk_limits () const
 Typed views used to wire the engine.
 
QuoteParams quote_params () const
 
LogLevel log_level () const
 
LogLevel mirror_level () const
 
std::int64_t status_interval_s (bool to_file) const noexcept
 to_file: the log goes to a file (--log or [logging] file), where the default is 1 s.
 
SpinMode spin_mode () const
 
bool single_threaded () const noexcept
 
std::string redacted () const
 Dump with api_key/api_secret/api_passphrase masked; safe to log.
 
std::string effective_toml () const
 The configuration as parsed (after any changes made to this object, e.g.
 
std::uint64_t effective_hash () const
 

Static Public Member Functions

static Config load (const std::string &path, const LoadOptions &opts=LoadOptions{})
 
static Config parse (std::string_view toml, const LoadOptions &opts=LoadOptions{}, std::string_view source_name="<string>")
 
static std::uint64_t text_hash (std::string_view text) noexcept
 FNV-1a.
 

Public Attributes

EngineSection engine
 
std::vector< VenueSection > venues
 VenueId == index.
 
std::vector< InstrumentSection > instruments
 
StrategySection strategy
 
RiskSection risk
 
GatewaySection gateway
 
AccountingSpec accounting
 [accounting]: the reporting currency and the FX source of each other settlement currency, read by fastmm-live, fastmm-gateway, the backtester and replay (build_fx_plan, core/fx.hpp).
 
LoggingSection logging
 
GenericSection sim
 
GenericSection backtest
 
GenericSection storage
 [storage]: the backend name and whatever keys that backend reads.
 
std::vector< std::string > warnings
 
std::string source
 path or "\<string\>"
 
std::uint64_t hash = 0
 FNV-1a of the raw text.
 

Member Typedef Documentation

◆ LoadOptions

Member Function Documentation

◆ load()

static Config fastmm::Config::load ( const std::string &  path,
const LoadOptions &  opts = LoadOptions{} 
)
static

◆ parse()

static Config fastmm::Config::parse ( std::string_view  toml,
const LoadOptions &  opts = LoadOptions{},
std::string_view  source_name = "<string>" 
)
static

◆ venue()

const VenueSection * fastmm::Config::venue ( std::string_view  name) const
noexcept

◆ venue_id()

VenueId fastmm::Config::venue_id ( std::string_view  name) const
noexcept

invalid if unknown

◆ pool_plan()

PoolPlan fastmm::Config::pool_plan ( ) const
noexcept

The account pools ([venues.<x>] pool_of), by venue id; inactive without any.

◆ treasury_config()

TreasuryConfig fastmm::Config::treasury_config ( std::string_view  primary) const

The treasury of the pool whose primary is primary ([venues.

<primary>.treasury]), typed; a disabled one when the venue has none.

◆ risk_limits()

RiskLimits fastmm::Config::risk_limits ( ) const

Typed views used to wire the engine.

◆ quote_params()

QuoteParams fastmm::Config::quote_params ( ) const

◆ log_level()

LogLevel fastmm::Config::log_level ( ) const

◆ mirror_level()

LogLevel fastmm::Config::mirror_level ( ) const

◆ status_interval_s()

std::int64_t fastmm::Config::status_interval_s ( bool  to_file) const
inlinenoexcept

to_file: the log goes to a file (--log or [logging] file), where the default is 1 s.

◆ spin_mode()

SpinMode fastmm::Config::spin_mode ( ) const

◆ single_threaded()

bool fastmm::Config::single_threaded ( ) const
inlinenoexcept

◆ redacted()

std::string fastmm::Config::redacted ( ) const

Dump with api_key/api_secret/api_passphrase masked; safe to log.

◆ effective_toml()

std::string fastmm::Config::effective_toml ( ) const

The configuration as parsed (after any changes made to this object, e.g.

command-line overrides) as complete TOML without api_key / api_secret / api_passphrase. Deterministic: equal configurations give equal text, and parsing the text gives an equal configuration. Journals embed it, and its hash is the journal header's config_hash.

◆ effective_hash()

std::uint64_t fastmm::Config::effective_hash ( ) const
inline

◆ text_hash()

static std::uint64_t fastmm::Config::text_hash ( std::string_view  text)
staticnoexcept

FNV-1a.

Member Data Documentation

◆ engine

EngineSection fastmm::Config::engine

◆ venues

std::vector<VenueSection> fastmm::Config::venues

VenueId == index.

◆ instruments

std::vector<InstrumentSection> fastmm::Config::instruments

◆ strategy

StrategySection fastmm::Config::strategy

◆ risk

RiskSection fastmm::Config::risk

◆ gateway

GatewaySection fastmm::Config::gateway

◆ accounting

AccountingSpec fastmm::Config::accounting

[accounting]: the reporting currency and the FX source of each other settlement currency, read by fastmm-live, fastmm-gateway, the backtester and replay (build_fx_plan, core/fx.hpp).

◆ logging

LoggingSection fastmm::Config::logging

◆ sim

GenericSection fastmm::Config::sim

◆ backtest

GenericSection fastmm::Config::backtest

◆ storage

GenericSection fastmm::Config::storage

[storage]: the backend name and whatever keys that backend reads.

Free-form, like [sim] and [backtest]: a storage backend parses its own keys and the central schema knows none of them (docs/reference/storage.md).

◆ warnings

std::vector<std::string> fastmm::Config::warnings

◆ source

std::string fastmm::Config::source

path or "\<string\>"

◆ hash

std::uint64_t fastmm::Config::hash = 0

FNV-1a of the raw text.