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

#include <fastmm/store/reader.hpp>

Public Member Functions

 Reader ()=default
 
virtual ~Reader ()=default
 
 Reader (const Reader &)=delete
 
Reader & operator= (const Reader &)=delete
 
virtual Result< void, std::string > open (const BackendOptions &opts)=0
 
virtual Result< Rows, std::string > sessions (const QueryFilter &f)=0
 One row per session: id, engine, strategy, start, stop, PnL, fills, exit.
 
virtual Result< Rows, std::string > fills (const QueryFilter &f)=0
 One row per execution.
 
virtual Result< Rows, std::string > orders (const QueryFilter &f)=0
 One row per order, in its last known state.
 
virtual Result< Rows, std::string > pnl (const QueryFilter &f)=0
 One row per UTC day and instrument: realised, fees, unrealised, position, settlement currency.
 
virtual Result< Rows, std::string > funding (const QueryFilter &)
 One row per funding payment. The default has none (a backend without the table).
 
virtual Result< Rows, std::string > duplicates (const QueryFilter &)
 One row per venue execution or funding payment stored more than once (by venue, symbol and the venue's id of it, within an engine): what a restart booked a second time.
 
virtual Result< Rows, std::string > ledger (const QueryFilter &, bool)
 The economic fill ledger: one row per execution (the venue's id of it on an account, symbol and side, within an engine) however many sessions stored it, as the first one did, with when it was first received, the venue's time, the quantity the position took (booked), how many copies there are and its flags (synthetic: booked from a cum_qty jump, no venue report; late: for an order already ended; before_start: traded before the session that booked it started, so it came in through the restart's replay; repeated: stored more than once).
 
virtual Result< Rows, std::string > order_timeline (const QueryFilter &)
 Everything stored about one client order (f.order), in time order: sent, each refusal, each execution, and its last known state.
 
virtual Result< std::vector< AuditFill >, std::string > booked_fills (const BookedFillQuery &)
 The executions stored for q.venue, of every session of q.engine, by the venue's time of the trade: the venue's trade id, order ids, side, price, quantity and the commission as reported (AuditFill::fee_asset: quote, base or other).
 
virtual Result< Rows, std::string > positions (const QueryFilter &f)=0
 The last position snapshot per session and instrument.
 
virtual Result< Rows, std::string > params (const ParamQuery &)
 The strategy parameters in effect at q.at_ns (0: the session's last update) in the session q.session_id, else the newest of q.engine that started by then: one row per parameter and scope (every instrument, or one that has its own value), with when it was set, its origin (initial, control, strategy) and source.
 
virtual Result< Rows, std::string > param_changes (const QueryFilter &)
 Every parameter update, one row per value it carried, in order: the starting set (origin initial) and each update the engine applied.
 
virtual Result< Rows, std::string > param_diff (std::uint64_t, std::uint64_t)
 The parameters session a ended with against those session b started with: one row per parameter and scope that differs.
 
virtual Result< Rows, std::string > rejects (const QueryFilter &)
 One row per refused order the engine recorded (count with the ones folded into it): when, which account, instrument and side, whether it only reduced the position, the reason, the limit or side that refused it (source) and the account's budget then.
 
virtual Result< Rows, std::string > reject_summary (const QueryFilter &)
 The same summed: one row per account, instrument, side, reduces, reason and source.
 
virtual Result< std::string, std::string > session_config (const ParamQuery &)
 The effective configuration (TOML, secrets omitted) of the session q picks as params() does.
 
virtual Result< Recovery, std::string > recovery (const QueryFilter &f)=0
 The newest session of f.engine, summarised.
 

Constructor & Destructor Documentation

◆ Reader() [1/2]

fastmm::store::Reader::Reader ( )
default

◆ ~Reader()

virtual fastmm::store::Reader::~Reader ( )
virtualdefault

◆ Reader() [2/2]

fastmm::store::Reader::Reader ( const Reader &  )
delete

Member Function Documentation

◆ operator=()

Reader & fastmm::store::Reader::operator= ( const Reader &  )
delete

◆ open()

virtual Result< void, std::string > fastmm::store::Reader::open ( const BackendOptions &  opts)
pure virtual

◆ sessions()

virtual Result< Rows, std::string > fastmm::store::Reader::sessions ( const QueryFilter &  f)
pure virtual

One row per session: id, engine, strategy, start, stop, PnL, fills, exit.

◆ fills()

virtual Result< Rows, std::string > fastmm::store::Reader::fills ( const QueryFilter &  f)
pure virtual

One row per execution.

◆ orders()

virtual Result< Rows, std::string > fastmm::store::Reader::orders ( const QueryFilter &  f)
pure virtual

One row per order, in its last known state.

◆ pnl()

virtual Result< Rows, std::string > fastmm::store::Reader::pnl ( const QueryFilter &  f)
pure virtual

One row per UTC day and instrument: realised, fees, unrealised, position, settlement currency.

◆ funding()

virtual Result< Rows, std::string > fastmm::store::Reader::funding ( const QueryFilter &  )
inlinevirtual

One row per funding payment. The default has none (a backend without the table).

◆ duplicates()

virtual Result< Rows, std::string > fastmm::store::Reader::duplicates ( const QueryFilter &  )
inlinevirtual

One row per venue execution or funding payment stored more than once (by venue, symbol and the venue's id of it, within an engine): what a restart booked a second time.

Empty in a sound store; the default has none. Filtered by engine and instrument.

◆ ledger()

virtual Result< Rows, std::string > fastmm::store::Reader::ledger ( const QueryFilter &  ,
bool   
)
inlinevirtual

The economic fill ledger: one row per execution (the venue's id of it on an account, symbol and side, within an engine) however many sessions stored it, as the first one did, with when it was first received, the venue's time, the quantity the position took (booked), how many copies there are and its flags (synthetic: booked from a cum_qty jump, no venue report; late: for an order already ended; before_start: traded before the session that booked it started, so it came in through the restart's replay; repeated: stored more than once).

raw lists every stored row instead, with its copy number. A session filter keeps the executions it booked first (raw: its rows). The default cannot answer.

◆ order_timeline()

virtual Result< Rows, std::string > fastmm::store::Reader::order_timeline ( const QueryFilter &  )
inlinevirtual

Everything stored about one client order (f.order), in time order: sent, each refusal, each execution, and its last known state.

The default cannot answer.

◆ booked_fills()

virtual Result< std::vector< AuditFill >, std::string > fastmm::store::Reader::booked_fills ( const BookedFillQuery &  )
inlinevirtual

The executions stored for q.venue, of every session of q.engine, by the venue's time of the trade: the venue's trade id, order ids, side, price, quantity and the commission as reported (AuditFill::fee_asset: quote, base or other).

Estimates (no trade id) are left out. Needs the venue's names and times (schema 3); the default cannot answer.

◆ positions()

virtual Result< Rows, std::string > fastmm::store::Reader::positions ( const QueryFilter &  f)
pure virtual

The last position snapshot per session and instrument.

◆ params()

virtual Result< Rows, std::string > fastmm::store::Reader::params ( const ParamQuery &  )
inlinevirtual

The strategy parameters in effect at q.at_ns (0: the session's last update) in the session q.session_id, else the newest of q.engine that started by then: one row per parameter and scope (every instrument, or one that has its own value), with when it was set, its origin (initial, control, strategy) and source.

Needs schema 8; the default cannot answer.

◆ param_changes()

virtual Result< Rows, std::string > fastmm::store::Reader::param_changes ( const QueryFilter &  )
inlinevirtual

Every parameter update, one row per value it carried, in order: the starting set (origin initial) and each update the engine applied.

Filtered by engine, session, day and instrument.

◆ param_diff()

virtual Result< Rows, std::string > fastmm::store::Reader::param_diff ( std::uint64_t  ,
std::uint64_t   
)
inlinevirtual

The parameters session a ended with against those session b started with: one row per parameter and scope that differs.

a 0: the session of b's engine that started last before b (what a restart changed).

◆ rejects()

virtual Result< Rows, std::string > fastmm::store::Reader::rejects ( const QueryFilter &  )
inlinevirtual

One row per refused order the engine recorded (count with the ones folded into it): when, which account, instrument and side, whether it only reduced the position, the reason, the limit or side that refused it (source) and the account's budget then.

Filtered by engine, session, day and instrument. Needs schema 9.

◆ reject_summary()

virtual Result< Rows, std::string > fastmm::store::Reader::reject_summary ( const QueryFilter &  )
inlinevirtual

The same summed: one row per account, instrument, side, reduces, reason and source.

◆ session_config()

virtual Result< std::string, std::string > fastmm::store::Reader::session_config ( const ParamQuery &  )
inlinevirtual

The effective configuration (TOML, secrets omitted) of the session q picks as params() does.

◆ recovery()

virtual Result< Recovery, std::string > fastmm::store::Reader::recovery ( const QueryFilter &  f)
pure virtual

The newest session of f.engine, summarised.