FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
venue_health.hpp File Reference

VenueHealth: per venue, how late its market data arrives and how long our orders take to be acknowledged, from the events the engine consumes (engine thread only). More...

#include "fastmm/core/config_macros.hpp"
#include "fastmm/core/strong_id.hpp"
#include "fastmm/core/time.hpp"
#include <array>
#include <cstddef>
#include <cstdint>
#include <limits>

Go to the source code of this file.

Classes

struct  fastmm::VenueHealthView
 What StrategyContext::venue_health returns. Durations are zero until the first sample. More...
 
class  fastmm::VenueHealth
 

Namespaces

namespace  fastmm
 

Detailed Description

VenueHealth: per venue, how late its market data arrives and how long our orders take to be acknowledged, from the events the engine consumes (engine thread only).

feed lag recv_ts - exch_ts of every market-data message that carries a venue time (book deltas, trades, tickers; snapshots excluded). The host and the venue clocks differ by a constant offset, so the lag is compared with its baseline: the minimum over the last kWindow (kBuckets buckets of kBucket, rolled on the engine clock). ack RTT engine time from sending a new order to consuming its first ack, last and smoothed (srtt += (rtt - srtt) / 8, as TCP's SRTT).

Every input is in the journal (the message headers and the engine clock), so a replay computes the same values. The feed-lag gate ([risk] max_feed_lag_ms) holds a venue for kGateHold after the last message whose excess lag was over the limit.