Slick OrderBook 1.1.0
High-Performance C++23 OrderBook Library
Loading...
Searching...
No Matches
slick::orderbook Namespace Reference

Namespaces

namespace  detail
 

Classes

class  IOrderBookObserver
 Base interface for orderbook observers Observers receive callbacks for orderbook events. More...
 
class  ObserverManager
 Observer manager for notifying multiple observers Uses type erasure to support both concept-based and inheritance-based observers. More...
 
class  OrderBookL2
 Level 2 OrderBook - aggregated price levels. More...
 
class  OrderBookL3
 Level 3 OrderBook - Individual order tracking with price-time priority. More...
 
class  OrderBookManager
 Multi-symbol OrderBook Manager. More...
 
struct  OrderUpdate
 Level 3 order update event Note: quantity = 0 implies the order should be deleted. More...
 
struct  PriceLevelUpdate
 Level 2 price level update event Note: quantity = 0 implies the price level should be deleted. More...
 
struct  Symbol
 Symbol information. More...
 
struct  TopOfBook
 Top-of-book snapshot - best bid and ask. More...
 
struct  Trade
 Trade event - represents an executed trade. More...
 

Concepts

concept  OrderBookObserver
 Concept for orderbook observers Observers must implement all four callback methods.
 
concept  PriceLike
 Concept for price-like types.
 
concept  QuantityLike
 Concept for quantity-like types.
 
concept  TimestampLike
 Concept for timestamp-like types.
 
concept  Reservable
 Concept for container that supports reserve()
 
concept  AllocatorLike
 Concept for allocator-like types.
 

Typedefs

using Price = int64_t
 Price type - fixed-point representation Example: For 4 decimal places, price = actual_price * 10000 This allows integer arithmetic while maintaining decimal precision.
 
using Quantity = int64_t
 Quantity type - volume or size.
 
using OrderId = uint64_t
 Unique order identifier.
 
using SymbolId = uint16_t
 Symbol identifier - can be hash or sequential ID.
 
using Timestamp = uint64_t
 Timestamp in nanoseconds since epoch.
 

Enumerations

enum  ChangeFlag : uint8_t { PriceChanged = 0x01 , QuantityChanged = 0x02 , LastInBatch = 0x04 }
 Change flags for price level and order updates (regular enum for bitwise operations) More...
 
enum  Side : uint8_t { Buy = 0 , Sell = 1 , SideCount = 2 }
 Order side - using enum for easy array indexing. More...
 
enum class  OrderType : uint8_t { Limit , Market , Stop , StopLimit }
 Order type. More...
 

Functions

template<>
const detail::PriceLevelL3 * OrderBookL3::getBestLevel< Side::Buy > () const noexcept
 
template<>
const detail::PriceLevelL3 * OrderBookL3::getBestLevel< Side::Sell > () const noexcept
 
constexpr const char * toString (Side side) noexcept
 Helper functions for Side enum.
 
constexpr Side opposite (Side side) noexcept
 
constexpr const char * toString (OrderType type) noexcept
 Helper functions for OrderType enum.
 

Variables

constexpr uint16_t INVALID_INDEX = std::numeric_limits<uint16_t>::max()
 

Typedef Documentation

◆ OrderId

using slick::orderbook::OrderId = typedef uint64_t

Unique order identifier.

Definition at line 24 of file types.hpp.

◆ Price

using slick::orderbook::Price = typedef int64_t

Price type - fixed-point representation Example: For 4 decimal places, price = actual_price * 10000 This allows integer arithmetic while maintaining decimal precision.

Definition at line 18 of file types.hpp.

◆ Quantity

using slick::orderbook::Quantity = typedef int64_t

Quantity type - volume or size.

Definition at line 21 of file types.hpp.

◆ SymbolId

using slick::orderbook::SymbolId = typedef uint16_t

Symbol identifier - can be hash or sequential ID.

Definition at line 27 of file types.hpp.

◆ Timestamp

using slick::orderbook::Timestamp = typedef uint64_t

Timestamp in nanoseconds since epoch.

Definition at line 30 of file types.hpp.

Enumeration Type Documentation

◆ ChangeFlag

Change flags for price level and order updates (regular enum for bitwise operations)

Enumerator
PriceChanged 
QuantityChanged 
LastInBatch 

Definition at line 13 of file events.hpp.

◆ OrderType

enum class slick::orderbook::OrderType : uint8_t
strong

Order type.

Enumerator
Limit 
Market 
Stop 
StopLimit 

Definition at line 42 of file types.hpp.

◆ Side

enum slick::orderbook::Side : uint8_t

Order side - using enum for easy array indexing.

Enumerator
Buy 
Sell 
SideCount 

Definition at line 35 of file types.hpp.

Function Documentation

◆ opposite()

constexpr Side slick::orderbook::opposite ( Side  side)
constexprnoexcept

Definition at line 77 of file types.hpp.

References Buy, opposite(), and Sell.

Referenced by opposite().

◆ OrderBookL3::getBestLevel< Side::Buy >()

template<>
const detail::PriceLevelL3 * slick::orderbook::OrderBookL3::getBestLevel< Side::Buy > ( ) const
inlinenoexcept

Definition at line 340 of file orderbook_l3.hpp.

◆ OrderBookL3::getBestLevel< Side::Sell >()

template<>
const detail::PriceLevelL3 * slick::orderbook::OrderBookL3::getBestLevel< Side::Sell > ( ) const
inlinenoexcept

Definition at line 345 of file orderbook_l3.hpp.

◆ toString() [1/2]

constexpr const char * slick::orderbook::toString ( OrderType  type)
constexprnoexcept

Helper functions for OrderType enum.

Definition at line 83 of file types.hpp.

References toString().

◆ toString() [2/2]

constexpr const char * slick::orderbook::toString ( Side  side)
constexprnoexcept

Helper functions for Side enum.

Definition at line 69 of file types.hpp.

References Buy, Sell, and toString().

Referenced by toString(), and toString().

Variable Documentation

◆ INVALID_INDEX