exchange
Low-latency exchange in C++
Loading...
Searching...
No Matches
exchange::server::OrderbookPublisher Class Reference

#include <orderbook_publisher.hpp>

Public Member Functions

 OrderbookPublisher (ActionSpmcReceiver &&actionReceiver)
void loop ()
void processAction (const Action &action)
L1Data getL1Data (SecurityId securityId) const
L2Data getL2Data (SecurityId securityId, uint8_t numberOfLevels) const

Constructor & Destructor Documentation

◆ OrderbookPublisher()

exchange::server::OrderbookPublisher::OrderbookPublisher ( ActionSpmcReceiver && actionReceiver)
explicit

Member Function Documentation

◆ getL1Data()

L1Data exchange::server::OrderbookPublisher::getL1Data ( SecurityId securityId) const
nodiscard

Compute the L1 data for a given security.

Parameters
securityIdThe security for which to compute the L1 data.
Returns
The L1 data of that security's orderbook, consisting of best buy/sell price and quantity, as well as the price and quantity of the most recent trade.

◆ getL2Data()

L2Data exchange::server::OrderbookPublisher::getL2Data ( SecurityId securityId,
uint8_t numberOfLevels ) const
nodiscard

Compute the L2 data for a given security, with a given number of levels.

Parameters
securityIdThe security for which to compute the L2 data.
numberOfLevelsThe number of levels (price, quantity pairs) to compute for each of the buy and sell books. At most 10 (guaranteed by the gateway).
Returns
The L2 data, which contains the price and quantity pairs for the best numberOfLevels levels.

◆ loop()

void exchange::server::OrderbookPublisher::loop ( )

Perform one iteration of the orderbook publisher's workflow, which consumes one action from the SPMC queue and updates its internal state.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processAction()

void exchange::server::OrderbookPublisher::processAction ( const Action & action)

Update the internal orderbook of the publisher based on an update from the matching engine.

Parameters
actionThe modification to the orderbook state, coming from the SPMC queue.
Here is the caller graph for this function:

The documentation for this class was generated from the following files: