Full Code of roq-trading/roq-api for AI

master c24b86492980 cached
284 files
299.9 KB
83.0k tokens
808 symbols
1 requests
Download .txt
Showing preview only (355K chars total). Download the full file or copy to clipboard to get everything.
Repository: roq-trading/roq-api
Branch: master
Commit: c24b86492980
Files: 284
Total size: 299.9 KB

Directory structure:
gitextract_kyd8hy5r/

├── .clang-format
├── .clang-tidy
├── .cmake-format.yaml
├── .gitattributes
├── .gitignore
├── .gitmodules
├── CHANGELOG.md
├── CMakeLists.txt
├── LICENSE
├── README.md
├── conda/
│   ├── bld.bat
│   └── meta.yaml
├── doxygen/
│   ├── .gitignore
│   ├── CMakeLists.txt
│   └── Doxyfile.in
├── include/
│   └── roq/
│       ├── CMakeLists.txt
│       ├── action.hpp
│       ├── add_market.hpp
│       ├── add_routes.hpp
│       ├── api.hpp
│       ├── api.hpp.in
│       ├── args/
│       │   └── parser.hpp
│       ├── bar.hpp
│       ├── batch_begin.hpp
│       ├── batch_end.hpp
│       ├── buffer_capacity.hpp
│       ├── cancel_all_orders.hpp
│       ├── cancel_all_orders_ack.hpp
│       ├── cancel_order.hpp
│       ├── cancel_quotes.hpp
│       ├── cancel_quotes_ack.hpp
│       ├── category.hpp
│       ├── client/
│       │   └── custom_message.hpp
│       ├── clock.hpp
│       ├── compat.hpp
│       ├── connected.hpp
│       ├── connection_status.hpp
│       ├── control.hpp
│       ├── control_ack.hpp
│       ├── create_order.hpp
│       ├── custom_matrix.hpp
│       ├── custom_matrix_update.hpp
│       ├── custom_metrics.hpp
│       ├── custom_metrics_update.hpp
│       ├── data_source.hpp
│       ├── decimal.hpp
│       ├── disconnected.hpp
│       ├── download_begin.hpp
│       ├── download_end.hpp
│       ├── encoding.hpp
│       ├── error.hpp
│       ├── event.hpp
│       ├── exceptions.hpp
│       ├── execution_instruction.hpp
│       ├── external_latency.hpp
│       ├── fill.hpp
│       ├── filter.hpp
│       ├── format_str.hpp
│       ├── funds_update.hpp
│       ├── gateway_settings.hpp
│       ├── gateway_status.hpp
│       ├── interval.hpp
│       ├── layer.hpp
│       ├── leg.hpp
│       ├── legs_update.hpp
│       ├── limits.hpp
│       ├── liquidity.hpp
│       ├── map.hpp
│       ├── margin_mode.hpp
│       ├── market_by_order_update.hpp
│       ├── market_by_price_update.hpp
│       ├── market_status.hpp
│       ├── mask.hpp
│       ├── mass_quote.hpp
│       ├── mass_quote_ack.hpp
│       ├── mbo_update.hpp
│       ├── mbp_update.hpp
│       ├── measurement.hpp
│       ├── message_info.hpp
│       ├── modify_order.hpp
│       ├── name.hpp
│       ├── option_type.hpp
│       ├── order_ack.hpp
│       ├── order_cancel_policy.hpp
│       ├── order_management.hpp
│       ├── order_status.hpp
│       ├── order_type.hpp
│       ├── order_update.hpp
│       ├── origin.hpp
│       ├── parameter.hpp
│       ├── parameters_update.hpp
│       ├── portfolio.hpp
│       ├── portfolio_update.hpp
│       ├── position.hpp
│       ├── position_effect.hpp
│       ├── position_update.hpp
│       ├── precision.hpp
│       ├── precision_2.hpp
│       ├── priority.hpp
│       ├── protocol.hpp
│       ├── quality_of_service.hpp
│       ├── quantity_type.hpp
│       ├── quote.hpp
│       ├── rate_limit.hpp
│       ├── rate_limit_trigger.hpp
│       ├── rate_limit_type.hpp
│       ├── rate_limits_update.hpp
│       ├── ready.hpp
│       ├── reference_data.hpp
│       ├── remove_routes.hpp
│       ├── request_id_type.hpp
│       ├── request_status.hpp
│       ├── request_type.hpp
│       ├── risk_limit.hpp
│       ├── risk_limits.hpp
│       ├── risk_limits_update.hpp
│       ├── route.hpp
│       ├── route_ack.hpp
│       ├── route_request_status.hpp
│       ├── routing.hpp
│       ├── security_type.hpp
│       ├── service_update.hpp
│       ├── side.hpp
│       ├── start.hpp
│       ├── state.hpp
│       ├── statistics.hpp
│       ├── statistics_type.hpp
│       ├── statistics_update.hpp
│       ├── stop.hpp
│       ├── strategy_update.hpp
│       ├── stream_status.hpp
│       ├── string.hpp
│       ├── string_types.hpp
│       ├── subscribe.hpp
│       ├── support_type.hpp
│       ├── tick_size_step.hpp
│       ├── time_in_force.hpp
│       ├── time_series_update.hpp
│       ├── timer.hpp
│       ├── top_of_book.hpp
│       ├── trace.hpp
│       ├── trace_info.hpp
│       ├── trade.hpp
│       ├── trade_summary.hpp
│       ├── trade_update.hpp
│       ├── trading_status.hpp
│       ├── transport.hpp
│       ├── update_action.hpp
│       ├── update_reason.hpp
│       ├── update_type.hpp
│       ├── uuid.hpp
│       ├── variant_type.hpp
│       └── version.hpp
├── schema/
│   └── roq/
│       ├── CMakeLists.txt
│       ├── action.json
│       ├── add_market.json
│       ├── add_routes.json
│       ├── bar.json
│       ├── batch_begin.json
│       ├── batch_end.json
│       ├── buffer_capacity.json
│       ├── cancel_all_orders.json
│       ├── cancel_all_orders_ack.json
│       ├── cancel_order.json
│       ├── cancel_quotes.json
│       ├── cancel_quotes_ack.json
│       ├── category.json
│       ├── connected.json
│       ├── connection_status.json
│       ├── control.json
│       ├── control_ack.json
│       ├── create_order.json
│       ├── custom_matrix.json
│       ├── custom_matrix_update.json
│       ├── custom_metrics.json
│       ├── custom_metrics_update.json
│       ├── data_source.json
│       ├── disconnected.json
│       ├── download_begin.json
│       ├── download_end.json
│       ├── encoding.json
│       ├── error.json
│       ├── execution_instruction.json
│       ├── external_latency.json
│       ├── fill.json
│       ├── filter.json
│       ├── funds_update.json
│       ├── gateway_settings.json
│       ├── gateway_status.json
│       ├── interval.json
│       ├── layer.json
│       ├── leg.json
│       ├── legs_update.json
│       ├── liquidity.json
│       ├── margin_mode.json
│       ├── market_by_order_update.json
│       ├── market_by_price_update.json
│       ├── market_status.json
│       ├── mass_quote.json
│       ├── mass_quote_ack.json
│       ├── mbo_update.json
│       ├── mbp_update.json
│       ├── measurement.json
│       ├── message_info.json
│       ├── modify_order.json
│       ├── option_type.json
│       ├── order_ack.json
│       ├── order_cancel_policy.json
│       ├── order_management.json
│       ├── order_status.json
│       ├── order_type.json
│       ├── order_update.json
│       ├── origin.json
│       ├── parameter.json
│       ├── parameters_update.json
│       ├── portfolio.json
│       ├── portfolio_update.json
│       ├── position.json
│       ├── position_effect.json
│       ├── position_update.json
│       ├── precision.json
│       ├── priority.json
│       ├── protocol.json
│       ├── quality_of_service.json
│       ├── quantity_type.json
│       ├── quote.json
│       ├── rate_limit.json
│       ├── rate_limit_trigger.json
│       ├── rate_limit_type.json
│       ├── rate_limits_update.json
│       ├── ready.json
│       ├── reference_data.json
│       ├── remove_routes.json
│       ├── request_id_type.json
│       ├── request_status.json
│       ├── request_type.json
│       ├── risk_limit.json
│       ├── risk_limits.json
│       ├── risk_limits_update.json
│       ├── route.json
│       ├── route_ack.json
│       ├── route_request_status.json
│       ├── routing.json
│       ├── security_type.json
│       ├── service_update.json
│       ├── side.json
│       ├── start.json
│       ├── state.json
│       ├── statistics.json
│       ├── statistics_type.json
│       ├── statistics_update.json
│       ├── stop.json
│       ├── strategy_update.json
│       ├── stream_status.json
│       ├── subscribe.json
│       ├── support_type.json
│       ├── tick_size_step.json
│       ├── time_in_force.json
│       ├── time_series_update.json
│       ├── timer.json
│       ├── top_of_book.json
│       ├── trade.json
│       ├── trade_summary.json
│       ├── trade_update.json
│       ├── trading_status.json
│       ├── transport.json
│       ├── update_action.json
│       ├── update_reason.json
│       ├── update_type.json
│       └── variant_type.json
└── test/
    ├── .clang-tidy
    ├── .gitignore
    ├── CMakeLists.txt
    ├── alignment.cpp
    ├── compat.cpp
    ├── exceptions.cpp
    ├── format.cpp
    ├── main.cpp
    ├── mask.cpp
    ├── side.cpp
    ├── span.cpp
    ├── string.cpp
    ├── support_type.cpp
    └── version.cpp

================================================
FILE CONTENTS
================================================

================================================
FILE: .clang-format
================================================
---
BasedOnStyle: Google
AlignAfterOpenBracket: AlwaysBreak
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Attach
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ColumnLimit: 160
ConstructorInitializerAllOnOneLineOrOnePerLine: false
DerivePointerAlignment: false
ExperimentalAutoDetectBinPacking: false
IncludeBlocks: Preserve
IndentCaseLabels: true
InsertBraces: true
PointerAlignment: Right
QualifierAlignment: Right
Standard: c++20  # note! clang20 does not support c++23


================================================
FILE: .clang-tidy
================================================
---
Checks: bugprone-*, modernize-*, performance-*, readability-*, -bugprone-branch-clone,
  -bugprone-easily-swappable-parameters, -bugprone-inc-dec-in-conditions, -bugprone-macro-parentheses,
  -bugprone-switch-missing-default-case, -clang-analyzer-optin.performance.Padding,
  -clang-diagnostic-unused-command-line-argument, -modernize-concat-nested-namespaces,
  -modernize-use-nodiscard, -modernize-use-trailing-return-type, -performance-enum-size,
  -performance-move-const-arg, -readability-duplicate-include, -readability-convert-member-functions-to-static,
  -readability-enum-initial-value, -readability-isolate-declaration, -readability-named-parameter,
  -readability-qualified-auto, -readability-redundant-member-init, -readability-uppercase-literal-suffix,
CheckOptions:
  - key: readability-magic-numbers.IgnoredIntegerValues
    value: 1;2;3;4;5;10;100;1000;10000;100000;1000000
  - key: readability-magic-numbers.IgnorePowersOf2IntegerValues
    value: 'true'
  - key: readability-magic-numbers.IgnoreAllFloatingPointValues
    value: 'true'
  - key: cppcoreguidelines-avoid-magic-numbers.IgnoredIntegerValues
    value: 1;2;3;4;5;10;100;1000;10000;100000;1000000
  - key: cppcoreguidelines-avoid-magic-numbers.IgnorePowersOf2IntegerValues
    value: 'true'
  - key: cppcoreguidelines-avoid-magic-numbers.IgnoreAllFloatingPointValues
    value: 'true'
  - key: readability-identifier-length.IgnoredVariableNames
    value: e|i|j|k|m|n|fd|id|io|ok|wd|_
  - key: readability-identifier-length.IgnoredParameterNames
    value: fd|id|wd
  - key: readability-function-cognitive-complexity.IgnoreMacros
    value: 'true'
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none


================================================
FILE: .cmake-format.yaml
================================================
---
format:
  line_width: 160
  tab_size: 2


================================================
FILE: .gitattributes
================================================
cmake/* linguist-vendored
doxygen/Doxyfile.in linguist-vendored
*.hpp.in linguist-language=C++


================================================
FILE: .gitignore
================================================
# vim
*.sw[po]

# cmake
*.[ao]
*.cmake
*.so
*.dylib
CMake*.in
CMakeCache.txt
CMakeFiles/
DartConfiguration.tcl
Makefile
Testing/
build/
compile_commands.json*
install_manifest.txt
lib/
external/
external-prefix/

# cpack
_CPack_Packages/

# debian
*.deb

# conda
opt/


================================================
FILE: .gitmodules
================================================
[submodule "roq-cmake"]
	path = cmake
	url = https://github.com/roq-trading/roq-cmake.git
	ignore = dirty
[submodule "roq-scripts"]
	path = scripts
	url = https://github.com/roq-trading/roq-scripts.git
	ignore = dirty


================================================
FILE: CHANGELOG.md
================================================
# Change Log

All notable changes will be documented in this file.

## Head

## 1.1.3 – 2026-03-12

### Changed

* Add `FundsUpdate.unrealized_pnl` (#571)

## 1.1.2 – 2026-02-08

## 1.1.1 – 2025-12-14

## 1.1.0 – 2025-11-22

### Changed

* Support leverage (CreateOrder, OrderAck, OrderUpdate) (#529)

## 1.0.9 – 2025-09-26

### Changed

* Workaround for fmt 11.2 and clang 21.x (#521)

## 1.0.8 – 2025-08-16

### Changed

* Increase max-length of `symbol` to 64 (#516)
* Auto-generate time-series from history of event-logs and live data (#515)
* Better support for estimating P&L and funds (#514)

## 1.0.7 – 2025-07-02

### Changed

* Extend FundsUpdate with borrowed amount (#502)

## 1.0.6 – 2025-05-16

## 1.0.5 – 2025-03-26

### Changed

* Upgrade the `format_str` helper class to work with `fmt 11.1` (#488)

### Added

* Control enabled/disabled state (#484)
* Support MassQuote (#483)

## 1.0.4 – 2024-12-30

## 1.0.3 – 2024-11-26

### Changed

* Add quantity type to order management (#469)
* Add settlement currency to reference data (#468)

## 1.0.2 – 2024-07-14

### Changed

* `cache::MarketByPrice::impact_price` to accept an optional number of orders (#462)
* `Fill` to support quote quantity and commission (#458)

## 1.0.1 – 2024-04-14

### Changed

* Issues with create limited depth updates (#453)

## 1.0.0 – 2024-03-16

### Fixed

* `utils::compare<double>` could incorrectly compare values in the [0;1] range (#446)

### Added

* `RateLimitsUpdate` to support exchange rate-limit updates

### Changed

* Renamed `{price|quantity}_precision` (from `{price_quantity}_decimals`
* Moved several header files to the roq-server library (from the roq::oms namespace here)
* UUID now using C++23 features
* Moved several header files to the roq-cache library (from the roq::cache namespace here)
* Moved several header files to the roq-utils library (from the roq::utils namespace here)
* Promote Decimal to API (from utils::Number) and rename Precision (from Decimals) (#439)

## 0.9.9 &ndash; 2024-01-28

### Added

* Adding exchange time, exchange sequence and sending time to ReferenceData and MarketStatus

### Changed

* Adding `PositionEffect` to `OrderAck`
* Adding `MarginMode` to `CreateOrder`, `OrderAck`, `OrderUpdate`, `TradeUpdate`
* OMS validate quantity and price against reference data (#432)
* Added `MarginMode` to `FundsUpdate` and `PositionUpdate` (#430)

## 0.9.8 &ndash; 2023-11-20

### Fixed

* The position cache would treat zero as a missing value and therefore not update (#419)

### Changed

* `exchange_sequence` is now `uint64_t` (was `int64_t`)
* `RoutingId` now 64 bytes
* `GatewaySettings.oms_cancel_all_orders` has been added (#414)
* `CancelAllOrders` now includes some filters (#414)
* `oms::OrderUpdate` now includes the max request/response/accepted versions

### Added

* `Fill.exchange_time_utc`
* `CancelAllOrdersAck` (#414)
* EXPERIMENTAL: messages for managing dynamic routes

### Removed

* The FlatBuffers schema and auto-generated is no longer needed (replaced by the roq-codec library)

## 0.9.7 &ndash; 2023-09-18

### Added

* `oms::OrderUpdate::routing_id` to support FIX

### Changed

* `order_id` must be `uint64_t` (#377)

### Added

* `OrderAck.client_order_id` and `TradeUpdate.client_order_id` (#389)
* `CancelAllOrders.strategy_id`
* `CreateOrder.strategy_id`, `OrderAck.strategy_id`, `OrderUpdate.strategy_id`, `TradeUpdate.strategy_id` (#375)
* `OrderAck.user` to support drop-copy and risk management

## 0.9.6 &ndash; 2023-07-22

### Changed

* Using `std::source_location` (clang16)
* Using fmt10

### Added

* `Error.RISK_LIMIT_REACHED`
* New `Ready` event to indicate the completion of the intial download phase
* Risk exposure and change added to `OrderAck` and `OrderUpdate` (EXPERIMENTAL)
* `cache::MarketByPrice::impact_price()` (#372)
* `RiskLimits` and `RiskLimitsUpdate` (EXPERIMENTAL)
* `client::Dispatcher.broadcast(CancelAllOrders)`

## 0.9.5 &ndash; 2023-06-12

### Changed

* The `Mask<E>` template had to be changed to work with magic_enum 0.9.0

### Added

* `OrderUpdate.client_order_id` (#366)
* `OrderAck.traded_quantity` (#359)

### Removed

* `oms::TradeUpdate` was unnecessary (`TradeUpdate` is sufficient for the gateways)

## 0.9.4 &ndash; 2023-05-04

### Changed

* Review `PositionUpdate` and `FundsUpdate` to better correlate with `OrderUpdate` and `TradeUpdate` (#340)
* `cache::MarketByOrder::OrderUpdate` now includes the final update action
* `StreamStatus` should include connection details (#337)
* [BREAKING CHANGE] `CreateOrder::request_template` (renamed from `order_template`)
* All order requests must support `request_template` (#329)

### Removed

* Drop `OrderUpdate.order_template` (#330)

### Added

* `CustomMatrix` (#344)
* `PortfolioUpdate` and `Position` to support a position manager (#343)

## 0.9.3 &ndash; 2023-03-20

### Added

* `sending_time_utc` to market data messages (#326)
* `oms::TradeUpdate` (#254)
* `client::Settings.drop_copy` (#254)

### Changed

* [BREAKING CHANGE] `MarketByOrderUpdate` and `MBOUpdate` has been changed to support CME's TradeSummary (#322)

### Fixed

* utils::invert(side)` didn't work for `side == UNDEFINED` (#325)

## 0.9.2 &ndash; 2023-02-22

### Added

* `MBOUpdate.reason` + `UpdateReason`
* `cache::MarketByOrder`

### Changed

* `fbs::MarketByOrderUpdate.max_depth` was inserted (should not be an issue since it was never used before)
* `MBOUpdate`: `priority` now `uint64_t`, `order_id` length 36 (UUID), re-ordering

## 0.9.1 &ndash; 2023-01-12

## 0.9.0 &ndash; 2022-12-22

### Changed

* New `Protocol` and `Encoding` to support Roq's UDP transport (#307)

## 0.8.9 &ndash; 2022-11-14

### Added

* Move `Category` (from the core and adapter libraries) (#297)

### Changed

* `Parameter` now includes the `account`, `exchange`, `symbol` tuple
* `ParametersUpdate` was renamed (from `ParameterUpdate`)
* `TraceInfo` now default initializing to current time
* `clock` promoted (from core library)

## 0.8.8 &ndash; 2022-10-04

### Added

* `RequestStatus.ERROR` (#292)
* `TradeSummary` to include exchange sequence and taker/maker order id's (#279)
* `CustomMetrics.update_type` and `CustomMetricsUpdate.update_type`
* `GatewaySettings.mbp_checksum`

### Changed

* Preparing to drop C++17 compatibility
* `cache::MarketByPrice::max_depth` now returns `uint16_t`

### Removed

* `MarketByPriceUpdate.checksum` from the FlatBuffers schema
* Optimize the `cache::MarketByPrice` interface (#267)

## 0.8.7 &ndash; 2022-08-22

### Added

* `client::EventLogMultiplexer` (#266)
* Cache objects for Create/Modify/CancelOrder (#26)
* `ParameterUpdate` (#258)

### Changed

* Optimize the `cache::MarketByPrice` interface (#267)
* An optional `is_last` field has been added to `client::Dispatcher::send` (#26)
* Move `RateLimiter` (from roq-server) (#259)
* API changes needed to support drop-copy (#254)
* Add notional fields to `ReferenceData` (#252)
* Add new fields to `RateLimitTrigger` (#251)

### Removed

* `OrderUpdateAction` (replaced with `UpdateAction`)

### Fixed

* `utils::safe_cast` now using `std::numeric_limist::lowest()` (instead of `min()`)

## 0.8.6 &ndash; 2022-07-18

### Fixed

* fmt v9 requires custom formatters to be const

### Changed

* Prevent copy/move of `Event<>` and `Trace<>` (#247)
* return `span<MBPUpdate>` from `cache::MarketByPrice` (#241)
* Flatbuffers auto-generated code now using C++17
* `client::EventLogReader` now expose more metadata
* `MBPUpdate` now supports `UpdateAction` (#236)

## 0.8.5 &ndash; 2022-06-06

### Added

* `cache::Manager::get_market_with_id` and `cache::Manager::get_market_id`
* `ReferenceData::discard` (#225)

### Changed

* Promote `utils::DateTime_iso8601` formatter to API (from core)
* Make `cache::Manager` a non-template (#230)
* `cache::MarketByPrice::stream_id()`

## 0.8.4 &ndash; 2022-05-14

### Added

* `cache::MarketByPrice::find_index`
* `cache::MarketByPrice::compute_vwap`
* RequestIdType added to GatewaySettings (from server)

### Changed

* Increase `Symbol` fixed-length size to 48 (#214)
* `Event<>` and `Trace<>` formatting has move the value to the front
* C++17 compatibility (std::span and "using enum" workarounds)
* `Trace` now supports non-const (and retains const-safety when const)
* `TopOfBook` now includes an exhange sequence number (to correlate with MbP updates)
* `StreamStatus` now provides more detailed information
* Promote `debug::hex::Message` and `debug::fix::Message` (from core library)
* Comparisons now use (or return) `std::strong_ordering` (instead of `int`)
* Simplify enums (#199)
* Proper bit-mask support (#198)
* Promote Trace and TraceInfo to API (from server)

## 0.8.3 &ndash; 2022-03-22

### Changed

* Enforce fixed-length strings for standard use-cases (account, exchange, symbol, ...)
* Rename `string` (from `string_buffer`)
* Promote Mask to API (from utils)
* Rename headers to .hpp (#195)
* Conda packaging should pin versions to match x.x.x (#189)
* Added `update_type` to `OrderUpdate` and `TradeUpdate` (#39)

## 0.8.2 &ndash; 2022-02-18

### Changed

* Added account to ExternalLatency (#170)
* Source file name are now evaluated and stored at compile time (#160)

## 0.8.1 &ndash; 2022-01-16

### Changed                                                                                                                
                                                                                                                           
* Upgrade to C++20 (#158)

## 0.8.0 &ndash; 2022-01-12

### Added

* `cache::MarketByPrice::exists` (#153)
* `SecurityType::SWAP`
* Capture `origin_create_time` for externally triggered events (#140)

### Changed

* Increase `MAX_LENGTH_CURRENCY`
* `ReferenceData::margin_currency` (#150)
* Support macOS/ARM64 (#149)

### Removed

* `client::DepthBuilder` (#152)

## 0.7.9 &ndash; 2021-12-08

### Changed

* Align oms with new use of Decimals enum
* `MarketByPriceUpdate` now include max-depth (#123)
* `MarketByPriceUpdate` and `MarketByOrderUpdate` now include checksum (#74)
* `MarketByPriceUpdate` and `MarketByOrderUpdate` now include price/quantity decimals (#119)

### Added

* Capture request round-trip latency (#130)
* Starting to move object cache logic into API (#128)

## 0.7.8 &ndash; 2021-11-02

### Added

* Move cache utilities to API (#111)
* Promoted `server::TraceInfo` to API
* Add exchange sequence number to `MarketByPrice` and `MarketByOrder` (#101)
* Add `max_trade_vol` and `trade_vol_step_size` to ReferenceData (#100)
* New method to update `market::MarketByPrice` (#17)
* Price/quantity decimal digits added to `oms::Order` (#46)
* Conversion to/from internal price used by `market::MarketByPrice` (#21)
* Interface to extract bid/ask `MBPUpdate` from `market::MarketByPrice`
* New `UpdateType` (will eventually be used with `MarketByPriceUpdate`) (#93)
* Add `StatisticsType::TRADE_VOLUME` (#88)

### Changed

* Remove custom literals (#110)
* ReferenceData currencies should follow FX conventions (#99)
* Replace `snapshot` (bool) with `update_type` (UpdateType) (#97)
* Align type used to represent decimal digits (#46)
* Adding more `MAX_LENGTH` constants (#91)
* Align `PositionUpdate` with the FIX protocol (#89)

### Fixed

* Utility functions did not correctly handle `RequestStatus::FAILED` (#82)

## 0.7.7 &ndash; 2021-09-20

### Added

* New `market::MarketByPrice` interface (#56)

### Changed

* `RequestStatus::TIMEOUT` should not be a final order request state (#59)
* `GatewaySettings` has changed structure and new fields (#56)
* `client::DepthBuilder` now derives from `market::MarketByPrice` (#56)
* `string_buffer` did not have O(1) `length()` (#53)
* Move OMS interfaces to API (#51)
* `RateLimitTrigger` must support const members (#34)

### Fixed

* API exceptions should compile with C++14 (#69)

## 0.7.6 &ndash; 2021-09-02

### Added

* `Error::INSUFFICIENT_FUNDS` (#32)
* `RateLimitTrigger` replaces `RateLimitUsage` (#34)
* Promoting `RateLimitType` to API (#34)
* `NotSupported` exception (clean-up)
* `CustomMetrics` (publish) and `CustomMetricsUpdate` (receive) (#8)
* `NotImplemented` exception (clean-up)
* `Error::CONDITIONAL_REQUEST_HAS_FAILED` and `Error::UNKNOWN_ORDER_ID` (#25)
* `utils::was_order_received` and `utils::to_request_status` (#25)
* `OrderAck::side` (#11)
* `client::EventLogReader` interface (#10)

### Changed

* The various interfaces used for simulation has been updated (#7)

### Removed

* `Subscribe` has been removed from API (#14)

## 0.7.5 &ndash; 2021-08-08

### Changes

* `Error` has been extended to communicate certain exchange errors
* `RequestStatus` now includes `DISCONNECTED`, `TIMEOUT`, and `FAILED`
* `OrderAck` now includes `exchange` and `symbol`
* `CustomMessage` now uses `span` to represent the message

### Fixed

* `DepthBuilder` was unsafe because the constructor cached a pointer to a span
  of `Layer`s, aka. the depth.
  This has been changed and applying a `MarketByPriceUpdate` will now require
  you to also pass a reference to the depth.

### Added

* `Error::REQUEST_RATE_LIMIT_REACHED`
* `StatisticsType::FUNDING_RATE_PREDICTION`

### Removed

* Dropped all wrappers for fmt. (Reason: `fmt::format_string` is now a template
  solution -- previously it was a macro).

## 0.7.4 &ndash; 2021-07-20

### Changed

* The exception hierarchy no longer tries to mirror `std`.

## 0.7.3 &ndash; 2021-07-06

### Added

* `OrderManagement` used to instruct a gateway of the order management style
* `MAX_ORDER_ID` and `MAX_REQUEST_VERSION` to reflect 24 bit limits

### Changed

* `OrderAck`, `OrderUpdate`, `ModifyOrder` and `CancelOrder`
   now use `uint32_t` for all version fields
* The format functions no longer require use of the `_fmt` literal
* Reduced `MAX_LENGTH_ROUTING_ID` to 16
* `GatewaySettings` now includes `oms_download_has_state` and
  `oms_download_has_routing_id`

### Removed

* The `_fmt` literal
* The `format_str` wrapper class has been moved to the roq-logging library


## 0.7.2 &ndash; 2021-06-20

### Changed

* `Error` has been updated
* `OrderAck` has been updated and extended with `version`
* `OrderUpdate` has been updated and extended with `max_request_version`,
  `max_response_version` and `max_accepted_version`
* `ModifyOrder` and `CancelOrder` has been updated with `version` and
  `conditional_on_version`
* `CreateOrder` and `OrderUpdate` has changed field ordering to better group
  constant vs. possibly changing fields
* `TradeUpdate` and `Fill` has changed field ordering and `Fill` has dropped
  artificially generated `trade_id`'s
* `MBPUpdate` has been updated with `implied_quantity`, `price_level` and
  `number_of_orders`

## 0.7.1 &ndash; 2021-05-30

### Added

* `RateLimitUsage` to allow strategy to back off when it high-water mark on
   rate-limiting has been detected
* `CancelAllOrders` when all orders must be cancelled immediately
* `GatewaySettings.mbp_allow_remove_non_existing` to indicate if an exchange
   could possibly send updates to unknown price levels
* `StatisticsType::FUNDING_RATE` and `StatisticsType::DAILY_FUNDING_RATE`
* `routing_id` to `ModifyOrder` and `CancelOrder`
* `SupportType.ORDER_STATE` to indicate if gateway supports FIX 4.4 style
   order state management (through ClOrdId/OrigClOrdId transitions)
* `GatewaySettings.supports` to allow users to detect what is supported
* Added `Liquidity` to indicate if last fill was as maker or taker
* Extend `OrderUpdate` with more fields (required for FIX bridge and download)
* `TradingStatus` has been completely reviewed to match the trading session state
  changes which can occur on most exchanges
* `ExecutionInstruction` will now support bit-masks (future change)
* The layout of many structs have changed

### Changed

* `client::Config::Handler` now includes a method to configur
* `client::Settings`. This makes it possible to override `cancel_policy` (on
   disconnect)
* `Disconnected` now adds a flag useful to detect if disconnect could trigger an
   order cancellation request
* `OrderStatus` better aligned with FIX enum, but excluding state transitions
* `TimeInForce` better aligned with FIX enum


## 0.7.0 &ndash; 2021-04-15

### Added

* Promoted a number of generic utilities to the `roq::utils` namespace.
  Although these are useful, they should not be considered "API".
* The `routing_id` field has been added to the relevant order management
  structures.


### Changed

* All server (gateway) originated structs now include `stream_id` to indicate
  the origin of a message.
  `MarketDataStatus` and `OrderManagerStatus` have been replaced with
  `StreamUpdate`.
  Clients must use the `supports` bit-mask from `StreamUpdate` to maintain
  availability of cached objects.
  This change was done to allow gateways to manage load balance e.g. by
  maintaining multiple connections.
* Replaced `Connection` with `Connected` and `Disconnected`
* Renamed `GatewayStatus` to `ConnectionStatus`

### Removed

* Python API (this is not the right place)
* Removed `name` from `ExternalLatency`
* Removed `MarketDataStatus` and `OrderManagerStatus`

## 0.6.1 &ndash; 2021-02-19

### Added

* Convenience functions making it easy to encode Flatbuffers objects

### Changed

* Consistent use string literals
* Enforce usage of the `_fmt` literal when formatting

### Removed

* Enumerations no longer include `MAX`


## 0.6.0 &ndash; 2021-02-02

### Changed

* Repo now includes the auto-generated header files (for better discoverability)

* Miniforge (instead of Miniconda)

* `MessageInfo.source_session_id` now using a more efficient UUID representation

* Now using span-lite (instead of own implementation, C++20 preparation)

### Added

* `Settings`
* `ExternalLatency`

### Removed

* `User` and `Account` removed (not public interfaces)

## 0.5.0 &ndash; 2020-12-04

### Changed

* Time management has been changed

  * `std::chrono::nanoseconds` used for all precision timestamps
  * `std::chrono::seconds` used for all date-times
  * `std::chrono::days` (using `roq::chrono::days` until C++20 is supported)
    used for all dates

### Added

* `ReferenceData`

   * `description`, `underlying`,
     `time_zone`, `issue_date`, `settlement_date`,
     `expiry_datetime`, `expiry_datetime_utc

### Removed

* `ReferenceData::limit_{up|down}`

   * Upper and lower trading limits belongs to daily session statistics,
     not reference data.
     These fields were anyway already managed by `StatisticsUpdate`.

## 0.4.5 &ndash; 2020-11-09

## 0.4.4 &ndash; 2020-09-20

## 0.4.3 &ndash; 2020-09-02

### Changed

* `client::Collector` interface now implements default handlers instead of
   having pure virtual functions.
* `is_{order|request}_completed` replacing `is_completed`.

### Removed

* `client::Collector::{extract|write}` were too specific.

## 0.4.2 &ndash; 2020-07-27

### Removed

* Automake support

## 0.4.1 &ndash; 2020-07-17

**Note!**
*CMake is now the default build system for all Roq solutions.
This makes it significantly easier to integrate with other CMake based
solutions*.

### Changed

* CMake is now the default build system for all Roq solutions
* Replace ROQ\_PREDICT\_{TRUE,FALSE} with ROQ\_LIKELY and
  ROQ\_UNLIKLEY to better match c++20 naming
* Removed (again) the use of FMT\_STRING since it will not be
  compatible with c++20

### Removed

* `roq/format.h`

## 0.4.0 &ndash; 2020-06-30

**Note!**
*FlatBuffers has been introduced to compliment the C++ interface for
non-latency sensitive use-cases.
Event-logs are now using FlatBuffers for all encoding.
This allows for backwards compatibility and thereby dropping the
requirement for decoding to be binary compatible with encoding.
An upcoming release will introduce a FlatBuffers interface into
the gateways thereby allowing other languages than C++ languages
to communicate with the gateway*.

### Added

* FlatBuffers schema (experimental!)
* `StatisticsUpdate` (to replace `DailyStatistics` and `SessionStatistics`)

### Changed

* Events are now wrapped with the `Event` template
* Replaced `MarketByPrice` and `MarketByOrder` with `MarketByPriceUpdate` and
  `MarketByOrderUpdate` to more clearly reflect changes being communicated

## 0.3.9 &ndash; 2020-06-09

### Fixed

* `roq::event_value<ConnectionStatusEvent>` was broken in release 0.3.8

### Changed

* Metrics interfaces and utilities have been moved into the
  `roq::metrics` namespace
* Metric collectors now using std::atomic variables

### Removed

* Logging has been moved into a separate library `roq-logging`

## 0.3.8 &ndash; 2020-06-06

### Changed

* Auto-generate enums, structs, classes, formatting, etc.
* Major parts of the client API have been moved here

## 0.3.7 &ndash; 2020-05-27

### Added

* Dependency on FlatBuffers
* `SessionsStatistics::index_value` and
  `SessionsStatistics::margin_rate`

### Changed

* Inherit all network-related exceptions from `NetworkError`

## 0.3.6 &ndash; 2020-05-02

### Added

* `TimedOut` (exception)

## 0.3.5 &ndash; 2020-04-22

## 0.3.4 &ndash; 2020-04-08

### Added

* `ExecutionInstruction` (enum) similar to FIX `ExecInst`
* `Error::EXECUTION_INSTRUCTION_NOT_SUPPORTED`
* `Account::user`
* `OrderUpdate::execution_instruction`, `OrderUpdate::stop_price` and
  `OrderUpdate::max_show_quantity`
* Ensure all enums have an `UNDEFINED`

### Removed

* `OrderUpdate::commissions`

### Changed

* Log non-zero application exit codes as warning
* Prefer C++ raw strings

## 0.3.3 &ndash; 2020-03-04

### Added

* `Fill` (struct)
* `TopOfBook` (struct)
* `price_from_side` (function)
* `span` (struct)

### Removed

* `MBOUpdate::side`

### Changed

* `TradeUpdate` (struct) now containing an array of `Fill`'s (struct)
* Logging now requires `FMT_STRING` to better formatting errors at
  compile time
* `MarketByPrice` (struct) now maintaining `bids` and `asks` separately
* `MBOUpdate::order_id` (string) replaces `order_id_ext` (integer)
* Use `roq::span` everywhere


================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required(VERSION 4.0)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})

# config

include(RoqConfig)

# version (using git tag)

include(GetGitRepoVersion)

message("Using GIT_REPO_VERSION=${GIT_REPO_VERSION}")

# project

project(roq-api VERSION ${GIT_REPO_VERSION})

# language

enable_language(CXX)

# filesystem

include(GNUInstallDirs)

# dependencies

find_package(fmt REQUIRED)
find_package(magic_enum REQUIRED)
find_package(nameof REQUIRED)

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
  include(CTest)
endif()

if(BUILD_TESTING)
  find_package(Catch2 REQUIRED)
endif()

# autogen

find_program(ROQ_AUTOGEN roq-autogen REQUIRED)

set(TEMPLATE_DIR ${CMAKE_SOURCE_DIR}/scripts/templates)
set(SCHEMA_LINK_DIR ${CMAKE_SOURCE_DIR}/schema)

# clang-format

find_program(CLANG_FORMAT clang-format REQUIRED)

# includes

include_directories(${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR})

# sub-projects

add_subdirectory(${CMAKE_SOURCE_DIR}/schema/roq)
add_subdirectory(${CMAKE_SOURCE_DIR}/include/roq)

if(BUILD_TESTING)
  add_subdirectory(${CMAKE_SOURCE_DIR}/test)
endif()

# project

add_library(${PROJECT_NAME} INTERFACE)

add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}-include-cpp)

# install (public headers)

install(
  DIRECTORY ${CMAKE_SOURCE_DIR}/include/roq/
  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/roq
  FILES_MATCHING
  PATTERN "*.h*"
  PATTERN "CMakeFiles" EXCLUDE)

# doxygen

option(BUILD_DOCS "Enable doxygen" OFF)

if(BUILD_DOCS)
  find_package(Doxygen)
  add_subdirectory(${CMAKE_SOURCE_DIR}/doxygen)
  add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}-doxygen)
  add_dependencies(${PROJECT_NAME}-doxygen ${PROJECT_NAME}-include-cpp)
endif()

# install (cmake)

install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}-config)

install(FILES ${CMAKE_SOURCE_DIR}/CHANGELOG.md DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/${PROJECT_NAME})

set(CMAKE_LIB_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})

export(
  TARGETS ${PROJECT_NAME}
  NAMESPACE ${PROJECT_NAME}::
  FILE ${CMAKE_LIB_DIR}/${PROJECT_NAME}-config.cmake)

install(
  EXPORT ${PROJECT_NAME}-config
  NAMESPACE ${PROJECT_NAME}::
  DESTINATION ${CMAKE_LIB_DIR})


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2017-2026, Hans Erik Thrane

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
# roq-api

API for algorithmic and high-frequency trading (HFT).

> This project does **not** contain the closed source implementation of the
> C++ interfaces.


## Links

* [Roq GmbH (website)](https://roq-trading.com/)
* [Contact (email)](mailto:info@roq-trading.com)
* [Documentation](https://roq-trading.com/docs/)
* [Releases](https://roq-trading.com/docs/releases/)
* [Gateways](https://roq-trading.com/docs/introduction/gateways/)
* [Samples](https://github.com/roq-trading/roq-cpp-samples/)
* [Roadmap](https://roq-trading.com/docs/introduction/roadmap/)
* [Pricing](https://roq-trading.com/#pricing)
* [LinkedIn](https://www.linkedin.com/company/35447832/)
* [Telegram](https://t.me/roq_trading/)


## Design

* Modular.
* Predictable low latency.
* Support all aspects required by a production environment.
* Aim to reduce "glue" code and offer standard solutions for data capture,
  monitoring, bridge solutions, etc.

![Design](/static/images/architecture_reference.svg)

* The **C++ API** enables clients (e.g. trading strategies) to
  * communicate with gateways using a unified interface, or
  * replay event-logs (exactly, for simulation and back-testing purposes).
* The **FIX bridge** supports third-party solutions.
* The **adapters** support third-party database solutions, e.g. ClickHouse.
* The **metrics** interface supports third-party monitoring solutions, e.g. Prometheus,
  Alertmanager and Grafana.


## Features

* Open source interface (no need to sign an NDA to access or use).
* Permissive license (anyone is free to copy and use for whatever purpose).
* Free to download and try (no need to contact or register).
* Unified client interface to access any market.
* Design is strongly inspired by standards and specific implementations used
  by major exchanges.
* Strong preference for allocation-free message encoding/decoding.
* Extensive use of auto-generated code based on schemas.
* Strongly typed messages (events).
* Asynchronous interfaces and implementations.
* C++ and shared memory for low latency.
* Automatic capture of all events.
* Free to download tools and database adapters.


## Support and Maintenance

A SLA is required for production support.
More information can be found [here](https://roq-trading.com/#pricing).

Feel free to [contact us](mailto:info@roq-trading.com) with any questions
you may have.


## Gateways

Currently supported traditional exchanges include

* CME

Currently supported Cryptocurrency exchanges include

* Binance
* BitMEX
* Bitstamp
* Bybit
* Coinbase PRO
* Deribit
* Gate
* Gemini
* HitBTC
* Huobi
* Kraken
* KuCoin
* OKX

The full list can be found [here](https://roq-trading.com/docs/introduction/gateways/).

> Instructions on how to install, configure and use the gateways can either
> be found in the [samples](https://github.com/roq-trading/roq-cpp-samples) or
> by consulting the [documentation](https://roq-trading.com/docs/tutorials/gateways/).


## Operating Systems

* Linux (x86-64, AArch64)
* macOS (x86-64, Arm64)

> All listed combinations are regularly compiled but only Linux/x86-64 is continuously being tested.
> If you require a specific combination, please [contact us](mailto:info@roq-trading.com) before using.

> We plan to drop support for macOS/x86-64.


## Library/Package Dependencies

* [fmt](https://github.com/fmtlib/fmt) (MIT License)
* [magic_enum](https://github.com/Neargye/magic_enum) (MIT License)
* [jinja2](https://github.com/pallets/jinja) (BSD 3-Clause License)

Optional

* [Catch2](https://github.com/catchorg/Catch2) (Boost Software License 1.0 License)


## Prerequisites

> It is not very interesting to follow the instructions shown here due to this
> project only containing interfaces.
> The actual client implementation is closed source as mentioned elsewhere in
> this document.

The project is primarily designed to be compatible with the conda package manager.

> Use `stable` for (the approx. monthly) release build.
> Use `unstable` for the more regularly updated development builds.

### Initialize sub-modules

```bash
git submodule update --init --recursive
```

### Create development environment

```bash
scripts/create_conda_env unstable debug
```

### Activate environment

```bash
source opt/conda/bin/activate dev
```

## Build the project

> Sometimes you may have to delete CMakeCache.txt if CMake has already cached an incorrect configuration.

```bash
cmake . && make -j4
```

### Using

You can download the closed source client implementation like this

```bash
conda install -y --channel https://roq-trading.com/conda/stable \
    roq-client
```

Samples can be found [here](https://github.com/roq-trading/roq-cpp-samples).


## License

The project is released under the terms of the MIT license.


================================================
FILE: conda/bld.bat
================================================
#xyz


================================================
FILE: conda/meta.yaml
================================================
package:
  name: roq-api
  version: {{ GIT_DESCRIBE_TAG }}

source:
  git_url: ..

build:
  skip: true  # [not unix]
  number: {{ ROQ_BUILD_NUMBER if ROQ_BUILD_NUMBER is defined else GIT_DESCRIBE_NUMBER }}

requirements:
  build:
    - {{ compiler('cxx') }}
    - clang-format
    - cmake
    - coreutils
    - doxygen
    - git
    - make
    - roq-autogen
  host:
    - catch2
    - fmt
    - magic_enum
    - roq-oss-nameof

about:
  home: https://roq-trading.com
  doc_url: https://roq-trading.com/docs
  dev_url: https://github.com/roq-trading
  license: MIT
  license_family: MIT
  license_file: LICENSE
  summary: Roq API


================================================
FILE: doxygen/.gitignore
================================================
Doxyfile
doxygen-build.stamp
html
xml


================================================
FILE: doxygen/CMakeLists.txt
================================================
set(TARGET_NAME ${PROJECT_NAME}-doxygen)

set(TARGET_DIR ${CMAKE_INSTALL_DATADIR}/doc/${PROJECT_NAME})

# doxyfile

set(DOXYFILE ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${DOXYFILE} @ONLY)

# target

set(INDEX_HTML ${CMAKE_CURRENT_BINARY_DIR}/html/index.html)

add_custom_command(
  OUTPUT ${INDEX_HTML}
  COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE}
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  VERBATIM
  DEPENDS ${DOXYGEN_EXECUTABLE} ${DOXYFILE})

add_custom_target(${TARGET_NAME} ALL DEPENDS ${INDEX_HTML})

# install

install(
  DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/xml/
  DESTINATION ${TARGET_DIR}/xml
  FILES_MATCHING
  PATTERN "*.xml")

install(
  DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
  DESTINATION ${TARGET_DIR}/html
  FILES_MATCHING
  PATTERN "*.html")


================================================
FILE: doxygen/Doxyfile.in
================================================
PROJECT_NAME           = "roq-api"
PROJECT_NUMBER         = "@ROQ_VERSION@"
EXTRACT_ALL            = YES
EXTRACT_PRIVATE        = YES
EXTRACT_STATIC         = YES
CASE_SENSE_NAMES       = NO
INPUT                  = @CMAKE_SOURCE_DIR@/include \
                         @CMAKE_BINARY_DIR@/@CMAKE_INSTALL_INCLUDEDIR@
RECURSIVE              = YES
EXCLUDE                = @CMAKE_SOURCE_DIR@/include/roq/fbs
GENERATE_LATEX         = NO
GENERATE_XML           = YES
HIDE_UNDOC_RELATIONS   = NO
HAVE_DOT               = NO
COLLABORATION_GRAPH    = NO
GROUP_GRAPHS           = NO
GRAPHICAL_HIERARCHY    = NO


================================================
FILE: include/roq/CMakeLists.txt
================================================
set(TARGET_NAME ${PROJECT_NAME}-include-cpp)

include(RoqAutogen)

set(TARGET_DIR ${CMAKE_INSTALL_INCLUDEDIR}/roq)

# schema

set(SCHEMA_ROQ
    action.json
    add_market.json
    add_routes.json
    bar.json
    batch_begin.json
    batch_end.json
    buffer_capacity.json
    cancel_all_orders_ack.json
    cancel_all_orders.json
    cancel_order.json
    cancel_quotes_ack.json
    cancel_quotes.json
    category.json
    connected.json
    connection_status.json
    control_ack.json
    control.json
    create_order.json
    custom_matrix.json
    custom_matrix_update.json
    custom_metrics.json
    custom_metrics_update.json
    data_source.json
    disconnected.json
    download_begin.json
    download_end.json
    encoding.json
    error.json
    execution_instruction.json
    external_latency.json
    fill.json
    filter.json
    funds_update.json
    gateway_settings.json
    gateway_status.json
    interval.json
    layer.json
    leg.json
    legs_update.json
    liquidity.json
    margin_mode.json
    market_by_order_update.json
    market_by_price_update.json
    market_status.json
    mass_quote_ack.json
    mass_quote.json
    mbo_update.json
    mbp_update.json
    measurement.json
    message_info.json
    modify_order.json
    option_type.json
    order_ack.json
    order_cancel_policy.json
    order_management.json
    order_status.json
    order_type.json
    order_update.json
    origin.json
    parameter.json
    parameters_update.json
    portfolio.json
    portfolio_update.json
    position_effect.json
    position.json
    position_update.json
    precision.json
    priority.json
    protocol.json
    quality_of_service.json
    quantity_type.json
    quote.json
    rate_limit.json
    rate_limits_update.json
    rate_limit_trigger.json
    rate_limit_type.json
    ready.json
    reference_data.json
    remove_routes.json
    request_id_type.json
    request_status.json
    request_type.json
    risk_limit.json
    risk_limits.json
    risk_limits_update.json
    route_ack.json
    route.json
    route_request_status.json
    routing.json
    security_type.json
    service_update.json
    side.json
    start.json
    state.json
    statistics.json
    statistics_type.json
    statistics_update.json
    stop.json
    strategy_update.json
    stream_status.json
    subscribe.json
    support_type.json
    tick_size_step.json
    time_in_force.json
    timer.json
    time_series_update.json
    top_of_book.json
    trade.json
    trade_summary.json
    trade_update.json
    trading_status.json
    transport.json
    update_action.json
    update_reason.json
    update_type.json
    variant_type.json)

set(SOURCES ${SCHEMA_ROQ})

# configure

set(API_HPP ${CMAKE_BINARY_DIR}/${TARGET_DIR}/api.hpp)

configure_file("api.hpp.in" ${API_HPP} @ONLY)

# auto-generate

roq_autogen_hpp(
  OUTPUT
  AUTOGEN_HEADERS
  SOURCES
  ${SOURCES}
  NAMESPACE
  "roq"
  SCHEMA_LINK_DIR
  ${SCHEMA_LINK_DIR}
  TEMPLATE_DIR
  ${TEMPLATE_DIR}
  TEMPLATE_TYPE
  "api")

# target

add_custom_target(${TARGET_NAME} ALL DEPENDS ${AUTOGEN_HEADERS} ${GITIGNORE})

# install

install(FILES ${AUTOGEN_HEADERS} ${API_HPP} DESTINATION ${TARGET_DIR})


================================================
FILE: include/roq/action.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <cstdint>

namespace roq {

//! Enumeration of control action
enum class Action : uint8_t {
  UNDEFINED = 0,
  ENABLE,   //!< Enable
  DISABLE,  //!< Disable
};

}  // namespace roq


================================================
FILE: include/roq/add_market.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <string_view>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Emitted when a new market is being created by the framework
struct ROQ_PUBLIC AddMarket final {
  std::string_view exchange;  //!< Exchange
  std::string_view symbol;    //!< Symbol
};

template <>
constexpr std::string_view get_name<AddMarket>() {
  using namespace std::literals;
  return "add_market"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::AddMarket> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::AddMarket const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(exchange="{}", )"
        R"(symbol="{}")"
        R"(}})"sv,
        value.exchange,
        value.symbol);
  }
};

================================================
FILE: include/roq/add_routes.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>
#include <fmt/ranges.h>

#include <magic_enum/magic_enum_format.hpp>

#include <span>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Add route(s)
struct ROQ_PUBLIC AddRoutes final {
  std::span<uint32_t const> strategy_ids;  //!< List of strategy_id's to add
};

template <>
constexpr std::string_view get_name<AddRoutes>() {
  using namespace std::literals;
  return "add_routes"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::AddRoutes> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::AddRoutes const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(strategy_ids=[{}])"
        R"(}})"sv,
        fmt::join(value.strategy_ids, ", "sv));
  }
};

================================================
FILE: include/roq/api.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

#pragma once

#include "roq/compat.hpp"

// convenience

#include "roq/limits.hpp"

// enums

#include "roq/action.hpp"
#include "roq/buffer_capacity.hpp"
#include "roq/category.hpp"
#include "roq/connection_status.hpp"
#include "roq/data_source.hpp"
#include "roq/encoding.hpp"
#include "roq/error.hpp"
#include "roq/execution_instruction.hpp"
#include "roq/filter.hpp"
#include "roq/interval.hpp"
#include "roq/liquidity.hpp"
#include "roq/margin_mode.hpp"
#include "roq/option_type.hpp"
#include "roq/order_cancel_policy.hpp"
#include "roq/order_management.hpp"
#include "roq/order_status.hpp"
#include "roq/order_type.hpp"
#include "roq/origin.hpp"
#include "roq/position_effect.hpp"
#include "roq/precision.hpp"
#include "roq/priority.hpp"
#include "roq/protocol.hpp"
#include "roq/quantity_type.hpp"
#include "roq/rate_limit_type.hpp"
#include "roq/request_id_type.hpp"
#include "roq/request_status.hpp"
#include "roq/request_type.hpp"
#include "roq/route_request_status.hpp"
#include "roq/security_type.hpp"
#include "roq/side.hpp"
#include "roq/state.hpp"
#include "roq/statistics_type.hpp"
#include "roq/support_type.hpp"
#include "roq/time_in_force.hpp"
#include "roq/trading_status.hpp"
#include "roq/transport.hpp"
#include "roq/update_action.hpp"
#include "roq/update_reason.hpp"
#include "roq/update_type.hpp"

// helpers

#include "roq/bar.hpp"
#include "roq/fill.hpp"
#include "roq/layer.hpp"
#include "roq/leg.hpp"
#include "roq/mbo_update.hpp"
#include "roq/mbp_update.hpp"
#include "roq/measurement.hpp"
#include "roq/parameter.hpp"
#include "roq/position.hpp"
#include "roq/quote.hpp"
#include "roq/rate_limit.hpp"
#include "roq/risk_limit.hpp"
#include "roq/route.hpp"
#include "roq/statistics.hpp"
#include "roq/tick_size_step.hpp"
#include "roq/trade.hpp"

// transport

#include "roq/message_info.hpp"

// control (autogen)

#include "roq/connected.hpp"
#include "roq/control.hpp"
#include "roq/control_ack.hpp"
#include "roq/disconnected.hpp"
#include "roq/legs_update.hpp"
#include "roq/service_update.hpp"
#include "roq/start.hpp"
#include "roq/stop.hpp"
#include "roq/strategy_update.hpp"
#include "roq/timer.hpp"

// messages (autogen)

#include "roq/add_market.hpp"
#include "roq/add_routes.hpp"
#include "roq/batch_begin.hpp"
#include "roq/batch_end.hpp"
#include "roq/cancel_all_orders.hpp"
#include "roq/cancel_all_orders_ack.hpp"
#include "roq/cancel_order.hpp"
#include "roq/cancel_quotes.hpp"
#include "roq/cancel_quotes_ack.hpp"
#include "roq/create_order.hpp"
#include "roq/custom_matrix.hpp"
#include "roq/custom_matrix_update.hpp"
#include "roq/custom_metrics.hpp"
#include "roq/custom_metrics_update.hpp"
#include "roq/download_begin.hpp"
#include "roq/download_end.hpp"
#include "roq/external_latency.hpp"
#include "roq/funds_update.hpp"
#include "roq/gateway_settings.hpp"
#include "roq/gateway_status.hpp"
#include "roq/market_by_order_update.hpp"
#include "roq/market_by_price_update.hpp"
#include "roq/market_status.hpp"
#include "roq/mass_quote.hpp"
#include "roq/mass_quote_ack.hpp"
#include "roq/modify_order.hpp"
#include "roq/order_ack.hpp"
#include "roq/order_update.hpp"
#include "roq/parameters_update.hpp"
#include "roq/portfolio.hpp"
#include "roq/portfolio_update.hpp"
#include "roq/position_update.hpp"
#include "roq/rate_limit_trigger.hpp"
#include "roq/rate_limits_update.hpp"
#include "roq/ready.hpp"
#include "roq/reference_data.hpp"
#include "roq/remove_routes.hpp"
#include "roq/risk_limits.hpp"
#include "roq/risk_limits_update.hpp"
#include "roq/route_ack.hpp"
#include "roq/statistics_update.hpp"
#include "roq/stream_status.hpp"
#include "roq/subscribe.hpp"
#include "roq/time_series_update.hpp"
#include "roq/top_of_book.hpp"
#include "roq/trade_summary.hpp"
#include "roq/trade_update.hpp"

// misc

#include "roq/exceptions.hpp"

// version

#define ROQ_VERSION "1.1.3"

namespace roq {

// NOLINTBEGIN(readability-magic-numbers)

// user id (8 bits)

static constexpr uint8_t const SOURCE_MIN = 0;
static constexpr uint8_t const SOURCE_MAX = 255;

static constexpr auto const SOURCE_NONE = SOURCE_MIN;
static constexpr auto const SOURCE_SELF = SOURCE_MAX;

// stream id (16 bits)

static constexpr uint16_t const STREAM_ID_MIN = 0;
static constexpr uint16_t const STREAM_ID_MAX = 65535;

static constexpr auto const STREAM_ID_NONE = STREAM_ID_MIN;

// order id (48 bits)

static constexpr uint64_t const ORDER_ID_MIN = 0;
static constexpr uint64_t const ORDER_ID_MAX = (uint64_t{1} << 48) - 1;

static constexpr auto const ORDER_ID_NONE = ORDER_ID_MIN;

// request version (24 bits)

static constexpr uint32_t const REQUEST_VERSION_MIN = 0;
static constexpr uint32_t const REQUEST_VERSION_MAX = (uint32_t{1} << 24) - 1;

static constexpr auto const REQUEST_VERSION_NONE = REQUEST_VERSION_MIN;

// strategy id (24 bits)

static constexpr uint32_t const STRATEGY_ID_MIN = 0;
static constexpr uint32_t const STRATEGY_ID_MAX = (uint32_t{1} << 24) - 1;

static constexpr auto const STRATEGY_ID_NONE = STRATEGY_ID_MIN;

// account id (8 bits)

static constexpr uint8_t const ACCOUNT_MIN = 0;
static constexpr uint8_t const ACCOUNT_MAX = 255;

static constexpr auto const ACCOUNT_NONE = ACCOUNT_MIN;

// symbol id (24 bits)

static constexpr uint32_t const SYMBOL_ID_MIN = 0;
static constexpr uint32_t const SYMBOL_ID_MAX = (uint32_t{1} << 24) - 1;

static constexpr auto const SYMBOL_ID_NONE = SYMBOL_ID_MIN;

// instance id (4 bits)

static constexpr uint8_t const INSTANCE_MIN = 0;
static constexpr uint8_t const INSTANCE_MAX = (uint8_t{1} << 4) - 1;

static constexpr auto const INSTANCE_NONE = INSTANCE_MIN;

// validate auto-generated code

static_assert(sizeof(decltype(RateLimitTrigger::users)::value_type) == sizeof(User));
static_assert(sizeof(decltype(RateLimitTrigger::accounts)::value_type) == sizeof(Account));

static_assert(sizeof(decltype(Measurement::name)) == sizeof(MeasurementKey));

// check size of certain array items
// - frequent -- should be (reasonably) cache aligned
static_assert(sizeof(Layer) == 32);
static_assert(sizeof(MBPUpdate) == 32);
static_assert(sizeof(MBOUpdate) == 64);
static_assert(sizeof(Trade) == 192);
static_assert(sizeof(Statistics) == 32);
static_assert(sizeof(Measurement) == 16);
static_assert(sizeof(Route) == 8);
static_assert(sizeof(TickSizeStep) == 16);
// - not frequent -- not so important
static_assert(sizeof(Fill) == 136);
static_assert(sizeof(Parameter) == 196);
static_assert(sizeof(Position) == 144);
static_assert(sizeof(RiskLimit) == 152);

// NOLINTEND(readability-magic-numbers)

}  // namespace roq


================================================
FILE: include/roq/api.hpp.in
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

#pragma once

#include "roq/compat.hpp"

// convenience

#include "roq/limits.hpp"

// enums

#include "roq/action.hpp"
#include "roq/buffer_capacity.hpp"
#include "roq/category.hpp"
#include "roq/connection_status.hpp"
#include "roq/data_source.hpp"
#include "roq/encoding.hpp"
#include "roq/error.hpp"
#include "roq/execution_instruction.hpp"
#include "roq/filter.hpp"
#include "roq/interval.hpp"
#include "roq/liquidity.hpp"
#include "roq/margin_mode.hpp"
#include "roq/option_type.hpp"
#include "roq/order_cancel_policy.hpp"
#include "roq/order_management.hpp"
#include "roq/order_status.hpp"
#include "roq/order_type.hpp"
#include "roq/origin.hpp"
#include "roq/position_effect.hpp"
#include "roq/precision.hpp"
#include "roq/priority.hpp"
#include "roq/protocol.hpp"
#include "roq/quantity_type.hpp"
#include "roq/rate_limit_type.hpp"
#include "roq/request_id_type.hpp"
#include "roq/request_status.hpp"
#include "roq/request_type.hpp"
#include "roq/route_request_status.hpp"
#include "roq/security_type.hpp"
#include "roq/side.hpp"
#include "roq/state.hpp"
#include "roq/statistics_type.hpp"
#include "roq/support_type.hpp"
#include "roq/time_in_force.hpp"
#include "roq/trading_status.hpp"
#include "roq/transport.hpp"
#include "roq/update_action.hpp"
#include "roq/update_reason.hpp"
#include "roq/update_type.hpp"

// helpers

#include "roq/bar.hpp"
#include "roq/fill.hpp"
#include "roq/layer.hpp"
#include "roq/leg.hpp"
#include "roq/mbo_update.hpp"
#include "roq/mbp_update.hpp"
#include "roq/measurement.hpp"
#include "roq/parameter.hpp"
#include "roq/position.hpp"
#include "roq/quote.hpp"
#include "roq/rate_limit.hpp"
#include "roq/risk_limit.hpp"
#include "roq/route.hpp"
#include "roq/statistics.hpp"
#include "roq/tick_size_step.hpp"
#include "roq/trade.hpp"

// transport

#include "roq/message_info.hpp"

// control (autogen)

#include "roq/connected.hpp"
#include "roq/control.hpp"
#include "roq/control_ack.hpp"
#include "roq/disconnected.hpp"
#include "roq/legs_update.hpp"
#include "roq/service_update.hpp"
#include "roq/start.hpp"
#include "roq/stop.hpp"
#include "roq/strategy_update.hpp"
#include "roq/timer.hpp"

// messages (autogen)

#include "roq/add_market.hpp"
#include "roq/add_routes.hpp"
#include "roq/batch_begin.hpp"
#include "roq/batch_end.hpp"
#include "roq/cancel_all_orders.hpp"
#include "roq/cancel_all_orders_ack.hpp"
#include "roq/cancel_order.hpp"
#include "roq/cancel_quotes.hpp"
#include "roq/cancel_quotes_ack.hpp"
#include "roq/create_order.hpp"
#include "roq/custom_matrix.hpp"
#include "roq/custom_matrix_update.hpp"
#include "roq/custom_metrics.hpp"
#include "roq/custom_metrics_update.hpp"
#include "roq/download_begin.hpp"
#include "roq/download_end.hpp"
#include "roq/external_latency.hpp"
#include "roq/funds_update.hpp"
#include "roq/gateway_settings.hpp"
#include "roq/gateway_status.hpp"
#include "roq/market_by_order_update.hpp"
#include "roq/market_by_price_update.hpp"
#include "roq/market_status.hpp"
#include "roq/mass_quote.hpp"
#include "roq/mass_quote_ack.hpp"
#include "roq/modify_order.hpp"
#include "roq/order_ack.hpp"
#include "roq/order_update.hpp"
#include "roq/parameters_update.hpp"
#include "roq/portfolio.hpp"
#include "roq/portfolio_update.hpp"
#include "roq/position_update.hpp"
#include "roq/rate_limit_trigger.hpp"
#include "roq/rate_limits_update.hpp"
#include "roq/ready.hpp"
#include "roq/reference_data.hpp"
#include "roq/remove_routes.hpp"
#include "roq/risk_limits.hpp"
#include "roq/risk_limits_update.hpp"
#include "roq/route_ack.hpp"
#include "roq/statistics_update.hpp"
#include "roq/stream_status.hpp"
#include "roq/subscribe.hpp"
#include "roq/time_series_update.hpp"
#include "roq/top_of_book.hpp"
#include "roq/trade_summary.hpp"
#include "roq/trade_update.hpp"

// misc

#include "roq/exceptions.hpp"

// version

#define ROQ_VERSION "@ROQ_VERSION_MAJOR@.@ROQ_VERSION_MINOR@.@ROQ_VERSION_PATCH@"

namespace roq {

// NOLINTBEGIN(readability-magic-numbers)

// user id (8 bits)

static constexpr uint8_t const SOURCE_MIN = 0;
static constexpr uint8_t const SOURCE_MAX = 255;

static constexpr auto const SOURCE_NONE = SOURCE_MIN;
static constexpr auto const SOURCE_SELF = SOURCE_MAX;

// stream id (16 bits)

static constexpr uint16_t const STREAM_ID_MIN = 0;
static constexpr uint16_t const STREAM_ID_MAX = 65535;

static constexpr auto const STREAM_ID_NONE = STREAM_ID_MIN;

// order id (48 bits)

static constexpr uint64_t const ORDER_ID_MIN = 0;
static constexpr uint64_t const ORDER_ID_MAX = (uint64_t{1} << 48) - 1;

static constexpr auto const ORDER_ID_NONE = ORDER_ID_MIN;

// request version (24 bits)

static constexpr uint32_t const REQUEST_VERSION_MIN = 0;
static constexpr uint32_t const REQUEST_VERSION_MAX = (uint32_t{1} << 24) - 1;

static constexpr auto const REQUEST_VERSION_NONE = REQUEST_VERSION_MIN;

// strategy id (24 bits)

static constexpr uint32_t const STRATEGY_ID_MIN = 0;
static constexpr uint32_t const STRATEGY_ID_MAX = (uint32_t{1} << 24) - 1;

static constexpr auto const STRATEGY_ID_NONE = STRATEGY_ID_MIN;

// account id (8 bits)

static constexpr uint8_t const ACCOUNT_MIN = 0;
static constexpr uint8_t const ACCOUNT_MAX = 255;

static constexpr auto const ACCOUNT_NONE = ACCOUNT_MIN;

// symbol id (24 bits)

static constexpr uint32_t const SYMBOL_ID_MIN = 0;
static constexpr uint32_t const SYMBOL_ID_MAX = (uint32_t{1} << 24) - 1;

static constexpr auto const SYMBOL_ID_NONE = SYMBOL_ID_MIN;

// instance id (4 bits)

static constexpr uint8_t const INSTANCE_MIN = 0;
static constexpr uint8_t const INSTANCE_MAX = (uint8_t{1} << 4) - 1;

static constexpr auto const INSTANCE_NONE = INSTANCE_MIN;

// validate auto-generated code

static_assert(sizeof(decltype(RateLimitTrigger::users)::value_type) == sizeof(User));
static_assert(sizeof(decltype(RateLimitTrigger::accounts)::value_type) == sizeof(Account));

static_assert(sizeof(decltype(Measurement::name)) == sizeof(MeasurementKey));

// check size of certain array items
// - frequent -- should be (reasonably) cache aligned
static_assert(sizeof(Layer) == 32);
static_assert(sizeof(MBPUpdate) == 32);
static_assert(sizeof(MBOUpdate) == 64);
static_assert(sizeof(Trade) == 192);
static_assert(sizeof(Statistics) == 32);
static_assert(sizeof(Measurement) == 16);
static_assert(sizeof(Route) == 8);
static_assert(sizeof(TickSizeStep) == 16);
// - not frequent -- not so important
static_assert(sizeof(Fill) == 136);
static_assert(sizeof(Parameter) == 196);
static_assert(sizeof(Position) == 144);
static_assert(sizeof(RiskLimit) == 152);

// NOLINTEND(readability-magic-numbers)

}  // namespace roq


================================================
FILE: include/roq/args/parser.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

#pragma once

#include "roq/compat.hpp"

#include <span>
#include <string_view>

namespace roq {
namespace args {

struct ROQ_PUBLIC Parser {
  virtual ~Parser() = default;

  // note! c-style with first element being the program name
  virtual operator std::span<std::string_view const>() const = 0;

  auto program_name() const { return static_cast<std::span<std::string_view const>>(*this)[0]; }
  auto params() const { return static_cast<std::span<std::string_view const>>(*this).subspan(1); }
};

}  // namespace args
}  // namespace roq


================================================
FILE: include/roq/bar.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>

#include "roq/limits.hpp"

namespace roq {

//! Represents a single bar of a time-series
struct ROQ_PUBLIC Bar final {
  std::chrono::seconds begin_time_utc = {};  //!< Begin-of-period time-stamp (UTC)
  bool confirmed = false;                    //!< Confirmed?
  double open_price = roq::NaN;              //!< Open price
  double high_price = roq::NaN;              //!< High price
  double low_price = roq::NaN;               //!< Low price
  double close_price = roq::NaN;             //!< Close price
  double quantity = roq::NaN;                //!< Total quantity (contracts or base currency)
  double base_amount = roq::NaN;             //!< Total amount (base currency)
  double quote_amount = roq::NaN;            //!< Total amount (quote currency)
  uint32_t number_of_trades = {};            //!< Number of trades (count)
  double vwap = roq::NaN;                    //!< VWAP
};

}  // namespace roq

template <>
struct fmt::formatter<roq::Bar> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Bar const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(begin_time_utc={}, )"
        R"(confirmed={}, )"
        R"(open_price={}, )"
        R"(high_price={}, )"
        R"(low_price={}, )"
        R"(close_price={}, )"
        R"(quantity={}, )"
        R"(base_amount={}, )"
        R"(quote_amount={}, )"
        R"(number_of_trades={}, )"
        R"(vwap={})"
        R"(}})"sv,
        value.begin_time_utc,
        value.confirmed,
        value.open_price,
        value.high_price,
        value.low_price,
        value.close_price,
        value.quantity,
        value.base_amount,
        value.quote_amount,
        value.number_of_trades,
        value.vwap);
  }
};

================================================
FILE: include/roq/batch_begin.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Identifies the beginning of a sequence of related messages
struct ROQ_PUBLIC BatchBegin final {};

template <>
constexpr std::string_view get_name<BatchBegin>() {
  using namespace std::literals;
  return "batch_begin"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::BatchBegin> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::BatchBegin const &, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), R"({{}})"sv);
  }
};

================================================
FILE: include/roq/batch_end.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Identifies the end of a sequence of related messages
struct ROQ_PUBLIC BatchEnd final {};

template <>
constexpr std::string_view get_name<BatchEnd>() {
  using namespace std::literals;
  return "batch_end"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::BatchEnd> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::BatchEnd const &, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), R"({{}})"sv);
  }
};

================================================
FILE: include/roq/buffer_capacity.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <cstdint>

namespace roq {

//! Buffer capacity
enum class BufferCapacity : uint8_t {
  UNDEFINED = 0,
  EMPTY,            //!< Buffer is empty
  LOW_WATER_MARK,   //!< Buffer has reached the low water mark (from above)
  HIGH_WATER_MARK,  //!< Buffer has reached the high water mark (from below)
  FULL,             //!< Buffer is full
};

}  // namespace roq


================================================
FILE: include/roq/cancel_all_orders.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <string_view>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/side.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Cancel all orders (best effort)
struct ROQ_PUBLIC CancelAllOrders final {
  std::string_view account;   //!< Account name
  uint64_t order_id = {};     //!< Order identifier
  std::string_view exchange;  //!< Exchange
  std::string_view symbol;    //!< Symbol
  uint32_t strategy_id = {};  //!< Strategy identifier (optional)
  roq::Side side = {};        //!< Side
};

template <>
constexpr std::string_view get_name<CancelAllOrders>() {
  using namespace std::literals;
  return "cancel_all_orders"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::CancelAllOrders> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::CancelAllOrders const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(account="{}", )"
        R"(order_id={}, )"
        R"(exchange="{}", )"
        R"(symbol="{}", )"
        R"(strategy_id={}, )"
        R"(side={})"
        R"(}})"sv,
        value.account,
        value.order_id,
        value.exchange,
        value.symbol,
        value.strategy_id,
        value.side);
  }
};

================================================
FILE: include/roq/cancel_all_orders_ack.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <string_view>

#include "roq/error.hpp"
#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/origin.hpp"
#include "roq/request_status.hpp"
#include "roq/side.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Acknowledgement that a cancel all orders request has been seen by gateway/exchange
struct ROQ_PUBLIC CancelAllOrdersAck final {
  uint16_t stream_id = {};                           //!< Stream identifier
  std::string_view account;                          //!< Account name
  uint64_t order_id = {};                            //!< Order identifier
  std::string_view exchange;                         //!< Exchange
  std::string_view symbol;                           //!< Symbol
  roq::Side side = {};                               //!< Side
  roq::Origin origin = {};                           //!< Origin of ack
  roq::RequestStatus request_status = {};            //!< Request status
  roq::Error error = {};                             //!< Error code
  std::string_view text;                             //!< Descriptive text
  std::string_view request_id;                       //!< Request identifier
  std::string_view external_account;                 //!< External account name
  uint32_t number_of_affected_orders = {};           //!< Number of affected orders (optional, indicative)
  std::chrono::nanoseconds round_trip_latency = {};  //!< Round-trip latency between gateway and exchange
  std::string_view user;                             //!< User name (optional, only relevant for drop-copy)
  uint32_t strategy_id = {};                         //!< Strategy identifier (optional)
};

template <>
constexpr std::string_view get_name<CancelAllOrdersAck>() {
  using namespace std::literals;
  return "cancel_all_orders_ack"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::CancelAllOrdersAck> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::CancelAllOrdersAck const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(stream_id={}, )"
        R"(account="{}", )"
        R"(order_id={}, )"
        R"(exchange="{}", )"
        R"(symbol="{}", )"
        R"(side={}, )"
        R"(origin={}, )"
        R"(request_status={}, )"
        R"(error={}, )"
        R"(text="{}", )"
        R"(request_id="{}", )"
        R"(external_account="{}", )"
        R"(number_of_affected_orders={}, )"
        R"(round_trip_latency={}, )"
        R"(user="{}", )"
        R"(strategy_id={})"
        R"(}})"sv,
        value.stream_id,
        value.account,
        value.order_id,
        value.exchange,
        value.symbol,
        value.side,
        value.origin,
        value.request_status,
        value.error,
        value.text,
        value.request_id,
        value.external_account,
        value.number_of_affected_orders,
        value.round_trip_latency,
        value.user,
        value.strategy_id);
  }
};

================================================
FILE: include/roq/cancel_order.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <string_view>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Fields required to cancel an existing order
struct ROQ_PUBLIC CancelOrder final {
  std::string_view account;                        //!< Account name
  uint64_t order_id = {};                          //!< Order identifier
  std::string_view request_template;               //!< Request template (gateway configured)
  std::string_view routing_id;                     //!< Routing identifier
  uint32_t version = {};                           //!< Version number (strictly increasing, optional)
  uint32_t conditional_on_version = {};            //!< Auto-reject if this version has positively failed (optional)
  std::chrono::nanoseconds release_time_utc = {};  //!< Request release time (optional)
};

template <>
constexpr std::string_view get_name<CancelOrder>() {
  using namespace std::literals;
  return "cancel_order"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::CancelOrder> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::CancelOrder const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(account="{}", )"
        R"(order_id={}, )"
        R"(request_template="{}", )"
        R"(routing_id="{}", )"
        R"(version={}, )"
        R"(conditional_on_version={}, )"
        R"(release_time_utc={})"
        R"(}})"sv,
        value.account,
        value.order_id,
        value.request_template,
        value.routing_id,
        value.version,
        value.conditional_on_version,
        value.release_time_utc);
  }
};

================================================
FILE: include/roq/cancel_quotes.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <string_view>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Cancel quotes
struct ROQ_PUBLIC CancelQuotes final {
  std::string_view account;    //!< Account name
  uint16_t quote_set_id = {};  //!< Quote Request ID
};

template <>
constexpr std::string_view get_name<CancelQuotes>() {
  using namespace std::literals;
  return "cancel_quotes"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::CancelQuotes> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::CancelQuotes const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(account="{}", )"
        R"(quote_set_id={})"
        R"(}})"sv,
        value.account,
        value.quote_set_id);
  }
};

================================================
FILE: include/roq/cancel_quotes_ack.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <string_view>

#include "roq/error.hpp"
#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/origin.hpp"
#include "roq/request_status.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Acknowledgement that a cancel quotes request has been seen by gateway/exchange
struct ROQ_PUBLIC CancelQuotesAck final {
  uint16_t stream_id = {};                  //!< Stream identifier
  std::string_view account;                 //!< Account name
  roq::Origin origin = {};                  //!< Origin of ack
  roq::RequestStatus request_status = {};   //!< Request status
  roq::Error error = {};                    //!< Error code
  std::string_view text;                    //!< Descriptive text
  std::string_view request_id;              //!< Request identifier
  std::string_view external_account;        //!< External account name
  uint32_t number_of_affected_quotes = {};  //!< Number of affected quotes (optional, indicative)
};

template <>
constexpr std::string_view get_name<CancelQuotesAck>() {
  using namespace std::literals;
  return "cancel_quotes_ack"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::CancelQuotesAck> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::CancelQuotesAck const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(stream_id={}, )"
        R"(account="{}", )"
        R"(origin={}, )"
        R"(request_status={}, )"
        R"(error={}, )"
        R"(text="{}", )"
        R"(request_id="{}", )"
        R"(external_account="{}", )"
        R"(number_of_affected_quotes={})"
        R"(}})"sv,
        value.stream_id,
        value.account,
        value.origin,
        value.request_status,
        value.error,
        value.text,
        value.request_id,
        value.external_account,
        value.number_of_affected_quotes);
  }
};

================================================
FILE: include/roq/category.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <cstdint>

namespace roq {

//! Category (of data)
enum class Category : uint8_t {
  UNDEFINED = 0,
  PUBLIC,   //!< Public data
  PRIVATE,  //!< Private data
};

}  // namespace roq


================================================
FILE: include/roq/client/custom_message.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */
#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <span>

#include "roq/event.hpp"

namespace roq {
namespace client {

struct ROQ_PUBLIC CustomMessage final {
  std::span<std::byte const> message;
};

}  // namespace client

}  // namespace roq

template <>
struct fmt::formatter<roq::client::CustomMessage> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::client::CustomMessage const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(length={})"
        R"(}})"sv,
        std::size(value.message));
  }
};

template <>
struct fmt::formatter<roq::Event<roq::client::CustomMessage>> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Event<roq::client::CustomMessage> const &event, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(message_info={}, )"
        R"(custom_message={})"
        R"(}})"sv,
        event.message_info,
        event.value);
  }
};


================================================
FILE: include/roq/clock.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

#pragma once

#include <chrono>
#include <cstdint>
#include <ctime>

#include "roq/exceptions.hpp"

namespace roq {

namespace detail {
template <clockid_t clock>
inline auto get_time_helper() {
  struct timespec time;
  auto res = ::clock_gettime(clock, &time);
  if (res != 0) [[unlikely]] {
    using namespace std::literals;
    throw SystemError{std::error_code{errno, std::system_category()}, "clock_gettime"sv};
  }
  return std::chrono::nanoseconds{(static_cast<int64_t>(time.tv_sec) * INT64_C(1000000000)) + static_cast<int64_t>(time.tv_nsec)};
}
}  // namespace detail

namespace clock {
template <typename T = std::chrono::nanoseconds>
inline T get_system() {
  return std::chrono::duration_cast<T>(detail::get_time_helper<CLOCK_MONOTONIC>());
}

template <typename T = std::chrono::nanoseconds>
inline T get_realtime() {
  return std::chrono::duration_cast<T>(detail::get_time_helper<CLOCK_REALTIME>());
}
}  // namespace clock

}  // namespace roq


================================================
FILE: include/roq/compat.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

#pragma once

#include <cstddef>

#if defined(__GNUC__)
#define ROQ_PUBLIC __attribute__((visibility("default")))
#define ROQ_HOT __attribute__((hot))
#define ROQ_PACKED __attribute__((packed))
#else  // not gnuc
#if defined(__clang__)
#error "expected __clang__ to also define __GNUC__"
#endif
#error "unsupported compiler"
#endif

#if defined(__APPLE__)
// sysctl -a | grep -e vm.pagesize -e hw.cachelinesize
#if defined(__arm64__)
static constexpr size_t const ROQ_CACHELINE_SIZE = 128;
static constexpr size_t const ROQ_PAGE_SIZE = 16384;
#else  // not __arm64__
static constexpr size_t const ROQ_CACHELINE_SIZE = 64;
static constexpr size_t const ROQ_PAGE_SIZE = 4096;
#endif
#else  // not __APPLE__
// getconf -a | grep -e PAGE_SIZE -e LEVEL1_DCACHE_LINESIZE
static constexpr size_t const ROQ_CACHELINE_SIZE = 64;
static constexpr size_t const ROQ_PAGE_SIZE = 4096;
#endif


================================================
FILE: include/roq/connected.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Connected to gateway
struct ROQ_PUBLIC Connected final {};

template <>
constexpr std::string_view get_name<Connected>() {
  using namespace std::literals;
  return "connected"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::Connected> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Connected const &, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), R"({{}})"sv);
  }
};

================================================
FILE: include/roq/connection_status.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <cstdint>

namespace roq {

//! Enumeration of exchange connectivity status as seen from a gateway
enum class ConnectionStatus : uint8_t {
  UNDEFINED = 0,
  DISCONNECTED,  //!< Disconnected
  CONNECTING,    //!< Connecting
  LOGIN_SENT,    //!< Login sent
  DOWNLOADING,   //!< Downloading
  READY,         //!< Ready
  LOGGED_OUT,    //!< Logged out
};

}  // namespace roq


================================================
FILE: include/roq/control.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <string_view>

#include "roq/action.hpp"
#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Service control
struct ROQ_PUBLIC Control final {
  std::string_view request_id;  //!< Request identifier
  std::string_view user;        //!< User name (client routing, optional)
  roq::Action action = {};      //!< Action
  uint32_t strategy_id = {};    //!< Strategy filter (optional)
  uint16_t leg_id = {};         //!< Leg index filter (optional)
  std::string_view account;     //!< Account filter (optional)
  std::string_view exchange;    //!< Exchange filter (optional)
  std::string_view symbol;      //!< Symbol filter (optional)
};

template <>
constexpr std::string_view get_name<Control>() {
  using namespace std::literals;
  return "control"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::Control> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Control const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(request_id="{}", )"
        R"(user="{}", )"
        R"(action={}, )"
        R"(strategy_id={}, )"
        R"(leg_id={}, )"
        R"(account="{}", )"
        R"(exchange="{}", )"
        R"(symbol="{}")"
        R"(}})"sv,
        value.request_id,
        value.user,
        value.action,
        value.strategy_id,
        value.leg_id,
        value.account,
        value.exchange,
        value.symbol);
  }
};

================================================
FILE: include/roq/control_ack.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <string_view>

#include "roq/error.hpp"
#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/origin.hpp"
#include "roq/request_status.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Control ack
struct ROQ_PUBLIC ControlAck final {
  std::string_view request_id;             //!< Request identifier
  std::string_view user;                   //!< User name (client routing, optional)
  roq::Origin origin = {};                 //!< Origin of ack
  roq::RequestStatus request_status = {};  //!< Request status
  roq::Error error = {};                   //!< Error code
  std::string_view text;                   //!< Descriptive text
};

template <>
constexpr std::string_view get_name<ControlAck>() {
  using namespace std::literals;
  return "control_ack"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::ControlAck> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::ControlAck const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(request_id="{}", )"
        R"(user="{}", )"
        R"(origin={}, )"
        R"(request_status={}, )"
        R"(error={}, )"
        R"(text="{}")"
        R"(}})"sv,
        value.request_id,
        value.user,
        value.origin,
        value.request_status,
        value.error,
        value.text);
  }
};

================================================
FILE: include/roq/create_order.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <string_view>

#include "roq/event.hpp"
#include "roq/execution_instruction.hpp"
#include "roq/limits.hpp"
#include "roq/margin_mode.hpp"
#include "roq/mask.hpp"
#include "roq/name.hpp"
#include "roq/order_type.hpp"
#include "roq/position_effect.hpp"
#include "roq/quantity_type.hpp"
#include "roq/side.hpp"
#include "roq/time_in_force.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Fields required to create an order
struct ROQ_PUBLIC CreateOrder final {
  std::string_view account;                                     //!< Account name
  uint64_t order_id = {};                                       //!< Order identifier
  std::string_view exchange;                                    //!< Exchange
  std::string_view symbol;                                      //!< Symbol
  roq::Side side = {};                                          //!< Order side
  roq::PositionEffect position_effect = {};                     //!< Position effect
  roq::MarginMode margin_mode = {};                             //!< Margin mode
  roq::QuantityType quantity_type = {};                         //!< Type of quantity (requires ecxhange support)
  double max_show_quantity = roq::NaN;                          //!< Quantity visible to market (requires exchange support)
  roq::OrderType order_type = {};                               //!< Order type
  roq::TimeInForce time_in_force = {};                          //!< Time in force
  roq::Mask<roq::ExecutionInstruction> execution_instructions;  //!< Execution instructions
  std::string_view request_template;                            //!< Request template (gateway configured)
  double quantity = roq::NaN;                                   //!< Order quantity
  double price = roq::NaN;                                      //!< Limit price (depends on order_type)
  double stop_price = roq::NaN;                                 //!< Stop price (depends on order_type and time_in_force)
  double leverage = roq::NaN;                                   //!< Leverage (requires exchange support)
  std::string_view routing_id;                                  //!< Routing identifier
  uint32_t strategy_id = {};                                    //!< Strategy identifier (optional)
  std::chrono::nanoseconds release_time_utc = {};               //!< Request release time (optional)
};

template <>
constexpr std::string_view get_name<CreateOrder>() {
  using namespace std::literals;
  return "create_order"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::CreateOrder> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::CreateOrder const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(account="{}", )"
        R"(order_id={}, )"
        R"(exchange="{}", )"
        R"(symbol="{}", )"
        R"(side={}, )"
        R"(position_effect={}, )"
        R"(margin_mode={}, )"
        R"(quantity_type={}, )"
        R"(max_show_quantity={}, )"
        R"(order_type={}, )"
        R"(time_in_force={}, )"
        R"(execution_instructions={}, )"
        R"(request_template="{}", )"
        R"(quantity={}, )"
        R"(price={}, )"
        R"(stop_price={}, )"
        R"(leverage={}, )"
        R"(routing_id="{}", )"
        R"(strategy_id={}, )"
        R"(release_time_utc={})"
        R"(}})"sv,
        value.account,
        value.order_id,
        value.exchange,
        value.symbol,
        value.side,
        value.position_effect,
        value.margin_mode,
        value.quantity_type,
        value.max_show_quantity,
        value.order_type,
        value.time_in_force,
        value.execution_instructions,
        value.request_template,
        value.quantity,
        value.price,
        value.stop_price,
        value.leverage,
        value.routing_id,
        value.strategy_id,
        value.release_time_utc);
  }
};

================================================
FILE: include/roq/custom_matrix.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>
#include <fmt/ranges.h>

#include <magic_enum/magic_enum_format.hpp>

#include <span>
#include <string_view>

#include "roq/event.hpp"
#include "roq/limits.hpp"
#include "roq/name.hpp"
#include "roq/string_types.hpp"
#include "roq/trace.hpp"
#include "roq/update_type.hpp"

namespace roq {

//! Custom matrix (publish)
struct ROQ_PUBLIC CustomMatrix final {
  std::string_view label;                   //!< Label
  std::string_view account;                 //!< Account name
  std::string_view exchange;                //!< Exchange
  std::string_view symbol;                  //!< Symbol
  std::span<roq::MatrixKey const> rows;     //!< row labels
  std::span<roq::MatrixKey const> columns;  //!< column labels
  std::span<double const> data;             //!< matrix
  roq::UpdateType update_type = {};         //!< Update type
  uint32_t version = {};                    //!< Version number (does not have to be sequential)
};

template <>
constexpr std::string_view get_name<CustomMatrix>() {
  using namespace std::literals;
  return "custom_matrix"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::CustomMatrix> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::CustomMatrix const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(label="{}", )"
        R"(account="{}", )"
        R"(exchange="{}", )"
        R"(symbol="{}", )"
        R"(rows=[{}], )"
        R"(columns=[{}], )"
        R"(data=[{}], )"
        R"(update_type={}, )"
        R"(version={})"
        R"(}})"sv,
        value.label,
        value.account,
        value.exchange,
        value.symbol,
        fmt::join(value.rows, ", "sv),
        fmt::join(value.columns, ", "sv),
        fmt::join(value.data, ", "sv),
        value.update_type,
        value.version);
  }
};

================================================
FILE: include/roq/custom_matrix_update.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>
#include <fmt/ranges.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <span>
#include <string_view>

#include "roq/event.hpp"
#include "roq/limits.hpp"
#include "roq/name.hpp"
#include "roq/string_types.hpp"
#include "roq/trace.hpp"
#include "roq/update_type.hpp"

namespace roq {

//! Custom matrix (receive)
struct ROQ_PUBLIC CustomMatrixUpdate final {
  std::string_view label;                          //!< Label
  std::string_view account;                        //!< Account name
  std::string_view exchange;                       //!< Exchange
  std::string_view symbol;                         //!< Symbol
  std::span<roq::MatrixKey const> rows;            //!< row labels
  std::span<roq::MatrixKey const> columns;         //!< column labels
  std::span<double const> data;                    //!< matrix
  roq::UpdateType update_type = {};                //!< Update type
  uint32_t version = {};                           //!< Version number (does not have to be sequential)
  std::chrono::nanoseconds sending_time_utc = {};  //!< Exchange sending timestamp (UTC)
  std::string_view user;                           //!< User name (origin)
};

template <>
constexpr std::string_view get_name<CustomMatrixUpdate>() {
  using namespace std::literals;
  return "custom_matrix_update"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::CustomMatrixUpdate> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::CustomMatrixUpdate const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(label="{}", )"
        R"(account="{}", )"
        R"(exchange="{}", )"
        R"(symbol="{}", )"
        R"(rows=[{}], )"
        R"(columns=[{}], )"
        R"(data=[{}], )"
        R"(update_type={}, )"
        R"(version={}, )"
        R"(sending_time_utc={}, )"
        R"(user="{}")"
        R"(}})"sv,
        value.label,
        value.account,
        value.exchange,
        value.symbol,
        fmt::join(value.rows, ", "sv),
        fmt::join(value.columns, ", "sv),
        fmt::join(value.data, ", "sv),
        value.update_type,
        value.version,
        value.sending_time_utc,
        value.user);
  }
};

================================================
FILE: include/roq/custom_metrics.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>
#include <fmt/ranges.h>

#include <magic_enum/magic_enum_format.hpp>

#include <span>
#include <string_view>

#include "roq/event.hpp"
#include "roq/measurement.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"
#include "roq/update_type.hpp"

namespace roq {

//! Custom metrics (publish)
struct ROQ_PUBLIC CustomMetrics final {
  std::string_view label;                          //!< Label
  std::string_view account;                        //!< Account name
  std::string_view exchange;                       //!< Exchange
  std::string_view symbol;                         //!< Symbol
  std::span<roq::Measurement const> measurements;  //!< List of measurements
  roq::UpdateType update_type = {};                //!< Update type
};

template <>
constexpr std::string_view get_name<CustomMetrics>() {
  using namespace std::literals;
  return "custom_metrics"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::CustomMetrics> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::CustomMetrics const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(label="{}", )"
        R"(account="{}", )"
        R"(exchange="{}", )"
        R"(symbol="{}", )"
        R"(measurements=[{}], )"
        R"(update_type={})"
        R"(}})"sv,
        value.label,
        value.account,
        value.exchange,
        value.symbol,
        fmt::join(value.measurements, ", "sv),
        value.update_type);
  }
};

================================================
FILE: include/roq/custom_metrics_update.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>
#include <fmt/ranges.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <span>
#include <string_view>

#include "roq/event.hpp"
#include "roq/measurement.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"
#include "roq/update_type.hpp"

namespace roq {

//! Custom metrics (receive)
struct ROQ_PUBLIC CustomMetricsUpdate final {
  std::string_view label;                          //!< Label
  std::string_view account;                        //!< Account name
  std::string_view exchange;                       //!< Exchange
  std::string_view symbol;                         //!< Symbol
  std::span<roq::Measurement const> measurements;  //!< List of measurements
  roq::UpdateType update_type = {};                //!< Update type
  std::chrono::nanoseconds sending_time_utc = {};  //!< Exchange sending timestamp (UTC)
  std::string_view user;                           //!< User name (origin)
};

template <>
constexpr std::string_view get_name<CustomMetricsUpdate>() {
  using namespace std::literals;
  return "custom_metrics_update"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::CustomMetricsUpdate> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::CustomMetricsUpdate const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(label="{}", )"
        R"(account="{}", )"
        R"(exchange="{}", )"
        R"(symbol="{}", )"
        R"(measurements=[{}], )"
        R"(update_type={}, )"
        R"(sending_time_utc={}, )"
        R"(user="{}")"
        R"(}})"sv,
        value.label,
        value.account,
        value.exchange,
        value.symbol,
        fmt::join(value.measurements, ", "sv),
        value.update_type,
        value.sending_time_utc,
        value.user);
  }
};

================================================
FILE: include/roq/data_source.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <cstdint>

namespace roq {

//! Enumeration of time-series data sources
enum class DataSource : uint8_t {
  UNDEFINED = 0,
  TRADE_SUMMARY,  //!< Trades
};

}  // namespace roq


================================================
FILE: include/roq/decimal.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

#pragma once

#include <fmt/format.h>

#include "roq/limits.hpp"
#include "roq/precision.hpp"

namespace roq {

struct Decimal final {
  Decimal() = default;

  Decimal(double value, Precision precision) : value_{value}, precision_{precision} {}

  bool empty() const { return std::isnan(value_); }

  operator double() const { return value_; }
  operator Precision() const { return precision_; }

 private:
  double value_ = NaN;
  Precision precision_ = {};
};

}  // namespace roq

template <>
struct fmt::formatter<roq::Decimal> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Decimal const &value, format_context &context) const {
    constexpr auto helper = [](auto precision) {
      using result_type = int8_t;
      if (precision >= roq::Precision::_0 && precision <= roq::Precision::_15) {
        return static_cast<result_type>(precision) - static_cast<result_type>(roq::Precision::_0);
      }
      return -1;
    };
    // NOLINTBEGIN(readability-magic-numbers)
    static_assert(helper(roq::Precision::UNDEFINED) == -1);
    static_assert(helper(roq::Precision::_0) == 0);
    static_assert(helper(roq::Precision::_15) == 15);
    // NOLINTEND(readability-magic-numbers)
    using namespace std::literals;
    auto decimal_digits = helper(static_cast<roq::Precision>(value));
    if (decimal_digits >= 0) {
      return fmt::format_to(context.out(), "{:.{}f}"sv, static_cast<double>(value), decimal_digits);
    }
    return fmt::format_to(context.out(), "{}"sv, static_cast<double>(value));
  }
};


================================================
FILE: include/roq/disconnected.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/order_cancel_policy.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Disconnected
struct ROQ_PUBLIC Disconnected final {
  roq::OrderCancelPolicy order_cancel_policy = {};  //!< Cancel orders on disconnect?
};

template <>
constexpr std::string_view get_name<Disconnected>() {
  using namespace std::literals;
  return "disconnected"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::Disconnected> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Disconnected const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(order_cancel_policy={})"
        R"(}})"sv,
        value.order_cancel_policy);
  }
};

================================================
FILE: include/roq/download_begin.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <string_view>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Identifies the beginning of a download sequence
struct ROQ_PUBLIC DownloadBegin final {
  std::string_view account;  //!< Account name
};

template <>
constexpr std::string_view get_name<DownloadBegin>() {
  using namespace std::literals;
  return "download_begin"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::DownloadBegin> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::DownloadBegin const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(account="{}")"
        R"(}})"sv,
        value.account);
  }
};

================================================
FILE: include/roq/download_end.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <string_view>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Identifies the end of a download sequence
struct ROQ_PUBLIC DownloadEnd final {
  std::string_view account;    //!< Account name
  uint64_t max_order_id = {};  //!< Highest previous order identifier (as seen by gateway)
};

template <>
constexpr std::string_view get_name<DownloadEnd>() {
  using namespace std::literals;
  return "download_end"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::DownloadEnd> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::DownloadEnd const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(account="{}", )"
        R"(max_order_id={})"
        R"(}})"sv,
        value.account,
        value.max_order_id);
  }
};

================================================
FILE: include/roq/encoding.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <fmt/format.h>

#include <cstdint>
#include <cstdlib>

namespace roq {

//! Enumeration of message encoding types (informational, only)
enum class Encoding : uint32_t {  // NOLINT(performance-enum-size)
  UNDEFINED = 0,
  FIX = 0x1,   //!< FIX
  JSON = 0x2,  //!< JSON
  SBE = 0x4,   //!< SBE
  FBS = 0x8,   //!< FlatBuffers
};

}  // namespace roq

template <>
struct fmt::formatter<roq::Encoding> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Encoding const &value, format_context &context) const {
    using namespace std::literals;
    auto name = [&]() -> std::string_view {
      switch (value) {
        using enum roq::Encoding;
        case UNDEFINED:
          return "UNDEFINED"sv;
        case FIX:
          return "FIX"sv;
        case JSON:
          return "JSON"sv;
        case SBE:
          return "SBE"sv;
        case FBS:
          return "FBS"sv;
      }
      std::abort();
    }();
    return fmt::format_to(context.out(), "{}"sv, name);
  }
};

================================================
FILE: include/roq/error.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <cstdint>

namespace roq {

//! Enumeration of error types
enum class Error : uint8_t {
  UNDEFINED = 0,
  UNKNOWN,
  NOT_SUPPORTED,                   //!< Request type not supported
  INVALID_ACCOUNT,                 //!< Invalid account
  INVALID_ORDER_ID,                //!< Invalid order ID
  INVALID_EXCHANGE,                //!< Invalid exchange
  INVALID_SYMBOL,                  //!< Invalid symbol
  INVALID_SIDE,                    //!< Invalid side
  INVALID_POSITION_EFFECT,         //!< Invalid position effect
  INVALID_QUANTITY,                //!< Invalid quantity
  INVALID_MAX_SHOW_QUANTITY,       //!< Invalid max show quantity
  INVALID_ORDER_TYPE,              //!< Invalid order type
  INVALID_TIME_IN_FORCE,           //!< Invalid time in force
  INVALID_EXECUTION_INSTRUCTION,   //!< Invalid execution instruction
  INVALID_REQUEST_TEMPLATE,        //!< Invalid request template
  INVALID_PRICE,                   //!< Invalid price
  INVALID_STOP_PRICE,              //!< Invalid stop price
  INVALID_ROUTING_ID,              //!< Invalid routing ID
  INVALID_REQUEST_VERSION,         //!< Invalid request version
  INVALID_REQUEST_ID,              //!< Invalid request ID
  INVALID_REQUEST_TYPE,            //!< Invalid request type
  INVALID_REQUEST_STATUS,          //!< Invalid request status
  INVALID_REQUEST_ARGS,            //!< Request arguments did not meet validation rules
  UNKNOWN_EXTERNAL_ORDER_ID,       //!< An external order identifier has not yet been received
  NOT_AUTHORIZED,                  //!< User is not authorized
  REQUEST_RATE_LIMIT_REACHED,      //!< Request rate limit has been reached
  GATEWAY_NOT_READY,               //!< Gateway not ready (could be disconnected or currently downloading)
  NETWORK_ERROR,                   //!< Network disconnect event (unknown request/order status)
  TIMEOUT,                         //!< Response has not been received (unknown request/order status)
  PARSE_ERROR,                     //!< Message parse error (unknown request/order status)
  MODIFY_HAS_NO_EFFECT,            //!< Modify request has no effect on order
  TOO_LATE_TO_MODIFY_OR_CANCEL,    //!< Too late to modify or cancel (order has been filled or is already canceled)
  CONDITIONAL_REQUEST_HAS_FAILED,  //!< Happens when gateway detects chain failure
  UNKNOWN_ORDER_ID,                //!< Unknown order ID
  INSUFFICIENT_FUNDS,              //!< Insufficient funds for order action
  RISK_LIMIT_REACHED,              //!< Risk limit reached
  INVALID_FILTER,                  //!< Invalid filter
  INVALID_MARGIN_MODE,             //!< Invalid margin mode
  INVALID_QUANTITY_TYPE,           //!< Invalid quantity type
  INVALID_RELEASE_TIME,            //!< Invalid release time
};

}  // namespace roq


================================================
FILE: include/roq/event.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

#pragma once

#include <fmt/format.h>

#include <type_traits>
#include <utility>

#include "roq/message_info.hpp"
#include "roq/name.hpp"

namespace roq {

//! Event
template <typename T>
struct Event final {
  using value_type = std::remove_cvref_t<T>;

  Event(MessageInfo const &message_info, T const &value) : message_info{message_info}, value{value} {}

  Event(Event &&) = delete;
  Event(Event const &) = delete;

  void operator=(Event &&) = delete;
  void operator=(Event const &) = delete;

  //! Dispatch to handler
  template <typename Result, typename Handler, typename... Args>
  Result dispatch(Handler &&handler, Args &&...args) const {
    return handler(*this, std::forward<Args>(args)...);
  }

  //! Access MessageInfo
  operator MessageInfo const &() const { return message_info; }

  //! Access Message
  operator value_type const &() const { return value; }

  //! Structured binding
  operator std::pair<MessageInfo const &, value_type const &>() const { return {message_info, value}; }

  MessageInfo const &message_info;  //!< MessageInfo
  value_type const &value;          //!< Message

  //! Create event and dispatch to handler
  template <typename... Args>
  static void create_and_dispatch(auto &handler, MessageInfo const &message_info, T const &value, Args &&...args) {
    Event const event{message_info, value};
    return event.template dispatch<void>(handler, std::forward<Args>(args)...);
  }
};

//! Create event and dispatch to handler
template <typename T, typename... Args>
inline void create_event_and_dispatch(auto &handler, MessageInfo const &message_info, T const &value, Args &&...args) {
  return Event<T>::create_and_dispatch(handler, message_info, value, std::forward<Args>(args)...);
}

}  // namespace roq

template <typename T>
struct fmt::formatter<roq::Event<T>> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Event<T> const &event, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"({}={}, )"
        R"(message_info={})"
        R"(}})"sv,
        roq::get_name<T>(),
        event.value,
        event.message_info);
  }
};


================================================
FILE: include/roq/exceptions.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <stdexcept>
#include <string>
#include <string_view>
#include <system_error>
#include <typeinfo>
#include <utility>

#include "roq/error.hpp"
#include "roq/format_str.hpp"
#include "roq/request_status.hpp"

namespace roq {

namespace detail {
template <typename... Args>
constexpr auto create_what(fmt::string_view const &str, Args &&...args) -> std::string {
  if (std::size(str) == 0) {
    return {};
  }
  if constexpr (sizeof...(args) == 0) {
    return {std::data(str), std::size(str)};
  } else {
    // XXX FIXME TODO fmt::format_string
    return fmt::vformat(str, fmt::make_format_args(args...));
  }
}
}  // namespace detail

// This class hierarchy is *similar to* that of std::exception,
// but not trying to be a mirror!
// The reason is that a mirrored exception hierarchy would require multiple
// inheritance and then cause issues with catch handlers.
// The implication is that you must implement two exception handlers,
// e.g.
//   try {
//     ...
//   } catch (std::overflow_error&) {
//     ...
//   } catch (roq::OverflowError&) {
//     ...
//   }

//! Base
struct ROQ_PUBLIC Exception : public std::exception {
  template <typename... Args>
  explicit Exception(format_str const &str, Args &&...args)
      : file_name_{str.file_name}, line_{str.line}, what_{detail::create_what(str.str, std::forward<Args>(args)...)} {}

  char const *what() const noexcept override { return what_.c_str(); }

  virtual std::string_view file() const noexcept { return file_name_; }
  virtual int line() const noexcept { return static_cast<int>(line_); }

  template <typename Context>
  auto format_to(Context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(type="{}", )"
        R"(what="{}", )"
        R"(file="{}", )"
        R"(line={})"
        R"(}})"sv,
        typeid(*this).name(),
        what_,
        file_name_,
        line_);
  }

 protected:
  detail::static_string<32> const file_name_;
  uint32_t const line_;
  std::string const what_;
};

//! Runtime error
struct ROQ_PUBLIC RuntimeError : public Exception {
  using Exception::Exception;
};

//! SystemError
struct ROQ_PUBLIC SystemError : public RuntimeError {
 public:
  std::error_code const &code() const noexcept { return error_; }

  template <typename... Args>
  SystemError(std::error_code error, format_str const &fmt, Args &&...args) : RuntimeError{fmt, std::forward<Args>(args)...}, error_{error} {}

  template <typename Context>
  auto format_to(Context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(type="{}", )"
        R"(what="{}", )"
        R"(file="{}", )"
        R"(line={}, )"
        R"(error_code={{)"
        R"(message="{}", )"
        R"(value={})"
        R"(}})"
        R"(}})"sv,
        typeid(*this).name(),
        what_,
        file_name_,
        line_,
        error_.message(),
        error_.value());
  }

 private:
  std::error_code const error_;
};

//! RangeError
struct ROQ_PUBLIC RangeError : public RuntimeError {
  using RuntimeError::RuntimeError;
};

//! OverflowError
struct ROQ_PUBLIC OverflowError : public RuntimeError {
  using RuntimeError::RuntimeError;
};

//! LogicError
struct ROQ_PUBLIC LogicError : public Exception {
  using Exception::Exception;
};

//! InvalidArgument
struct ROQ_PUBLIC InvalidArgument : public LogicError {
  using LogicError::LogicError;
};

//! OutOfRange
struct ROQ_PUBLIC OutOfRange : public LogicError {
  using LogicError::LogicError;
};

//! LengthError
struct ROQ_PUBLIC LengthError : public LogicError {
  using LogicError::LogicError;
};

// ROQ SPECIFIC

//! Fatal
struct ROQ_PUBLIC Fatal : public RuntimeError {
  using RuntimeError::RuntimeError;
};

//! File does not exist
struct ROQ_PUBLIC FileDoesNotExist : public RuntimeError {
  using RuntimeError::RuntimeError;
};

//! Not ready
struct ROQ_PUBLIC NotReady : public RuntimeError {
  using RuntimeError::RuntimeError;
};

//! Not implemented
struct ROQ_PUBLIC NotImplemented : public RuntimeError {
  using RuntimeError::RuntimeError;
};

//! Not supported
struct ROQ_PUBLIC NotSupported : public RuntimeError {
  using RuntimeError::RuntimeError;
};

//! Bad state
struct ROQ_PUBLIC BadState : public RuntimeError {
  using RuntimeError::RuntimeError;
};

// network errors

//! Base class for network errors
struct ROQ_PUBLIC NetworkError : public RuntimeError {
  template <typename... Args>
  NetworkError(RequestStatus request_status, Error error, format_str const &fmt, Args &&...args)
      : RuntimeError{fmt, std::forward<Args>(args)...}, request_status_{request_status}, error_{error} {}

  RequestStatus request_status() const noexcept { return request_status_; }
  Error error() const noexcept { return error_; }

 private:
  RequestStatus const request_status_;
  Error const error_;
};

// transport errors

//! Base class for transport errors
struct ROQ_PUBLIC TransportError : public NetworkError {
  using NetworkError::NetworkError;
};

//! Not connected
struct ROQ_PUBLIC NotConnected : public TransportError {
  template <typename... Args>
  explicit NotConnected(format_str const &fmt, Args &&...args)
      : TransportError{RequestStatus::REJECTED, Error::GATEWAY_NOT_READY, fmt, std::forward<Args>(args)...} {}
};

//! Connection refused
struct ROQ_PUBLIC ConnectionRefused : public TransportError {
  template <typename... Args>
  explicit ConnectionRefused(format_str const &fmt, Args &&...args)
      : TransportError{RequestStatus::REJECTED, Error::GATEWAY_NOT_READY, fmt, std::forward<Args>(args)...} {}
};

//! Timed out
struct ROQ_PUBLIC TimedOut : public TransportError {
  template <typename... Args>
  explicit TimedOut(format_str const &fmt, Args &&...args) : TransportError{RequestStatus::TIMEOUT, Error::TIMEOUT, fmt, std::forward<Args>(args)...} {}
};

// session errors

//! Base class for session errors
struct ROQ_PUBLIC SessionError : public NetworkError {
  using NetworkError::NetworkError;
};

//! Permissions denied (operating system)
struct ROQ_PUBLIC PermissionDenied : public SessionError {
  template <typename... Args>
  explicit PermissionDenied(format_str const &fmt, Args &&...args)
      : SessionError{RequestStatus::UNDEFINED, Error::UNDEFINED, fmt, std::forward<Args>(args)...} {}
};

//! Order not live
struct ROQ_PUBLIC OrderNotLive : public SessionError {
  template <typename... Args>
  explicit OrderNotLive(format_str const &fmt, Args &&...args)
      : SessionError{RequestStatus::REJECTED, Error::TOO_LATE_TO_MODIFY_OR_CANCEL, fmt, std::forward<Args>(args)...} {}
};
}  // namespace roq

template <>
struct fmt::formatter<roq::Exception> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Exception const &value, format_context &context) const { return value.format_to(context); }
};

template <>
struct fmt::formatter<roq::RuntimeError> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::RuntimeError const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::SystemError> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::SystemError const &value, format_context &context) const { return value.format_to(context); }
};

template <>
struct fmt::formatter<roq::RangeError> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::RangeError const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::OverflowError> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::OverflowError const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::LogicError> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::LogicError const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::InvalidArgument> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::InvalidArgument const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::OutOfRange> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::OutOfRange const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::LengthError> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::LengthError const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::Fatal> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Fatal const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::FileDoesNotExist> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::FileDoesNotExist const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::NotReady> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::NotReady const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::BadState> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::BadState const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::NetworkError> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::NetworkError const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::TransportError> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::TransportError const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::NotConnected> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::NotConnected const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::ConnectionRefused> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::ConnectionRefused const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::TimedOut> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::TimedOut const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::SessionError> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::SessionError const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::PermissionDenied> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::PermissionDenied const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};

template <>
struct fmt::formatter<roq::OrderNotLive> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::OrderNotLive const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<roq::Exception const &>(value));
  }
};


================================================
FILE: include/roq/execution_instruction.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <fmt/format.h>

#include <cstdint>
#include <cstdlib>

namespace roq {

//! Enumeration of execution types
enum class ExecutionInstruction : uint32_t {  // NOLINT(performance-enum-size)
  UNDEFINED = 0,
  PARTICIPATE_DO_NOT_INITIATE = 0x1,  //!< Cancel if order would have executed on placement (i.e. not as maker)
  CANCEL_IF_NOT_BEST = 0x2,           //!< Cancel if order can not be placed at best price
  DO_NOT_INCREASE = 0x4,              //!< Order may only reduce net position, order quantity can automatically be reduced by exchange
  DO_NOT_REDUCE = 0x8,                //!< Order can not be partially filled, aka. all-or-none (AON) orders
};

}  // namespace roq

template <>
struct fmt::formatter<roq::ExecutionInstruction> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::ExecutionInstruction const &value, format_context &context) const {
    using namespace std::literals;
    auto name = [&]() -> std::string_view {
      switch (value) {
        using enum roq::ExecutionInstruction;
        case UNDEFINED:
          return "UNDEFINED"sv;
        case PARTICIPATE_DO_NOT_INITIATE:
          return "PARTICIPATE_DO_NOT_INITIATE"sv;
        case CANCEL_IF_NOT_BEST:
          return "CANCEL_IF_NOT_BEST"sv;
        case DO_NOT_INCREASE:
          return "DO_NOT_INCREASE"sv;
        case DO_NOT_REDUCE:
          return "DO_NOT_REDUCE"sv;
      }
      std::abort();
    }();
    return fmt::format_to(context.out(), "{}"sv, name);
  }
};

================================================
FILE: include/roq/external_latency.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <string_view>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Update relating to external latency
struct ROQ_PUBLIC ExternalLatency final {
  uint16_t stream_id = {};                //!< Stream identifier
  std::string_view account;               //!< Account name
  std::chrono::nanoseconds latency = {};  //!< latency measurement (1-way)
};

template <>
constexpr std::string_view get_name<ExternalLatency>() {
  using namespace std::literals;
  return "external_latency"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::ExternalLatency> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::ExternalLatency const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(stream_id={}, )"
        R"(account="{}", )"
        R"(latency={})"
        R"(}})"sv,
        value.stream_id,
        value.account,
        value.latency);
  }
};

================================================
FILE: include/roq/fill.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>

#include "roq/limits.hpp"
#include "roq/liquidity.hpp"
#include "roq/string_types.hpp"

namespace roq {

//! Represents a single fill (match) when an order is being partially or fully filled
struct ROQ_PUBLIC Fill final {
  std::chrono::nanoseconds exchange_time_utc = {};  //!< Exchange timestamp, possibly from matching engine (UTC)
  roq::ExternalTradeId external_trade_id;           //!< External trade identifier
  double quantity = roq::NaN;                       //!< Quantity
  double price = roq::NaN;                          //!< Price
  roq::Liquidity liquidity = {};                    //!< Liquidity indicator
  double commission_amount = roq::NaN;              //!< Funds (commission currency, optional)
  roq::Currency commission_currency;                //!< Commission currency
  double base_amount = roq::NaN;                    //!< Funds (base currency, internal)
  double quote_amount = roq::NaN;                   //!< Funds (quote currency, internal)
  double profit_loss_amount = roq::NaN;             //!< P&L (settlement currency, internal)
};

}  // namespace roq

template <>
struct fmt::formatter<roq::Fill> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Fill const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(exchange_time_utc={}, )"
        R"(external_trade_id="{}", )"
        R"(quantity={}, )"
        R"(price={}, )"
        R"(liquidity={}, )"
        R"(commission_amount={}, )"
        R"(commission_currency="{}", )"
        R"(base_amount={}, )"
        R"(quote_amount={}, )"
        R"(profit_loss_amount={})"
        R"(}})"sv,
        value.exchange_time_utc,
        value.external_trade_id,
        value.quantity,
        value.price,
        value.liquidity,
        value.commission_amount,
        value.commission_currency,
        value.base_amount,
        value.quote_amount,
        value.profit_loss_amount);
  }
};

================================================
FILE: include/roq/filter.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <fmt/format.h>

#include <cstdint>
#include <cstdlib>

namespace roq {

//! Enumeration of filter fields
enum class Filter : uint64_t {  // NOLINT(performance-enum-size)
  UNDEFINED = 0,
  ACCOUNT = 0x1,      //!< By account
  EXCHANGE = 0x2,     //!< By exchange
  SYMBOL = 0x4,       //!< By symbol
  STRATEGY_ID = 0x8,  //!< By strategy_id
  SIDE = 0x10,        //!< By side
};

}  // namespace roq

template <>
struct fmt::formatter<roq::Filter> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Filter const &value, format_context &context) const {
    using namespace std::literals;
    auto name = [&]() -> std::string_view {
      switch (value) {
        using enum roq::Filter;
        case UNDEFINED:
          return "UNDEFINED"sv;
        case ACCOUNT:
          return "ACCOUNT"sv;
        case EXCHANGE:
          return "EXCHANGE"sv;
        case SYMBOL:
          return "SYMBOL"sv;
        case STRATEGY_ID:
          return "STRATEGY_ID"sv;
        case SIDE:
          return "SIDE"sv;
      }
      std::abort();
    }();
    return fmt::format_to(context.out(), "{}"sv, name);
  }
};

================================================
FILE: include/roq/format_str.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

#pragma once

#include <fmt/format.h>

#include <array>
#include <source_location>
#include <string_view>

// capture source location

namespace roq {

namespace detail {
// compile-time evaluated string
template <std::size_t N>
struct static_string final {
  consteval static_string(std::string_view const &str) : length_{std::min(N, std::size(str))}, buffer_{create(str, length_)} {}

  static_string(static_string &&) = delete;
  static_string(static_string const &) = default;

  constexpr operator std::string_view() const { return {std::data(buffer_), length_}; }

 protected:
  static consteval auto create(std::string_view const &str, std::size_t length) {
    static_assert(N > 0);
    std::array<char, N> buffer;
    for (std::size_t i = 0; i < length; ++i) {
      buffer[i] = str[i];
    }
    for (std::size_t i = length; i < N; ++i) {
      buffer[i] = '\0';
    }
    return buffer;
  }

 private:
  std::size_t const length_;
  std::array<char, N> const buffer_;
};
}  // namespace detail

struct format_str final {
  template <typename T>
  consteval format_str(T const &str, std::source_location const loc = std::source_location::current())
      : str{str}, file_name{extract_basename(loc.file_name())}, line{loc.line()} {}

  // note! string could be truncated
  using file_name_type = detail::static_string<32>;  // NOLINT(readability-magic-numbers)

  std::string_view const str;
  file_name_type const file_name;
  std::uint32_t const line;

 private:
  static consteval std::string_view extract_basename(char const *path) {
    if (path == nullptr) {
      return {};
    }
    std::string_view tmp{path};
    if (std::empty(tmp)) {
      return tmp;
    }
    auto pos = tmp.find_last_of('/');
    if (pos == std::string_view::npos || pos == (std::size(tmp) - 1)) {
      return tmp;
    }
    return tmp.substr(++pos);
  }
};
}  // namespace roq

template <size_t N>
struct fmt::formatter<roq::detail::static_string<N>> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::detail::static_string<N> const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(context.out(), "{}"sv, static_cast<std::string_view>(value));
  }
};


================================================
FILE: include/roq/funds_update.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <string_view>

#include "roq/event.hpp"
#include "roq/limits.hpp"
#include "roq/margin_mode.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"
#include "roq/update_type.hpp"

namespace roq {

//! Update relating to available funds
struct ROQ_PUBLIC FundsUpdate final {
  uint16_t stream_id = {};                          //!< Stream identifier
  std::string_view account;                         //!< Account name
  std::string_view currency;                        //!< Currency
  roq::MarginMode margin_mode = {};                 //!< Margin mode
  double balance = roq::NaN;                        //!< Total funds
  double hold = roq::NaN;                           //!< Funds on hold (aka locked)
  double borrowed = roq::NaN;                       //!< Borrowed funds (margin trading)
  double unrealized_pnl = roq::NaN;                 //!< Unrealized P&L
  std::string_view external_account;                //!< External account name
  roq::UpdateType update_type = {};                 //!< Update type
  std::chrono::nanoseconds exchange_time_utc = {};  //!< Exchange timestamp, possibly from matching engine (UTC)
  uint64_t exchange_sequence = {};                  //!< Exchange message sequence number
  std::chrono::nanoseconds sending_time_utc = {};   //!< Exchange sending timestamp (UTC)
};

template <>
constexpr std::string_view get_name<FundsUpdate>() {
  using namespace std::literals;
  return "funds_update"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::FundsUpdate> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::FundsUpdate const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(stream_id={}, )"
        R"(account="{}", )"
        R"(currency="{}", )"
        R"(margin_mode={}, )"
        R"(balance={}, )"
        R"(hold={}, )"
        R"(borrowed={}, )"
        R"(unrealized_pnl={}, )"
        R"(external_account="{}", )"
        R"(update_type={}, )"
        R"(exchange_time_utc={}, )"
        R"(exchange_sequence={}, )"
        R"(sending_time_utc={})"
        R"(}})"sv,
        value.stream_id,
        value.account,
        value.currency,
        value.margin_mode,
        value.balance,
        value.hold,
        value.borrowed,
        value.unrealized_pnl,
        value.external_account,
        value.update_type,
        value.exchange_time_utc,
        value.exchange_sequence,
        value.sending_time_utc);
  }
};

================================================
FILE: include/roq/gateway_settings.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include "roq/event.hpp"
#include "roq/filter.hpp"
#include "roq/interval.hpp"
#include "roq/limits.hpp"
#include "roq/mask.hpp"
#include "roq/name.hpp"
#include "roq/request_id_type.hpp"
#include "roq/support_type.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Gateway settings
struct ROQ_PUBLIC GatewaySettings final {
  roq::Mask<roq::SupportType> supports;            //!< Supported update types
  uint16_t mbp_max_depth = {};                     //!< MBP max depth
  double mbp_tick_size_multiplier = roq::NaN;      //!< MBP multiplier used to manage prices as integer
  double mbp_min_trade_vol_multiplier = roq::NaN;  //!< MBP multiplier used to manage quantities as integer
  bool mbp_allow_remove_non_existing = false;      //!< MBP allow remove operation on non-existing level?
  bool mbp_allow_price_inversion = false;          //!< MBP allow price inversion?
  bool mbp_checksum = false;                       //!< MBP compute checksum?
  bool oms_download_has_state = false;             //!< OMS download includes state information?
  bool oms_download_has_routing_id = false;        //!< OMS download includes routing_id?
  roq::RequestIdType oms_request_id_type = {};     //!< OMS request identifier type
  roq::Mask<roq::Filter> oms_cancel_all_orders;    //!< Supported filters for CancelAllOrders
  roq::Interval ts_interval = {};                  //!< Time-series interval
  uint16_t ts_max_history = {};                    //!< Time-series max history (bars)
};

template <>
constexpr std::string_view get_name<GatewaySettings>() {
  using namespace std::literals;
  return "gateway_settings"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::GatewaySettings> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::GatewaySettings const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(supports={}, )"
        R"(mbp_max_depth={}, )"
        R"(mbp_tick_size_multiplier={}, )"
        R"(mbp_min_trade_vol_multiplier={}, )"
        R"(mbp_allow_remove_non_existing={}, )"
        R"(mbp_allow_price_inversion={}, )"
        R"(mbp_checksum={}, )"
        R"(oms_download_has_state={}, )"
        R"(oms_download_has_routing_id={}, )"
        R"(oms_request_id_type={}, )"
        R"(oms_cancel_all_orders={}, )"
        R"(ts_interval={}, )"
        R"(ts_max_history={})"
        R"(}})"sv,
        value.supports,
        value.mbp_max_depth,
        value.mbp_tick_size_multiplier,
        value.mbp_min_trade_vol_multiplier,
        value.mbp_allow_remove_non_existing,
        value.mbp_allow_price_inversion,
        value.mbp_checksum,
        value.oms_download_has_state,
        value.oms_download_has_routing_id,
        value.oms_request_id_type,
        value.oms_cancel_all_orders,
        value.ts_interval,
        value.ts_max_history);
  }
};

================================================
FILE: include/roq/gateway_status.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <string_view>

#include "roq/event.hpp"
#include "roq/mask.hpp"
#include "roq/name.hpp"
#include "roq/support_type.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Update relating to current gateway service status
struct ROQ_PUBLIC GatewayStatus final {
  std::string_view account;                 //!< Account name
  roq::Mask<roq::SupportType> supported;    //!< Supported update types
  roq::Mask<roq::SupportType> available;    //!< Available update types (union of all streams, one or more available)
  roq::Mask<roq::SupportType> unavailable;  //!< Unavailable update types (union of all streams, one or more unavailable)
};

template <>
constexpr std::string_view get_name<GatewayStatus>() {
  using namespace std::literals;
  return "gateway_status"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::GatewayStatus> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::GatewayStatus const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(account="{}", )"
        R"(supported={}, )"
        R"(available={}, )"
        R"(unavailable={})"
        R"(}})"sv,
        value.account,
        value.supported,
        value.available,
        value.unavailable);
  }
};

================================================
FILE: include/roq/interval.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <cstdint>

namespace roq {

//! Enumeration of time-series update frequencies
enum class Interval : uint8_t {
  UNDEFINED = 0,
  _1,     //!< 1 second
  _5,     //!< 5 seconds
  _10,    //!< 10 seconds
  _15,    //!< 15 seconds
  _30,    //!< 30 seconds
  _60,    //!< 1 minute
  _300,   //!< 5 minutes
  _600,   //!< 10 minutes
  _900,   //!< 15 minutes
  _1800,  //!< 30 minutes
};

}  // namespace roq


================================================
FILE: include/roq/layer.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include "roq/limits.hpp"

namespace roq {

//! Represents aggregate order book bid/ask information at a given depth
struct ROQ_PUBLIC Layer final {
  double bid_price = roq::NaN;  //!< Bid price level
  double bid_quantity = {};     //!< Total quantity available at bid
  double ask_price = roq::NaN;  //!< Ask price level
  double ask_quantity = {};     //!< Total quantity available at ask
};

}  // namespace roq

template <>
struct fmt::formatter<roq::Layer> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Layer const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(bid_price={}, )"
        R"(bid_quantity={}, )"
        R"(ask_price={}, )"
        R"(ask_quantity={})"
        R"(}})"sv,
        value.bid_price,
        value.bid_quantity,
        value.ask_price,
        value.ask_quantity);
  }
};

================================================
FILE: include/roq/leg.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include "roq/state.hpp"
#include "roq/string_types.hpp"

namespace roq {

//! Represents current state of a strategy leg
struct ROQ_PUBLIC Leg final {
  uint16_t leg_id = {};    //!< Index
  roq::Account account;    //!< Account (optional)
  roq::Exchange exchange;  //!< Exchange (optional)
  roq::Symbol symbol;      //!< Symbol (optional)
  roq::State state = {};   //!< Strategy state
};

}  // namespace roq

template <>
struct fmt::formatter<roq::Leg> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Leg const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(leg_id={}, )"
        R"(account="{}", )"
        R"(exchange="{}", )"
        R"(symbol="{}", )"
        R"(state={})"
        R"(}})"sv,
        value.leg_id,
        value.account,
        value.exchange,
        value.symbol,
        value.state);
  }
};

================================================
FILE: include/roq/legs_update.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>
#include <fmt/ranges.h>

#include <magic_enum/magic_enum_format.hpp>

#include <span>
#include <string_view>

#include "roq/event.hpp"
#include "roq/leg.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"
#include "roq/update_type.hpp"

namespace roq {

//! Legs update
struct ROQ_PUBLIC LegsUpdate final {
  std::string_view user;             //!< Service name
  uint32_t strategy_id = {};         //!< Strategy ID
  std::span<roq::Leg const> legs;    //!< List of leg updates
  roq::UpdateType update_type = {};  //!< Update type
};

template <>
constexpr std::string_view get_name<LegsUpdate>() {
  using namespace std::literals;
  return "legs_update"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::LegsUpdate> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::LegsUpdate const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(user="{}", )"
        R"(strategy_id={}, )"
        R"(legs=[{}], )"
        R"(update_type={})"
        R"(}})"sv,
        value.user,
        value.strategy_id,
        fmt::join(value.legs, ", "sv),
        value.update_type);
  }
};

================================================
FILE: include/roq/limits.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

#pragma once

#include <limits>

namespace roq {
constexpr auto const NaN = std::numeric_limits<double>::quiet_NaN();
}  // namespace roq


================================================
FILE: include/roq/liquidity.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <cstdint>

namespace roq {

//! Enumeration of liquidity type
enum class Liquidity : uint8_t {
  UNDEFINED = 0,
  MAKER,  //!< Maker
  TAKER,  //!< Taker
};

}  // namespace roq


================================================
FILE: include/roq/map.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

#pragma once

#include <optional>
#include <tuple>

namespace roq {

namespace detail {
// note! constexpr helper for static testing
template <typename... Args>
struct MapHelper final {
  constexpr explicit MapHelper(std::tuple<Args...> const &args) : args_{args} {}
  constexpr explicit MapHelper(Args &&...args_) : args_{std::forward<Args>(args_)...} {}

  template <typename R>
  constexpr operator std::optional<R>() const;

  template <typename R>
  constexpr bool operator==(R rhs) const {
    auto tmp = (*this).operator std::optional<R>();
    if (tmp.has_value()) {
      return tmp.value() == rhs;
    }
    return false;
  }

 private:
  std::tuple<Args...> const args_;
};
}  // namespace detail

template <typename... Args>
struct Map final {
  explicit Map(Args &&...args) : args_{std::forward<Args>(args)...} {}
  explicit Map(Args const &...args) : args_{args...} {}

  Map(Map const &) = delete;

  template <typename R>
  operator R() const {
    return helper<R>().value();
  }

  template <typename R>
  R get() const {
    return helper<R>().value();
  }

 protected:
  template <typename R>
  std::optional<R> helper() const {
    static_assert(false, "mapping has not been declared");
  }

 private:
  std::tuple<Args...> const args_;
};

template <typename... Args>
inline auto map(Args &&...args) {
  return Map{std::forward<Args>(args)...};
}

}  // namespace roq


================================================
FILE: include/roq/margin_mode.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <cstdint>

namespace roq {

//! Enumeration of margin modes
enum class MarginMode : uint8_t {
  UNDEFINED = 0,
  ISOLATED,   //!< Isolated
  CROSS,      //!< Cross
  PORTFOLIO,  //!< Portfolio
};

}  // namespace roq


================================================
FILE: include/roq/market_by_order_update.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>
#include <fmt/ranges.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <span>
#include <string_view>

#include "roq/event.hpp"
#include "roq/mbo_update.hpp"
#include "roq/name.hpp"
#include "roq/precision.hpp"
#include "roq/trace.hpp"
#include "roq/update_type.hpp"

namespace roq {

//! Update relating to market by order
struct ROQ_PUBLIC MarketByOrderUpdate final {
  uint16_t stream_id = {};                          //!< Stream identifier
  std::string_view exchange;                        //!< Exchange
  std::string_view symbol;                          //!< Symbol
  std::span<roq::MBOUpdate const> orders;           //!< List of order updates
  roq::UpdateType update_type = {};                 //!< Update type
  std::chrono::nanoseconds exchange_time_utc = {};  //!< Exchange timestamp, possibly from matching engine (UTC)
  uint64_t exchange_sequence = {};                  //!< Exchange message sequence number
  std::chrono::nanoseconds sending_time_utc = {};   //!< Exchange sending timestamp (UTC)
  roq::Precision price_precision = {};              //!< Precision (decimal digits) required to represent prices (dynamic)
  roq::Precision quantity_precision = {};           //!< Precision (decimal digits) required to represent quantities (dynamic)
  uint16_t max_depth = {};                          //!< Maximum depth (zero means unlimited)
  uint32_t checksum = {};                           //!< Checksum (internal)
};

template <>
constexpr std::string_view get_name<MarketByOrderUpdate>() {
  using namespace std::literals;
  return "market_by_order_update"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::MarketByOrderUpdate> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::MarketByOrderUpdate const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(stream_id={}, )"
        R"(exchange="{}", )"
        R"(symbol="{}", )"
        R"(orders=[{}], )"
        R"(update_type={}, )"
        R"(exchange_time_utc={}, )"
        R"(exchange_sequence={}, )"
        R"(sending_time_utc={}, )"
        R"(price_precision={}, )"
        R"(quantity_precision={}, )"
        R"(max_depth={}, )"
        R"(checksum={})"
        R"(}})"sv,
        value.stream_id,
        value.exchange,
        value.symbol,
        fmt::join(value.orders, ", "sv),
        value.update_type,
        value.exchange_time_utc,
        value.exchange_sequence,
        value.sending_time_utc,
        value.price_precision,
        value.quantity_precision,
        value.max_depth,
        value.checksum);
  }
};

================================================
FILE: include/roq/market_by_price_update.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>
#include <fmt/ranges.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <span>
#include <string_view>

#include "roq/event.hpp"
#include "roq/mbp_update.hpp"
#include "roq/name.hpp"
#include "roq/precision.hpp"
#include "roq/trace.hpp"
#include "roq/update_type.hpp"

namespace roq {

//! Update relating to market by price
struct ROQ_PUBLIC MarketByPriceUpdate final {
  uint16_t stream_id = {};                          //!< Stream identifier
  std::string_view exchange;                        //!< Exchange
  std::string_view symbol;                          //!< Symbol
  std::span<roq::MBPUpdate const> bids;             //!< List of bids
  std::span<roq::MBPUpdate const> asks;             //!< List of asks
  roq::UpdateType update_type = {};                 //!< Update type
  std::chrono::nanoseconds exchange_time_utc = {};  //!< Exchange timestamp, possibly from matching engine (UTC)
  uint64_t exchange_sequence = {};                  //!< Exchange message sequence number
  std::chrono::nanoseconds sending_time_utc = {};   //!< Exchange sending timestamp (UTC)
  roq::Precision price_precision = {};              //!< Precision (decimal digits) required to represent prices (dynamic)
  roq::Precision quantity_precision = {};           //!< Precision (decimal digits) required to represent quantities (dynamic)
  uint16_t max_depth = {};                          //!< Maximum depth (zero means unlimited)
  uint32_t checksum = {};                           //!< Checksum (internal)
};

template <>
constexpr std::string_view get_name<MarketByPriceUpdate>() {
  using namespace std::literals;
  return "market_by_price_update"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::MarketByPriceUpdate> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::MarketByPriceUpdate const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(stream_id={}, )"
        R"(exchange="{}", )"
        R"(symbol="{}", )"
        R"(bids=[{}], )"
        R"(asks=[{}], )"
        R"(update_type={}, )"
        R"(exchange_time_utc={}, )"
        R"(exchange_sequence={}, )"
        R"(sending_time_utc={}, )"
        R"(price_precision={}, )"
        R"(quantity_precision={}, )"
        R"(max_depth={}, )"
        R"(checksum={})"
        R"(}})"sv,
        value.stream_id,
        value.exchange,
        value.symbol,
        fmt::join(value.bids, ", "sv),
        fmt::join(value.asks, ", "sv),
        value.update_type,
        value.exchange_time_utc,
        value.exchange_sequence,
        value.sending_time_utc,
        value.price_precision,
        value.quantity_precision,
        value.max_depth,
        value.checksum);
  }
};

================================================
FILE: include/roq/market_status.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <string_view>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"
#include "roq/trading_status.hpp"

namespace roq {

//! Update relating to current trading status of a symbol
struct ROQ_PUBLIC MarketStatus final {
  uint16_t stream_id = {};                          //!< Stream identifier
  std::string_view exchange;                        //!< Exchange
  std::string_view symbol;                          //!< Symbol
  roq::TradingStatus trading_status = {};           //!< Trading status
  std::chrono::nanoseconds exchange_time_utc = {};  //!< Exchange timestamp, possibly from matching engine (UTC)
  uint64_t exchange_sequence = {};                  //!< Exchange message sequence number
  std::chrono::nanoseconds sending_time_utc = {};   //!< Exchange sending timestamp (UTC)
};

template <>
constexpr std::string_view get_name<MarketStatus>() {
  using namespace std::literals;
  return "market_status"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::MarketStatus> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::MarketStatus const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(stream_id={}, )"
        R"(exchange="{}", )"
        R"(symbol="{}", )"
        R"(trading_status={}, )"
        R"(exchange_time_utc={}, )"
        R"(exchange_sequence={}, )"
        R"(sending_time_utc={})"
        R"(}})"sv,
        value.stream_id,
        value.exchange,
        value.symbol,
        value.trading_status,
        value.exchange_time_utc,
        value.exchange_sequence,
        value.sending_time_utc);
  }
};

================================================
FILE: include/roq/mask.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

#pragma once

#include <fmt/format.h>
#include <fmt/ranges.h>

#include <magic_enum/magic_enum_flags.hpp>

#include <initializer_list>
#include <limits>
#include <ranges>
#include <type_traits>
#include <utility>

namespace roq {

// implements a bitmap mask using an underlying enumeration
// some limitations:
// - flag (enum value) should not be 0 -- we don't currently check
// - flag (enum value) should be powers of two, or combinations -- we don't currently check

template <typename T>
  requires std::is_enum_v<T>
struct Mask final {
  using value_type = typename std::underlying_type_t<T>;

  struct sentinel final {};

  struct iterator final {
    // std::iterator_traits
    using difference_type = std::ptrdiff_t;
    using value_type = T const;
    using pointer = T const *;
    using reference = T const;
    using iterator_category = std::forward_iterator_tag;

    using underlying_type = std::underlying_type_t<T>;

    iterator(Mask<T> value) : value_{value.get()} {}

    bool operator==(sentinel const &) const {
      for (; bit_ < std::numeric_limits<underlying_type>::digits; ++bit_) {
        auto mask = static_cast<underlying_type>(size_t{1} << bit_);
        if (value_ < mask) {
          break;
        }
        if (value_ & mask) {
          return false;
        }
      }
      return true;
    }

    reference operator*() const {
      auto mask = static_cast<underlying_type>(size_t{1} << bit_++);
      return static_cast<value_type>(mask);
    }

    iterator &operator++() { return *this; }
    void operator++(int) { ++(*this); }

   private:
    underlying_type value_;
    mutable size_t bit_ = 0;  // skip undefined
  };

  constexpr Mask() = default;

  constexpr explicit Mask(value_type mask) : value_{mask} {}

  constexpr explicit Mask(T flag) : value_{static_cast<value_type>(flag)} {}

  constexpr Mask(std::initializer_list<T> flags) {
    for (auto &flag : flags) {
      value_ |= static_cast<value_type>(flag);
    }
  }

  template <typename... Args>
  constexpr Mask(Mask const &other, Args &&...args) : value_{other.value_ | Mask{std::forward<Args>(args)...}.get()} {}

  constexpr auto operator<=>(Mask const &) const = default;

  constexpr bool empty() const { return value_ == value_type{}; }

  constexpr void reset() { value_ = value_type{}; }

  constexpr value_type get() const { return value_; }

  constexpr bool is_same(T flag) const { return value_ == static_cast<value_type>(flag); }

  constexpr bool has(T flag) const { return value_ & static_cast<value_type>(flag); }

  constexpr bool has_any(T flag) const { return (value_ & static_cast<value_type>(flag)) != value_type{}; }

  constexpr bool has_any(std::initializer_list<T> flags) const {
    value_type value = {};
    for (auto &flag : flags) {
      value |= static_cast<value_type>(flag);
    }
    return value_ & value;
  }

  constexpr bool has_any(Mask rhs) const { return (value_ & rhs.value_) != value_type{}; }

  constexpr bool has_all(T flag) const { return (value_ & static_cast<value_type>(flag)) == static_cast<value_type>(flag); }

  constexpr bool has_all(std::initializer_list<T> flags) const {
    value_type value = {};
    for (auto &flag : flags) {
      value |= static_cast<value_type>(flag);
    }
    return (value_ & value) == value;
  }

  constexpr bool has_all(Mask rhs) const { return (value_ & rhs.value_) == rhs.value_; }

  constexpr Mask &set(T flag) {
    value_ |= static_cast<value_type>(flag);
    return *this;
  }

  constexpr Mask &set(Mask rhs) {
    value_ |= rhs.value_;
    return *this;
  }

  constexpr Mask &remove(T flag) {
    value_ &= ~static_cast<value_type>(flag);
    return *this;
  }

  constexpr Mask &remove(Mask rhs) {
    value_ &= ~rhs.value_;
    return *this;
  }

  constexpr bool has_none(T flag) const { return !has_any(flag); }

  constexpr bool has_none(std::initializer_list<T> flags) const { return !has_any(flags); }

  constexpr bool has_none(Mask rhs) const { return !has_any(rhs); }

  constexpr Mask negate() const { return Mask{~value_}; }

  constexpr Mask logical_and(Mask rhs) const { return Mask{value_ & rhs.value_}; }

  constexpr Mask &set(std::initializer_list<T> flags) {
    for (auto &flag : flags) {
      value_ |= static_cast<value_type>(flag);
    }
    return *this;
  }

  constexpr Mask operator~() const { return negate(); }

  constexpr Mask operator&(Mask rhs) const { return logical_and(rhs); }

  constexpr Mask &operator|=(T flag) {
    set(flag);
    return *this;
  }

  constexpr Mask &operator|=(Mask rhs) {
    set(rhs);
    return *this;
  }

 private:
  value_type value_ = {};
};

}  // namespace roq

template <typename T>
struct fmt::formatter<roq::Mask<T>> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Mask<T> const &value, format_context &context) const {
    using namespace std::literals;
    using iterator = typename roq::Mask<T>::iterator;
    using sentinel = typename roq::Mask<T>::sentinel;
    return fmt::format_to(context.out(), "{}"sv, fmt::join(iterator{value}, sentinel{}, "|"sv));
  }
};


================================================
FILE: include/roq/mass_quote.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>
#include <fmt/ranges.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <span>
#include <string_view>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/quote.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Quotes
struct ROQ_PUBLIC MassQuote final {
  std::string_view account;                       //!< Account name
  uint32_t quote_id = {};                         //!< Quote ID
  std::span<roq::Quote const> quotes;             //!< Quotes
  bool mmp_reset = false;                         //!< Market Maker Protection reset? (when supported by exchange)
  std::string_view mmp_group;                     //!< Market Maker Protection group name (when supported by exchange)
  std::chrono::nanoseconds valid_until_utc = {};  //!< Quote valid until UTC timestamp (when supported by exchange)
};

template <>
constexpr std::string_view get_name<MassQuote>() {
  using namespace std::literals;
  return "mass_quote"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::MassQuote> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::MassQuote const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(account="{}", )"
        R"(quote_id={}, )"
        R"(quotes=[{}], )"
        R"(mmp_reset={}, )"
        R"(mmp_group="{}", )"
        R"(valid_until_utc={})"
        R"(}})"sv,
        value.account,
        value.quote_id,
        fmt::join(value.quotes, ", "sv),
        value.mmp_reset,
        value.mmp_group,
        value.valid_until_utc);
  }
};

================================================
FILE: include/roq/mass_quote_ack.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <string_view>

#include "roq/error.hpp"
#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/origin.hpp"
#include "roq/request_status.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Acknowledgement that a mass quote request has been seen by gateway/exchange
struct ROQ_PUBLIC MassQuoteAck final {
  uint16_t stream_id = {};                 //!< Stream identifier
  std::string_view account;                //!< Account name
  uint32_t quote_id = {};                  //!< Quote ID
  roq::Origin origin = {};                 //!< Origin of ack
  roq::RequestStatus request_status = {};  //!< Request status
  roq::Error error = {};                   //!< Error code
  std::string_view text;                   //!< Descriptive text
  std::string_view request_id;             //!< Request identifier
  std::string_view external_account;       //!< External account name
};

template <>
constexpr std::string_view get_name<MassQuoteAck>() {
  using namespace std::literals;
  return "mass_quote_ack"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::MassQuoteAck> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::MassQuoteAck const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(stream_id={}, )"
        R"(account="{}", )"
        R"(quote_id={}, )"
        R"(origin={}, )"
        R"(request_status={}, )"
        R"(error={}, )"
        R"(text="{}", )"
        R"(request_id="{}", )"
        R"(external_account="{}")"
        R"(}})"sv,
        value.stream_id,
        value.account,
        value.quote_id,
        value.origin,
        value.request_status,
        value.error,
        value.text,
        value.request_id,
        value.external_account);
  }
};

================================================
FILE: include/roq/mbo_update.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include "roq/limits.hpp"
#include "roq/side.hpp"
#include "roq/string_types.hpp"
#include "roq/update_action.hpp"
#include "roq/update_reason.hpp"

namespace roq {

//! Represents an update to be applied to an order book
struct ROQ_PUBLIC MBOUpdate final {
  double price = roq::NaN;        //!< Price level
  double quantity = {};           //!< Order quantity (remaining unless update action is fill)
  uint64_t priority = {};         //!< Queue priority (optional)
  roq::MBOOrderId order_id;       //!< Order identifier (optional when deleting)
  roq::Side side = {};            //!< Order side (optional when updating an existing order)
  roq::UpdateAction action = {};  //!< Update action
  roq::UpdateReason reason = {};  //!< Update reason (optional)
};

}  // namespace roq

template <>
struct fmt::formatter<roq::MBOUpdate> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::MBOUpdate const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(price={}, )"
        R"(quantity={}, )"
        R"(priority={}, )"
        R"(order_id="{}", )"
        R"(side={}, )"
        R"(action={}, )"
        R"(reason={})"
        R"(}})"sv,
        value.price,
        value.quantity,
        value.priority,
        value.order_id,
        value.side,
        value.action,
        value.reason);
  }
};

================================================
FILE: include/roq/mbp_update.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include "roq/limits.hpp"
#include "roq/update_action.hpp"

namespace roq {

//! Represents the update status of a single aggregate price level in the order book
struct ROQ_PUBLIC MBPUpdate final {
  double price = roq::NaN;               //!< Price
  double quantity = {};                  //!< Total quantity available at price (zero means remove price level)
  double implied_quantity = roq::NaN;    //!< Total implied quantity at price (optional)
  uint16_t number_of_orders = {};        //!< Number of orders at price (optional)
  roq::UpdateAction update_action = {};  //!< Type of update action
  uint32_t price_level = {};             //!< Price level (0-based indexing)
};

}  // namespace roq

template <>
struct fmt::formatter<roq::MBPUpdate> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::MBPUpdate const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(price={}, )"
        R"(quantity={}, )"
        R"(implied_quantity={}, )"
        R"(number_of_orders={}, )"
        R"(update_action={}, )"
        R"(price_level={})"
        R"(}})"sv,
        value.price,
        value.quantity,
        value.implied_quantity,
        value.number_of_orders,
        value.update_action,
        value.price_level);
  }
};

================================================
FILE: include/roq/measurement.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include "roq/limits.hpp"
#include "roq/string_types.hpp"

namespace roq {

//! A single measurement point
struct ROQ_PUBLIC Measurement final {
  roq::MeasurementKey name;  //!< Key
  double value = roq::NaN;   //!< Value
};

}  // namespace roq

template <>
struct fmt::formatter<roq::Measurement> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Measurement const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(name="{}", )"
        R"(value={})"
        R"(}})"sv,
        value.name,
        value.value);
  }
};

================================================
FILE: include/roq/message_info.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <string_view>

#include "roq/uuid.hpp"

namespace roq {

//! Trace information relating to the current message
struct ROQ_PUBLIC MessageInfo final {
  uint8_t source = {};                                   //!< Source identifier (index into the list of connections)
  std::string_view source_name;                          //!< Source name
  roq::UUID source_session_id = {};                      //!< Session identifier (UUID)
  uint64_t source_seqno = {};                            //!< Sequence number (strictly increasing)
  std::chrono::nanoseconds receive_time_utc = {};        //!< Client receive time (realtime clock)
  std::chrono::nanoseconds receive_time = {};            //!< Client receive time (monotonic clock)
  std::chrono::nanoseconds source_send_time = {};        //!< Source send time (monotonic clock)
  std::chrono::nanoseconds source_receive_time = {};     //!< Source receive time (monotonic clock)
  std::chrono::nanoseconds origin_create_time = {};      //!< Origin create time (monotonic clock)
  std::chrono::nanoseconds origin_create_time_utc = {};  //!< Origin create time (realtime clock)
  bool is_last = false;                                  //!< Is last in batch?
  uint64_t opaque = {};                                  //!< Opaque value (internal)
};

}  // namespace roq

template <>
struct fmt::formatter<roq::MessageInfo> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::MessageInfo const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(source={}, )"
        R"(source_name="{}", )"
        R"(source_session_id={}, )"
        R"(source_seqno={}, )"
        R"(receive_time_utc={}, )"
        R"(receive_time={}, )"
        R"(source_send_time={}, )"
        R"(source_receive_time={}, )"
        R"(origin_create_time={}, )"
        R"(origin_create_time_utc={}, )"
        R"(is_last={}, )"
        R"(opaque={})"
        R"(}})"sv,
        value.source,
        value.source_name,
        value.source_session_id,
        value.source_seqno,
        value.receive_time_utc,
        value.receive_time,
        value.source_send_time,
        value.source_receive_time,
        value.origin_create_time,
        value.origin_create_time_utc,
        value.is_last,
        value.opaque);
  }
};

================================================
FILE: include/roq/modify_order.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <string_view>

#include "roq/event.hpp"
#include "roq/limits.hpp"
#include "roq/name.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Fields required to modify an existing order
struct ROQ_PUBLIC ModifyOrder final {
  std::string_view account;                        //!< Account name
  uint64_t order_id = {};                          //!< Order identifier
  std::string_view request_template;               //!< Request template (gateway configured)
  double quantity = roq::NaN;                      //!< New (total) quantity
  double price = roq::NaN;                         //!< New limit price
  std::string_view routing_id;                     //!< Routing identifier
  uint32_t version = {};                           //!< Version number (strictly increasing, optional)
  uint32_t conditional_on_version = {};            //!< Auto-reject if this version has positively failed (optional)
  std::chrono::nanoseconds release_time_utc = {};  //!< Request release time (optional)
};

template <>
constexpr std::string_view get_name<ModifyOrder>() {
  using namespace std::literals;
  return "modify_order"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::ModifyOrder> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::ModifyOrder const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(account="{}", )"
        R"(order_id={}, )"
        R"(request_template="{}", )"
        R"(quantity={}, )"
        R"(price={}, )"
        R"(routing_id="{}", )"
        R"(version={}, )"
        R"(conditional_on_version={}, )"
        R"(release_time_utc={})"
        R"(}})"sv,
        value.account,
        value.order_id,
        value.request_template,
        value.quantity,
        value.price,
        value.routing_id,
        value.version,
        value.conditional_on_version,
        value.release_time_utc);
  }
};

================================================
FILE: include/roq/name.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

#pragma once

#include <string_view>

namespace roq {

template <typename T>
constexpr std::string_view get_name();

}  // namespace roq


================================================
FILE: include/roq/option_type.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <cstdint>

namespace roq {

//! Enumeration of option types
enum class OptionType : uint8_t {
  UNDEFINED = 0,
  CALL,  //!< Call
  PUT,   //!< Put
};

}  // namespace roq


================================================
FILE: include/roq/order_ack.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <string_view>

#include "roq/error.hpp"
#include "roq/event.hpp"
#include "roq/limits.hpp"
#include "roq/margin_mode.hpp"
#include "roq/name.hpp"
#include "roq/origin.hpp"
#include "roq/position_effect.hpp"
#include "roq/quantity_type.hpp"
#include "roq/request_status.hpp"
#include "roq/request_type.hpp"
#include "roq/side.hpp"
#include "roq/trace.hpp"

namespace roq {

//! Acknowledgement that a create/modify/cancel order request has been seen by gateway/exchange
struct ROQ_PUBLIC OrderAck final {
  uint16_t stream_id = {};                           //!< Stream identifier
  std::string_view account;                          //!< Account name
  uint64_t order_id = {};                            //!< Order identifier
  std::string_view exchange;                         //!< Exchange
  std::string_view symbol;                           //!< Symbol
  roq::Side side = {};                               //!< Side
  roq::PositionEffect position_effect = {};          //!< Position effect
  roq::MarginMode margin_mode = {};                  //!< Margin mode
  roq::QuantityType quantity_type = {};              //!< Type of quantity (requires ecxhange support)
  roq::RequestType request_type = {};                //!< Request type
  roq::Origin origin = {};                           //!< Origin of ack
  roq::RequestStatus request_status = {};            //!< Request status
  roq::Error error = {};                             //!< Error code
  std::string_view text;                             //!< Descriptive text
  std::string_view request_id;                       //!< Request identifier
  std::string_view external_account;                 //!< External account name
  std::string_view external_order_id;                //!< External order identifier
  std::string_view client_order_id;                  //!< Client order identifier
  double quantity = roq::NaN;                        //!< Quantity (total, indicative)
  double price = roq::NaN;                           //!< Price
  double stop_price = roq::NaN;                      //!< Stop price (depends on order_type and time_in_force)
  double leverage = roq::NaN;                        //!< Leverage (requires exchange support)
  std::string_view routing_id;                       //!< Routing identifier
  uint32_t version = {};                             //!< Version number (strictly increasing, optional)
  double risk_exposure = roq::NaN;                   //!< Risk exposure
  double risk_exposure_change = roq::NaN;            //!< Risk exposure change
  double traded_quantity = roq::NaN;                 //!< Quantity (total traded)
  std::chrono::nanoseconds round_trip_latency = {};  //!< Round-trip latency (interpretation depends on origin)
  std::string_view user;                             //!< User name (optional, only relevant for drop-copy)
  uint32_t strategy_id = {};                         //!< Strategy identifier (optional)
};

template <>
constexpr std::string_view get_name<OrderAck>() {
  using namespace std::literals;
  return "order_ack"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::OrderAck> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::OrderAck const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(stream_id={}, )"
        R"(account="{}", )"
        R"(order_id={}, )"
        R"(exchange="{}", )"
        R"(symbol="{}", )"
        R"(side={}, )"
        R"(position_effect={}, )"
        R"(margin_mode={}, )"
        R"(quantity_type={}, )"
        R"(request_type={}, )"
        R"(origin={}, )"
        R"(request_status={}, )"
        R"(error={}, )"
        R"(text="{}", )"
        R"(request_id="{}", )"
        R"(external_account="{}", )"
        R"(external_order_id="{}", )"
        R"(client_order_id="{}", )"
        R"(quantity={}, )"
        R"(price={}, )"
        R"(stop_price={}, )"
        R"(leverage={}, )"
        R"(routing_id="{}", )"
        R"(version={}, )"
        R"(risk_exposure={}, )"
        R"(risk_exposure_change={}, )"
        R"(traded_quantity={}, )"
        R"(round_trip_latency={}, )"
        R"(user="{}", )"
        R"(strategy_id={})"
        R"(}})"sv,
        value.stream_id,
        value.account,
        value.order_id,
        value.exchange,
        value.symbol,
        value.side,
        value.position_effect,
        value.margin_mode,
        value.quantity_type,
        value.request_type,
        value.origin,
        value.request_status,
        value.error,
        value.text,
        value.request_id,
        value.external_account,
        value.external_order_id,
        value.client_order_id,
        value.quantity,
        value.price,
        value.stop_price,
        value.leverage,
        value.routing_id,
        value.version,
        value.risk_exposure,
        value.risk_exposure_change,
        value.traded_quantity,
        value.round_trip_latency,
        value.user,
        value.strategy_id);
  }
};

================================================
FILE: include/roq/order_cancel_policy.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <cstdint>

namespace roq {

//! Enumeration of order cancel policies
enum class OrderCancelPolicy : uint8_t {
  UNDEFINED = 0,
  MANAGED_ORDERS,  //!< Cancel managed orders
  BY_ACCOUNT,      //!< Cancel by account
  BY_STRATEGY,     //!< Cancel by strategy
};

}  // namespace roq


================================================
FILE: include/roq/order_management.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <cstdint>

namespace roq {

//! Enumeration of a specific order management style
enum class OrderManagement : uint8_t {
  UNDEFINED = 0,
  FIX,  //!< Client provides a globally unique routing_id
};

}  // namespace roq


================================================
FILE: include/roq/order_status.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <cstdint>

namespace roq {

//! Last known order status received from exchange
enum class OrderStatus : uint8_t {
  UNDEFINED = 0,
  SENT,       //!< Order has been sent to exchange (no response has been received yet)
  ACCEPTED,   //!< Order has been accepted by exchange and is not yet been activated
  SUSPENDED,  //!< Order has been suspended and requires external action to re-activate
  WORKING,    //!< Order is working and has not yet been completely filled
  STOPPED,    //!< Order has guaranteed fill at as of yet unknown price
  COMPLETED,  //!< Order has been completely filled
  EXPIRED,    //!< Order has expired
  CANCELED,   //!< Order has been canceled
  REJECTED,   //!< Order has been rejected
};

}  // namespace roq


================================================
FILE: include/roq/order_type.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <cstdint>

namespace roq {

//! Enumeration of order types
enum class OrderType : uint8_t {
  UNDEFINED = 0,
  MARKET,  //!< Market order
  LIMIT,   //!< Limit order
};

}  // namespace roq


================================================
FILE: include/roq/order_update.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <string_view>

#include "roq/event.hpp"
#include "roq/execution_instruction.hpp"
#include "roq/limits.hpp"
#include "roq/liquidity.hpp"
#include "roq/margin_mode.hpp"
#include "roq/mask.hpp"
#include "roq/name.hpp"
#include "roq/order_status.hpp"
#include "roq/order_type.hpp"
#include "roq/position_effect.hpp"
#include "roq/quantity_type.hpp"
#include "roq/side.hpp"
#include "roq/time_in_force.hpp"
#include "roq/trace.hpp"
#include "roq/update_type.hpp"

namespace roq {

//! Update relating to current status of an order
struct ROQ_PUBLIC OrderUpdate final {
  uint16_t stream_id = {};                                      //!< Stream identifier
  std::string_view account;                                     //!< Account name
  uint64_t order_id = {};                                       //!< Order identifier
  std::string_view exchange;                                    //!< Exchange
  std::string_view symbol;                                      //!< Symbol
  roq::Side side = {};                                          //!< Side
  roq::PositionEffect position_effect = {};                     //!< Position effect
  roq::MarginMode margin_mode = {};                             //!< Margin mode
  roq::QuantityType quantity_type = {};                         //!< Type of quantity (requires ecxhange support)
  double max_show_quantity = roq::NaN;                          //!< Quantity visible to market (base currency, requires exchange support)
  roq::OrderType order_type = {};                               //!< Order type
  roq::TimeInForce time_in_force = {};                          //!< Time in force
  roq::Mask<roq::ExecutionInstruction> execution_instructions;  //!< Execution instructions
  std::chrono::nanoseconds create_time_utc = {};                //!< Created timestamp (UTC)
  std::chrono::nanoseconds update_time_utc = {};                //!< Updated timestamp (UTC)
  std::string_view external_account;                            //!< External account name
  std::string_view external_order_id;                           //!< External order identifier
  std::string_view client_order_id;                             //!< Client order identifier
  roq::OrderStatus order_status = {};                           //!< Order status
  double quantity = roq::NaN;                                   //!< Quantity (base currency, total, indicative)
  double price = roq::NaN;                                      //!< Price
  double stop_price = roq::NaN;                                 //!< Stop price (depends on order_type and time_in_force)
  double leverage = roq::NaN;                                   //!< Leverage (requires exchange support)
  double risk_exposure = roq::NaN;                              //!< Risk exposure
  double risk_exposure_change = roq::NaN;                       //!< Risk exposure change
  double remaining_quantity = roq::NaN;                         //!< Quantity (base currency, remaining)
  double traded_quantity = roq::NaN;                            //!< Quantity (base currency, total traded)
  double average_traded_price = roq::NaN;                       //!< Average price (total traded)
  double last_traded_quantity = roq::NaN;                       //!< Traded quantity (base currency, last trade)
  double last_traded_price = roq::NaN;                          //!< Traded price (last trade)
  roq::Liquidity last_liquidity = {};                           //!< Liquidity indicator (last trade)
  std::string_view routing_id;                                  //!< Routing identifier
  uint32_t max_request_version = {};                            //!< Last request version
  uint32_t max_response_version = {};                           //!< Last response version
  uint32_t max_accepted_version = {};                           //!< Last accepted version
  roq::UpdateType update_type = {};                             //!< Update type
  std::chrono::nanoseconds exchange_time_utc = {};              //!< Exchange timestamp, possibly from matching engine (UTC)
  uint64_t exchange_sequence = {};                              //!< Exchange message sequence number
  std::chrono::nanoseconds sending_time_utc = {};               //!< Exchange sending timestamp (UTC)
  std::string_view user;                                        //!< User name (optional, only relevant for drop-copy)
  uint32_t strategy_id = {};                                    //!< Strategy identifier (optional)
};

template <>
constexpr std::string_view get_name<OrderUpdate>() {
  using namespace std::literals;
  return "order_update"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::OrderUpdate> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::OrderUpdate const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(stream_id={}, )"
        R"(account="{}", )"
        R"(order_id={}, )"
        R"(exchange="{}", )"
        R"(symbol="{}", )"
        R"(side={}, )"
        R"(position_effect={}, )"
        R"(margin_mode={}, )"
        R"(quantity_type={}, )"
        R"(max_show_quantity={}, )"
        R"(order_type={}, )"
        R"(time_in_force={}, )"
        R"(execution_instructions={}, )"
        R"(create_time_utc={}, )"
        R"(update_time_utc={}, )"
        R"(external_account="{}", )"
        R"(external_order_id="{}", )"
        R"(client_order_id="{}", )"
        R"(order_status={}, )"
        R"(quantity={}, )"
        R"(price={}, )"
        R"(stop_price={}, )"
        R"(leverage={}, )"
        R"(risk_exposure={}, )"
        R"(risk_exposure_change={}, )"
        R"(remaining_quantity={}, )"
        R"(traded_quantity={}, )"
        R"(average_traded_price={}, )"
        R"(last_traded_quantity={}, )"
        R"(last_traded_price={}, )"
        R"(last_liquidity={}, )"
        R"(routing_id="{}", )"
        R"(max_request_version={}, )"
        R"(max_response_version={}, )"
        R"(max_accepted_version={}, )"
        R"(update_type={}, )"
        R"(exchange_time_utc={}, )"
        R"(exchange_sequence={}, )"
        R"(sending_time_utc={}, )"
        R"(user="{}", )"
        R"(strategy_id={})"
        R"(}})"sv,
        value.stream_id,
        value.account,
        value.order_id,
        value.exchange,
        value.symbol,
        value.side,
        value.position_effect,
        value.margin_mode,
        value.quantity_type,
        value.max_show_quantity,
        value.order_type,
        value.time_in_force,
        value.execution_instructions,
        value.create_time_utc,
        value.update_time_utc,
        value.external_account,
        value.external_order_id,
        value.client_order_id,
        value.order_status,
        value.quantity,
        value.price,
        value.stop_price,
        value.leverage,
        value.risk_exposure,
        value.risk_exposure_change,
        value.remaining_quantity,
        value.traded_quantity,
        value.average_traded_price,
        value.last_traded_quantity,
        value.last_traded_price,
        value.last_liquidity,
        value.routing_id,
        value.max_request_version,
        value.max_response_version,
        value.max_accepted_version,
        value.update_type,
        value.exchange_time_utc,
        value.exchange_sequence,
        value.sending_time_utc,
        value.user,
        value.strategy_id);
  }
};

================================================
FILE: include/roq/origin.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include <cstdint>

namespace roq {

//! Enumeration of origin types
enum class Origin : uint8_t {
  UNDEFINED = 0,
  CLIENT,    //!< Client
  GATEWAY,   //!< Gateway
  BROKER,    //!< Broker
  EXCHANGE,  //!< Exchange
};

}  // namespace roq


================================================
FILE: include/roq/parameter.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include "roq/string_types.hpp"

namespace roq {

//! Represents a single parameter
struct ROQ_PUBLIC Parameter final {
  roq::ParameterKey label;    //!< Label
  uint32_t strategy_id = {};  //!< Strategy identifier (optional)
  roq::Account account;       //!< Account name
  roq::Exchange exchange;     //!< Exchange
  roq::Symbol symbol;         //!< Symbol
  roq::ParameterValue value;  //!< Value
};

}  // namespace roq

template <>
struct fmt::formatter<roq::Parameter> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Parameter const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(label="{}", )"
        R"(strategy_id={}, )"
        R"(account="{}", )"
        R"(exchange="{}", )"
        R"(symbol="{}", )"
        R"(value="{}")"
        R"(}})"sv,
        value.label,
        value.strategy_id,
        value.account,
        value.exchange,
        value.symbol,
        value.value);
  }
};

================================================
FILE: include/roq/parameters_update.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>
#include <fmt/ranges.h>

#include <magic_enum/magic_enum_format.hpp>

#include <span>
#include <string_view>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/parameter.hpp"
#include "roq/trace.hpp"
#include "roq/update_type.hpp"

namespace roq {

//! Update relating to parameters
struct ROQ_PUBLIC ParametersUpdate final {
  std::span<roq::Parameter const> parameters;  //!< List of parameters
  roq::UpdateType update_type = {};            //!< Update type
  std::string_view user;                       //!< User name (optional, only relevant for drop-copy)
};

template <>
constexpr std::string_view get_name<ParametersUpdate>() {
  using namespace std::literals;
  return "parameters_update"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::ParametersUpdate> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::ParametersUpdate const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(parameters=[{}], )"
        R"(update_type={}, )"
        R"(user="{}")"
        R"(}})"sv,
        fmt::join(value.parameters, ", "sv),
        value.update_type,
        value.user);
  }
};

================================================
FILE: include/roq/portfolio.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>
#include <fmt/ranges.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <span>
#include <string_view>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/position.hpp"
#include "roq/trace.hpp"
#include "roq/update_type.hpp"
#include "roq/uuid.hpp"

namespace roq {

//! Portfolio
struct ROQ_PUBLIC Portfolio final {
  std::string_view user;                            //!< User (optional)
  uint32_t strategy_id = {};                        //!< Strategy identifier (optional)
  std::string_view account;                         //!< Account name
  std::span<roq::Position const> positions;         //!< Position updates
  roq::UpdateType update_type = {};                 //!< Update type
  std::chrono::nanoseconds exchange_time_utc = {};  //!< Exchange timestamp, possibly from matching engine (UTC)
  roq::UUID session_id = {};                        //!< Reference (UUID)
  uint64_t seqno = {};                              //!< Reference (sequencing)
};

template <>
constexpr std::string_view get_name<Portfolio>() {
  using namespace std::literals;
  return "portfolio"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::Portfolio> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::Portfolio const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(user="{}", )"
        R"(strategy_id={}, )"
        R"(account="{}", )"
        R"(positions=[{}], )"
        R"(update_type={}, )"
        R"(exchange_time_utc={}, )"
        R"(session_id={}, )"
        R"(seqno={})"
        R"(}})"sv,
        value.user,
        value.strategy_id,
        value.account,
        fmt::join(value.positions, ", "sv),
        value.update_type,
        value.exchange_time_utc,
        value.session_id,
        value.seqno);
  }
};

================================================
FILE: include/roq/portfolio_update.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/chrono.h>
#include <fmt/format.h>
#include <fmt/ranges.h>

#include <magic_enum/magic_enum_format.hpp>

#include <chrono>
#include <span>
#include <string_view>

#include "roq/event.hpp"
#include "roq/name.hpp"
#include "roq/position.hpp"
#include "roq/trace.hpp"
#include "roq/update_type.hpp"

namespace roq {

//! Portfolio update
struct ROQ_PUBLIC PortfolioUpdate final {
  std::string_view user;                            //!< User (optional)
  uint32_t strategy_id = {};                        //!< Strategy identifier (optional)
  std::string_view account;                         //!< Account name
  std::span<roq::Position const> positions;         //!< Position updates
  roq::UpdateType update_type = {};                 //!< Update type
  std::chrono::nanoseconds exchange_time_utc = {};  //!< Exchange timestamp, possibly from matching engine (UTC)
};

template <>
constexpr std::string_view get_name<PortfolioUpdate>() {
  using namespace std::literals;
  return "portfolio_update"sv;
}

}  // namespace roq

template <>
struct fmt::formatter<roq::PortfolioUpdate> {
  constexpr auto parse(format_parse_context &context) { return std::begin(context); }
  auto format(roq::PortfolioUpdate const &value, format_context &context) const {
    using namespace std::literals;
    return fmt::format_to(
        context.out(),
        R"({{)"
        R"(user="{}", )"
        R"(strategy_id={}, )"
        R"(account="{}", )"
        R"(positions=[{}], )"
        R"(update_type={}, )"
        R"(exchange_time_utc={})"
        R"(}})"sv,
        value.user,
        value.strategy_id,
        value.account,
        fmt::join(value.positions, ", "sv),
        value.update_type,
        value.exchange_time_utc);
  }
};

================================================
FILE: include/roq/position.hpp
================================================
/* Copyright (c) 2017-2026, Hans Erik Thrane */

/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */

#pragma once

#include "roq/compat.hpp"

#include <fmt/format.h>

#include <magic_enum/magic_enum_format.hpp>

#include "roq/limits.hpp"
#include "roq/string_types.hpp"

namespace roq {

//! Position
struct ROQ_PUBLIC Position final {
  roq::Exchange exchange;              //!< Exchange
  roq::Symbol symbol;                  //!< Symbol
  double position = 0.0;               //!< Position (quantity)
  double prof
Download .txt
gitextract_kyd8hy5r/

├── .clang-format
├── .clang-tidy
├── .cmake-format.yaml
├── .gitattributes
├── .gitignore
├── .gitmodules
├── CHANGELOG.md
├── CMakeLists.txt
├── LICENSE
├── README.md
├── conda/
│   ├── bld.bat
│   └── meta.yaml
├── doxygen/
│   ├── .gitignore
│   ├── CMakeLists.txt
│   └── Doxyfile.in
├── include/
│   └── roq/
│       ├── CMakeLists.txt
│       ├── action.hpp
│       ├── add_market.hpp
│       ├── add_routes.hpp
│       ├── api.hpp
│       ├── api.hpp.in
│       ├── args/
│       │   └── parser.hpp
│       ├── bar.hpp
│       ├── batch_begin.hpp
│       ├── batch_end.hpp
│       ├── buffer_capacity.hpp
│       ├── cancel_all_orders.hpp
│       ├── cancel_all_orders_ack.hpp
│       ├── cancel_order.hpp
│       ├── cancel_quotes.hpp
│       ├── cancel_quotes_ack.hpp
│       ├── category.hpp
│       ├── client/
│       │   └── custom_message.hpp
│       ├── clock.hpp
│       ├── compat.hpp
│       ├── connected.hpp
│       ├── connection_status.hpp
│       ├── control.hpp
│       ├── control_ack.hpp
│       ├── create_order.hpp
│       ├── custom_matrix.hpp
│       ├── custom_matrix_update.hpp
│       ├── custom_metrics.hpp
│       ├── custom_metrics_update.hpp
│       ├── data_source.hpp
│       ├── decimal.hpp
│       ├── disconnected.hpp
│       ├── download_begin.hpp
│       ├── download_end.hpp
│       ├── encoding.hpp
│       ├── error.hpp
│       ├── event.hpp
│       ├── exceptions.hpp
│       ├── execution_instruction.hpp
│       ├── external_latency.hpp
│       ├── fill.hpp
│       ├── filter.hpp
│       ├── format_str.hpp
│       ├── funds_update.hpp
│       ├── gateway_settings.hpp
│       ├── gateway_status.hpp
│       ├── interval.hpp
│       ├── layer.hpp
│       ├── leg.hpp
│       ├── legs_update.hpp
│       ├── limits.hpp
│       ├── liquidity.hpp
│       ├── map.hpp
│       ├── margin_mode.hpp
│       ├── market_by_order_update.hpp
│       ├── market_by_price_update.hpp
│       ├── market_status.hpp
│       ├── mask.hpp
│       ├── mass_quote.hpp
│       ├── mass_quote_ack.hpp
│       ├── mbo_update.hpp
│       ├── mbp_update.hpp
│       ├── measurement.hpp
│       ├── message_info.hpp
│       ├── modify_order.hpp
│       ├── name.hpp
│       ├── option_type.hpp
│       ├── order_ack.hpp
│       ├── order_cancel_policy.hpp
│       ├── order_management.hpp
│       ├── order_status.hpp
│       ├── order_type.hpp
│       ├── order_update.hpp
│       ├── origin.hpp
│       ├── parameter.hpp
│       ├── parameters_update.hpp
│       ├── portfolio.hpp
│       ├── portfolio_update.hpp
│       ├── position.hpp
│       ├── position_effect.hpp
│       ├── position_update.hpp
│       ├── precision.hpp
│       ├── precision_2.hpp
│       ├── priority.hpp
│       ├── protocol.hpp
│       ├── quality_of_service.hpp
│       ├── quantity_type.hpp
│       ├── quote.hpp
│       ├── rate_limit.hpp
│       ├── rate_limit_trigger.hpp
│       ├── rate_limit_type.hpp
│       ├── rate_limits_update.hpp
│       ├── ready.hpp
│       ├── reference_data.hpp
│       ├── remove_routes.hpp
│       ├── request_id_type.hpp
│       ├── request_status.hpp
│       ├── request_type.hpp
│       ├── risk_limit.hpp
│       ├── risk_limits.hpp
│       ├── risk_limits_update.hpp
│       ├── route.hpp
│       ├── route_ack.hpp
│       ├── route_request_status.hpp
│       ├── routing.hpp
│       ├── security_type.hpp
│       ├── service_update.hpp
│       ├── side.hpp
│       ├── start.hpp
│       ├── state.hpp
│       ├── statistics.hpp
│       ├── statistics_type.hpp
│       ├── statistics_update.hpp
│       ├── stop.hpp
│       ├── strategy_update.hpp
│       ├── stream_status.hpp
│       ├── string.hpp
│       ├── string_types.hpp
│       ├── subscribe.hpp
│       ├── support_type.hpp
│       ├── tick_size_step.hpp
│       ├── time_in_force.hpp
│       ├── time_series_update.hpp
│       ├── timer.hpp
│       ├── top_of_book.hpp
│       ├── trace.hpp
│       ├── trace_info.hpp
│       ├── trade.hpp
│       ├── trade_summary.hpp
│       ├── trade_update.hpp
│       ├── trading_status.hpp
│       ├── transport.hpp
│       ├── update_action.hpp
│       ├── update_reason.hpp
│       ├── update_type.hpp
│       ├── uuid.hpp
│       ├── variant_type.hpp
│       └── version.hpp
├── schema/
│   └── roq/
│       ├── CMakeLists.txt
│       ├── action.json
│       ├── add_market.json
│       ├── add_routes.json
│       ├── bar.json
│       ├── batch_begin.json
│       ├── batch_end.json
│       ├── buffer_capacity.json
│       ├── cancel_all_orders.json
│       ├── cancel_all_orders_ack.json
│       ├── cancel_order.json
│       ├── cancel_quotes.json
│       ├── cancel_quotes_ack.json
│       ├── category.json
│       ├── connected.json
│       ├── connection_status.json
│       ├── control.json
│       ├── control_ack.json
│       ├── create_order.json
│       ├── custom_matrix.json
│       ├── custom_matrix_update.json
│       ├── custom_metrics.json
│       ├── custom_metrics_update.json
│       ├── data_source.json
│       ├── disconnected.json
│       ├── download_begin.json
│       ├── download_end.json
│       ├── encoding.json
│       ├── error.json
│       ├── execution_instruction.json
│       ├── external_latency.json
│       ├── fill.json
│       ├── filter.json
│       ├── funds_update.json
│       ├── gateway_settings.json
│       ├── gateway_status.json
│       ├── interval.json
│       ├── layer.json
│       ├── leg.json
│       ├── legs_update.json
│       ├── liquidity.json
│       ├── margin_mode.json
│       ├── market_by_order_update.json
│       ├── market_by_price_update.json
│       ├── market_status.json
│       ├── mass_quote.json
│       ├── mass_quote_ack.json
│       ├── mbo_update.json
│       ├── mbp_update.json
│       ├── measurement.json
│       ├── message_info.json
│       ├── modify_order.json
│       ├── option_type.json
│       ├── order_ack.json
│       ├── order_cancel_policy.json
│       ├── order_management.json
│       ├── order_status.json
│       ├── order_type.json
│       ├── order_update.json
│       ├── origin.json
│       ├── parameter.json
│       ├── parameters_update.json
│       ├── portfolio.json
│       ├── portfolio_update.json
│       ├── position.json
│       ├── position_effect.json
│       ├── position_update.json
│       ├── precision.json
│       ├── priority.json
│       ├── protocol.json
│       ├── quality_of_service.json
│       ├── quantity_type.json
│       ├── quote.json
│       ├── rate_limit.json
│       ├── rate_limit_trigger.json
│       ├── rate_limit_type.json
│       ├── rate_limits_update.json
│       ├── ready.json
│       ├── reference_data.json
│       ├── remove_routes.json
│       ├── request_id_type.json
│       ├── request_status.json
│       ├── request_type.json
│       ├── risk_limit.json
│       ├── risk_limits.json
│       ├── risk_limits_update.json
│       ├── route.json
│       ├── route_ack.json
│       ├── route_request_status.json
│       ├── routing.json
│       ├── security_type.json
│       ├── service_update.json
│       ├── side.json
│       ├── start.json
│       ├── state.json
│       ├── statistics.json
│       ├── statistics_type.json
│       ├── statistics_update.json
│       ├── stop.json
│       ├── strategy_update.json
│       ├── stream_status.json
│       ├── subscribe.json
│       ├── support_type.json
│       ├── tick_size_step.json
│       ├── time_in_force.json
│       ├── time_series_update.json
│       ├── timer.json
│       ├── top_of_book.json
│       ├── trade.json
│       ├── trade_summary.json
│       ├── trade_update.json
│       ├── trading_status.json
│       ├── transport.json
│       ├── update_action.json
│       ├── update_reason.json
│       ├── update_type.json
│       └── variant_type.json
└── test/
    ├── .clang-tidy
    ├── .gitignore
    ├── CMakeLists.txt
    ├── alignment.cpp
    ├── compat.cpp
    ├── exceptions.cpp
    ├── format.cpp
    ├── main.cpp
    ├── mask.cpp
    ├── side.cpp
    ├── span.cpp
    ├── string.cpp
    ├── support_type.cpp
    └── version.cpp
Download .txt
SYMBOL INDEX (808 symbols across 137 files)

FILE: include/roq/action.hpp
  type roq (line 9) | namespace roq {
    type Action (line 12) | enum class Action : uint8_t {

FILE: include/roq/add_market.hpp
  type roq (line 19) | namespace roq {
    function AddMarket (line 22) | struct ROQ_PUBLIC AddMarket final {
  type fmt::formatter<roq::AddMarket> (line 36) | struct fmt::formatter<roq::AddMarket> {
    method parse (line 37) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 38) | auto format(roq::AddMarket const &value, format_context &context) const {

FILE: include/roq/add_routes.hpp
  type roq (line 20) | namespace roq {
    function AddRoutes (line 23) | struct ROQ_PUBLIC AddRoutes final {
  type fmt::formatter<roq::AddRoutes> (line 36) | struct fmt::formatter<roq::AddRoutes> {
    method parse (line 37) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 38) | auto format(roq::AddRoutes const &value, format_context &context) const {

FILE: include/roq/api.hpp
  type roq (line 147) | namespace roq {

FILE: include/roq/args/parser.hpp
  type roq (line 10) | namespace roq {
    type args (line 11) | namespace args {
      function Parser (line 13) | struct ROQ_PUBLIC Parser {

FILE: include/roq/bar.hpp
  type roq (line 18) | namespace roq {
    function final (line 21) | struct ROQ_PUBLIC Bar final {
  type fmt::formatter<roq::Bar> (line 38) | struct fmt::formatter<roq::Bar> {
    method parse (line 39) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 40) | auto format(roq::Bar const &value, format_context &context) const {

FILE: include/roq/batch_begin.hpp
  type roq (line 17) | namespace roq {
    type ROQ_PUBLIC (line 20) | struct ROQ_PUBLIC
  type fmt::formatter<roq::BatchBegin> (line 31) | struct fmt::formatter<roq::BatchBegin> {
    method parse (line 32) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 33) | auto format(roq::BatchBegin const &, format_context &context) const {

FILE: include/roq/batch_end.hpp
  type roq (line 17) | namespace roq {
    type ROQ_PUBLIC (line 20) | struct ROQ_PUBLIC
  type fmt::formatter<roq::BatchEnd> (line 31) | struct fmt::formatter<roq::BatchEnd> {
    method parse (line 32) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 33) | auto format(roq::BatchEnd const &, format_context &context) const {

FILE: include/roq/buffer_capacity.hpp
  type roq (line 9) | namespace roq {
    type BufferCapacity (line 12) | enum class BufferCapacity : uint8_t {

FILE: include/roq/cancel_all_orders.hpp
  type roq (line 20) | namespace roq {
    function CancelAllOrders (line 23) | struct ROQ_PUBLIC CancelAllOrders final {
  type fmt::formatter<roq::CancelAllOrders> (line 41) | struct fmt::formatter<roq::CancelAllOrders> {
    method parse (line 42) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 43) | auto format(roq::CancelAllOrders const &value, format_context &context...

FILE: include/roq/cancel_all_orders_ack.hpp
  type roq (line 25) | namespace roq {
    function CancelAllOrdersAck (line 28) | struct ROQ_PUBLIC CancelAllOrdersAck final {
  type fmt::formatter<roq::CancelAllOrdersAck> (line 56) | struct fmt::formatter<roq::CancelAllOrdersAck> {
    method parse (line 57) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 58) | auto format(roq::CancelAllOrdersAck const &value, format_context &cont...

FILE: include/roq/cancel_order.hpp
  type roq (line 21) | namespace roq {
    function CancelOrder (line 24) | struct ROQ_PUBLIC CancelOrder final {
  type fmt::formatter<roq::CancelOrder> (line 43) | struct fmt::formatter<roq::CancelOrder> {
    method parse (line 44) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 45) | auto format(roq::CancelOrder const &value, format_context &context) co...

FILE: include/roq/cancel_quotes.hpp
  type roq (line 19) | namespace roq {
    function CancelQuotes (line 22) | struct ROQ_PUBLIC CancelQuotes final {
  type fmt::formatter<roq::CancelQuotes> (line 36) | struct fmt::formatter<roq::CancelQuotes> {
    method parse (line 37) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 38) | auto format(roq::CancelQuotes const &value, format_context &context) c...

FILE: include/roq/cancel_quotes_ack.hpp
  type roq (line 22) | namespace roq {
    function CancelQuotesAck (line 25) | struct ROQ_PUBLIC CancelQuotesAck final {
  type fmt::formatter<roq::CancelQuotesAck> (line 46) | struct fmt::formatter<roq::CancelQuotesAck> {
    method parse (line 47) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 48) | auto format(roq::CancelQuotesAck const &value, format_context &context...

FILE: include/roq/category.hpp
  type roq (line 9) | namespace roq {
    type Category (line 12) | enum class Category : uint8_t {

FILE: include/roq/client/custom_message.hpp
  type roq (line 12) | namespace roq {
    type client (line 13) | namespace client {
      function CustomMessage (line 15) | struct ROQ_PUBLIC CustomMessage final {
  type fmt::formatter<roq::client::CustomMessage> (line 24) | struct fmt::formatter<roq::client::CustomMessage> {
    method parse (line 25) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 26) | auto format(roq::client::CustomMessage const &value, format_context &c...
  type fmt::formatter<roq::Event<roq::client::CustomMessage>> (line 38) | struct fmt::formatter<roq::Event<roq::client::CustomMessage>> {
    method parse (line 39) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 40) | auto format(roq::Event<roq::client::CustomMessage> const &event, forma...

FILE: include/roq/clock.hpp
  type roq (line 11) | namespace roq {
    type detail (line 13) | namespace detail {
      function get_time_helper (line 15) | inline auto get_time_helper() {
    type clock (line 26) | namespace clock {
      function T (line 28) | inline T get_system() {
      function T (line 33) | inline T get_realtime() {

FILE: include/roq/connected.hpp
  type roq (line 17) | namespace roq {
    type ROQ_PUBLIC (line 20) | struct ROQ_PUBLIC
  type fmt::formatter<roq::Connected> (line 31) | struct fmt::formatter<roq::Connected> {
    method parse (line 32) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 33) | auto format(roq::Connected const &, format_context &context) const {

FILE: include/roq/connection_status.hpp
  type roq (line 9) | namespace roq {
    type ConnectionStatus (line 12) | enum class ConnectionStatus : uint8_t {

FILE: include/roq/control.hpp
  type roq (line 20) | namespace roq {
    function Control (line 23) | struct ROQ_PUBLIC Control final {
  type fmt::formatter<roq::Control> (line 43) | struct fmt::formatter<roq::Control> {
    method parse (line 44) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 45) | auto format(roq::Control const &value, format_context &context) const {

FILE: include/roq/control_ack.hpp
  type roq (line 22) | namespace roq {
    function ControlAck (line 25) | struct ROQ_PUBLIC ControlAck final {
  type fmt::formatter<roq::ControlAck> (line 43) | struct fmt::formatter<roq::ControlAck> {
    method parse (line 44) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 45) | auto format(roq::ControlAck const &value, format_context &context) con...

FILE: include/roq/create_order.hpp
  type roq (line 30) | namespace roq {
    function CreateOrder (line 33) | struct ROQ_PUBLIC CreateOrder final {
  type fmt::formatter<roq::CreateOrder> (line 65) | struct fmt::formatter<roq::CreateOrder> {
    method parse (line 66) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 67) | auto format(roq::CreateOrder const &value, format_context &context) co...

FILE: include/roq/custom_matrix.hpp
  type roq (line 24) | namespace roq {
    function CustomMatrix (line 27) | struct ROQ_PUBLIC CustomMatrix final {
  type fmt::formatter<roq::CustomMatrix> (line 48) | struct fmt::formatter<roq::CustomMatrix> {
    method parse (line 49) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 50) | auto format(roq::CustomMatrix const &value, format_context &context) c...

FILE: include/roq/custom_matrix_update.hpp
  type roq (line 26) | namespace roq {
    function CustomMatrixUpdate (line 29) | struct ROQ_PUBLIC CustomMatrixUpdate final {
  type fmt::formatter<roq::CustomMatrixUpdate> (line 52) | struct fmt::formatter<roq::CustomMatrixUpdate> {
    method parse (line 53) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 54) | auto format(roq::CustomMatrixUpdate const &value, format_context &cont...

FILE: include/roq/custom_metrics.hpp
  type roq (line 23) | namespace roq {
    function CustomMetrics (line 26) | struct ROQ_PUBLIC CustomMetrics final {
  type fmt::formatter<roq::CustomMetrics> (line 44) | struct fmt::formatter<roq::CustomMetrics> {
    method parse (line 45) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 46) | auto format(roq::CustomMetrics const &value, format_context &context) ...

FILE: include/roq/custom_metrics_update.hpp
  type roq (line 25) | namespace roq {
    function CustomMetricsUpdate (line 28) | struct ROQ_PUBLIC CustomMetricsUpdate final {
  type fmt::formatter<roq::CustomMetricsUpdate> (line 48) | struct fmt::formatter<roq::CustomMetricsUpdate> {
    method parse (line 49) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 50) | auto format(roq::CustomMetricsUpdate const &value, format_context &con...

FILE: include/roq/data_source.hpp
  type roq (line 9) | namespace roq {
    type DataSource (line 12) | enum class DataSource : uint8_t {

FILE: include/roq/decimal.hpp
  type roq (line 10) | namespace roq {
    type Decimal (line 12) | struct Decimal final {
      method Decimal (line 13) | Decimal() = default;
      method Decimal (line 15) | Decimal(double value, Precision precision) : value_{value}, precisio...
      method empty (line 17) | bool empty() const { return std::isnan(value_); }
  type fmt::formatter<roq::Decimal> (line 30) | struct fmt::formatter<roq::Decimal> {
    method parse (line 31) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 32) | auto format(roq::Decimal const &value, format_context &context) const {

FILE: include/roq/disconnected.hpp
  type roq (line 18) | namespace roq {
    function Disconnected (line 21) | struct ROQ_PUBLIC Disconnected final {
  type fmt::formatter<roq::Disconnected> (line 34) | struct fmt::formatter<roq::Disconnected> {
    method parse (line 35) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 36) | auto format(roq::Disconnected const &value, format_context &context) c...

FILE: include/roq/download_begin.hpp
  type roq (line 19) | namespace roq {
    function DownloadBegin (line 22) | struct ROQ_PUBLIC DownloadBegin final {
  type fmt::formatter<roq::DownloadBegin> (line 35) | struct fmt::formatter<roq::DownloadBegin> {
    method parse (line 36) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 37) | auto format(roq::DownloadBegin const &value, format_context &context) ...

FILE: include/roq/download_end.hpp
  type roq (line 19) | namespace roq {
    function DownloadEnd (line 22) | struct ROQ_PUBLIC DownloadEnd final {
  type fmt::formatter<roq::DownloadEnd> (line 36) | struct fmt::formatter<roq::DownloadEnd> {
    method parse (line 37) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 38) | auto format(roq::DownloadEnd const &value, format_context &context) co...

FILE: include/roq/encoding.hpp
  type roq (line 12) | namespace roq {
    type Encoding (line 15) | enum class Encoding : uint32_t {  // NOLINT(performance-enum-size)
  type fmt::formatter<roq::Encoding> (line 26) | struct fmt::formatter<roq::Encoding> {
    method parse (line 27) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 28) | auto format(roq::Encoding const &value, format_context &context) const {

FILE: include/roq/error.hpp
  type roq (line 9) | namespace roq {
    type Error (line 12) | enum class Error : uint8_t {

FILE: include/roq/event.hpp
  type roq (line 13) | namespace roq {
    type Event (line 17) | struct Event final {
      method Event (line 20) | Event(MessageInfo const &message_info, T const &value) : message_inf...
      method Event (line 22) | Event(Event &&) = delete;
      method Event (line 23) | Event(Event const &) = delete;
      method Result (line 30) | Result dispatch(Handler &&handler, Args &&...args) const {
      method create_and_dispatch (line 48) | static void create_and_dispatch(auto &handler, MessageInfo const &me...
    function create_event_and_dispatch (line 56) | inline void create_event_and_dispatch(auto &handler, MessageInfo const...
  type fmt::formatter<roq::Event<T>> (line 63) | struct fmt::formatter<roq::Event<T>> {
    method parse (line 64) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 65) | auto format(roq::Event<T> const &event, format_context &context) const {

FILE: include/roq/exceptions.hpp
  type roq (line 20) | namespace roq {
    type detail (line 22) | namespace detail {
      function create_what (line 24) | constexpr auto create_what(fmt::string_view const &str, Args &&...ar...
    type ROQ_PUBLIC (line 52) | struct ROQ_PUBLIC
    function Exception (line 54) | explicit Exception(format_str const &str, Args &&...args)
    function file (line 59) | virtual std::string_view file() const noexcept { return file_name_; }
    function line (line 60) | virtual int line() const noexcept { return static_cast<int>(line_); }
    function format_to (line 63) | auto format_to(Context &context) const {
    function RuntimeError (line 86) | struct ROQ_PUBLIC RuntimeError : public Exception {
    function RuntimeError (line 91) | struct ROQ_PUBLIC SystemError : public RuntimeError {
    function RuntimeError (line 126) | struct ROQ_PUBLIC RangeError : public RuntimeError {
    function OverflowError (line 131) | struct ROQ_PUBLIC OverflowError : public RuntimeError {
    function LogicError (line 136) | struct ROQ_PUBLIC LogicError : public Exception {
    function InvalidArgument (line 141) | struct ROQ_PUBLIC InvalidArgument : public LogicError {
    function OutOfRange (line 146) | struct ROQ_PUBLIC OutOfRange : public LogicError {
    function LengthError (line 151) | struct ROQ_PUBLIC LengthError : public LogicError {
    function RuntimeError (line 158) | struct ROQ_PUBLIC Fatal : public RuntimeError {
    function FileDoesNotExist (line 163) | struct ROQ_PUBLIC FileDoesNotExist : public RuntimeError {
    function RuntimeError (line 168) | struct ROQ_PUBLIC NotReady : public RuntimeError {
    function NotImplemented (line 173) | struct ROQ_PUBLIC NotImplemented : public RuntimeError {
    function NotSupported (line 178) | struct ROQ_PUBLIC NotSupported : public RuntimeError {
    function RuntimeError (line 183) | struct ROQ_PUBLIC BadState : public RuntimeError {
    function NetworkError (line 190) | struct ROQ_PUBLIC NetworkError : public RuntimeError {
    function TransportError (line 206) | struct ROQ_PUBLIC TransportError : public NetworkError {
    function TransportError (line 211) | struct ROQ_PUBLIC NotConnected : public TransportError {
    function ConnectionRefused (line 218) | struct ROQ_PUBLIC ConnectionRefused : public TransportError {
    function TransportError (line 225) | struct ROQ_PUBLIC TimedOut : public TransportError {
    function SessionError (line 233) | struct ROQ_PUBLIC SessionError : public NetworkError {
    function PermissionDenied (line 238) | struct ROQ_PUBLIC PermissionDenied : public SessionError {
    function OrderNotLive (line 245) | struct ROQ_PUBLIC OrderNotLive : public SessionError {
  type fmt::formatter<roq::Exception> (line 253) | struct fmt::formatter<roq::Exception> {
    method parse (line 254) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 255) | auto format(roq::Exception const &value, format_context &context) cons...
  type fmt::formatter<roq::RuntimeError> (line 259) | struct fmt::formatter<roq::RuntimeError> {
    method parse (line 260) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 261) | auto format(roq::RuntimeError const &value, format_context &context) c...
  type fmt::formatter<roq::SystemError> (line 268) | struct fmt::formatter<roq::SystemError> {
    method parse (line 269) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 270) | auto format(roq::SystemError const &value, format_context &context) co...
  type fmt::formatter<roq::RangeError> (line 274) | struct fmt::formatter<roq::RangeError> {
    method parse (line 275) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 276) | auto format(roq::RangeError const &value, format_context &context) con...
  type fmt::formatter<roq::OverflowError> (line 283) | struct fmt::formatter<roq::OverflowError> {
    method parse (line 284) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 285) | auto format(roq::OverflowError const &value, format_context &context) ...
  type fmt::formatter<roq::LogicError> (line 292) | struct fmt::formatter<roq::LogicError> {
    method parse (line 293) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 294) | auto format(roq::LogicError const &value, format_context &context) con...
  type fmt::formatter<roq::InvalidArgument> (line 301) | struct fmt::formatter<roq::InvalidArgument> {
    method parse (line 302) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 303) | auto format(roq::InvalidArgument const &value, format_context &context...
  type fmt::formatter<roq::OutOfRange> (line 310) | struct fmt::formatter<roq::OutOfRange> {
    method parse (line 311) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 312) | auto format(roq::OutOfRange const &value, format_context &context) con...
  type fmt::formatter<roq::LengthError> (line 319) | struct fmt::formatter<roq::LengthError> {
    method parse (line 320) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 321) | auto format(roq::LengthError const &value, format_context &context) co...
  type fmt::formatter<roq::Fatal> (line 328) | struct fmt::formatter<roq::Fatal> {
    method parse (line 329) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 330) | auto format(roq::Fatal const &value, format_context &context) const {
  type fmt::formatter<roq::FileDoesNotExist> (line 337) | struct fmt::formatter<roq::FileDoesNotExist> {
    method parse (line 338) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 339) | auto format(roq::FileDoesNotExist const &value, format_context &contex...
  type fmt::formatter<roq::NotReady> (line 346) | struct fmt::formatter<roq::NotReady> {
    method parse (line 347) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 348) | auto format(roq::NotReady const &value, format_context &context) const {
  type fmt::formatter<roq::BadState> (line 355) | struct fmt::formatter<roq::BadState> {
    method parse (line 356) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 357) | auto format(roq::BadState const &value, format_context &context) const {
  type fmt::formatter<roq::NetworkError> (line 364) | struct fmt::formatter<roq::NetworkError> {
    method parse (line 365) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 366) | auto format(roq::NetworkError const &value, format_context &context) c...
  type fmt::formatter<roq::TransportError> (line 373) | struct fmt::formatter<roq::TransportError> {
    method parse (line 374) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 375) | auto format(roq::TransportError const &value, format_context &context)...
  type fmt::formatter<roq::NotConnected> (line 382) | struct fmt::formatter<roq::NotConnected> {
    method parse (line 383) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 384) | auto format(roq::NotConnected const &value, format_context &context) c...
  type fmt::formatter<roq::ConnectionRefused> (line 391) | struct fmt::formatter<roq::ConnectionRefused> {
    method parse (line 392) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 393) | auto format(roq::ConnectionRefused const &value, format_context &conte...
  type fmt::formatter<roq::TimedOut> (line 400) | struct fmt::formatter<roq::TimedOut> {
    method parse (line 401) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 402) | auto format(roq::TimedOut const &value, format_context &context) const {
  type fmt::formatter<roq::SessionError> (line 409) | struct fmt::formatter<roq::SessionError> {
    method parse (line 410) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 411) | auto format(roq::SessionError const &value, format_context &context) c...
  type fmt::formatter<roq::PermissionDenied> (line 418) | struct fmt::formatter<roq::PermissionDenied> {
    method parse (line 419) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 420) | auto format(roq::PermissionDenied const &value, format_context &contex...
  type fmt::formatter<roq::OrderNotLive> (line 427) | struct fmt::formatter<roq::OrderNotLive> {
    method parse (line 428) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 429) | auto format(roq::OrderNotLive const &value, format_context &context) c...

FILE: include/roq/execution_instruction.hpp
  type roq (line 12) | namespace roq {
    type ExecutionInstruction (line 15) | enum class ExecutionInstruction : uint32_t {  // NOLINT(performance-en...
  type fmt::formatter<roq::ExecutionInstruction> (line 26) | struct fmt::formatter<roq::ExecutionInstruction> {
    method parse (line 27) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 28) | auto format(roq::ExecutionInstruction const &value, format_context &co...

FILE: include/roq/external_latency.hpp
  type roq (line 21) | namespace roq {
    function ExternalLatency (line 24) | struct ROQ_PUBLIC ExternalLatency final {
  type fmt::formatter<roq::ExternalLatency> (line 39) | struct fmt::formatter<roq::ExternalLatency> {
    method parse (line 40) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 41) | auto format(roq::ExternalLatency const &value, format_context &context...

FILE: include/roq/fill.hpp
  type roq (line 20) | namespace roq {
    function final (line 23) | struct ROQ_PUBLIC Fill final {
  type fmt::formatter<roq::Fill> (line 39) | struct fmt::formatter<roq::Fill> {
    method parse (line 40) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 41) | auto format(roq::Fill const &value, format_context &context) const {

FILE: include/roq/filter.hpp
  type roq (line 12) | namespace roq {
    type Filter (line 15) | enum class Filter : uint64_t {  // NOLINT(performance-enum-size)
  type fmt::formatter<roq::Filter> (line 27) | struct fmt::formatter<roq::Filter> {
    method parse (line 28) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 29) | auto format(roq::Filter const &value, format_context &context) const {

FILE: include/roq/format_str.hpp
  type roq (line 13) | namespace roq {
    type detail (line 15) | namespace detail {
      type static_string (line 18) | struct static_string final {
        method static_string (line 19) | consteval static_string(std::string_view const &str) : length_{std...
        method static_string (line 21) | static_string(static_string &&) = delete;
        method static_string (line 22) | static_string(static_string const &) = default;
        method create (line 27) | static consteval auto create(std::string_view const &str, std::siz...
    type format_str (line 45) | struct format_str final {
      method format_str (line 47) | consteval format_str(T const &str, std::source_location const loc = ...
      method extract_basename (line 58) | static consteval std::string_view extract_basename(char const *path) {
  type fmt::formatter<roq::detail::static_string<N>> (line 76) | struct fmt::formatter<roq::detail::static_string<N>> {
    method parse (line 77) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 78) | auto format(roq::detail::static_string<N> const &value, format_context...

FILE: include/roq/funds_update.hpp
  type roq (line 24) | namespace roq {
    function FundsUpdate (line 27) | struct ROQ_PUBLIC FundsUpdate final {
  type fmt::formatter<roq::FundsUpdate> (line 52) | struct fmt::formatter<roq::FundsUpdate> {
    method parse (line 53) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 54) | auto format(roq::FundsUpdate const &value, format_context &context) co...

FILE: include/roq/gateway_settings.hpp
  type roq (line 23) | namespace roq {
    function GatewaySettings (line 26) | struct ROQ_PUBLIC GatewaySettings final {
  type fmt::formatter<roq::GatewaySettings> (line 51) | struct fmt::formatter<roq::GatewaySettings> {
    method parse (line 52) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 53) | auto format(roq::GatewaySettings const &value, format_context &context...

FILE: include/roq/gateway_status.hpp
  type roq (line 21) | namespace roq {
    function GatewayStatus (line 24) | struct ROQ_PUBLIC GatewayStatus final {
  type fmt::formatter<roq::GatewayStatus> (line 40) | struct fmt::formatter<roq::GatewayStatus> {
    method parse (line 41) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 42) | auto format(roq::GatewayStatus const &value, format_context &context) ...

FILE: include/roq/interval.hpp
  type roq (line 9) | namespace roq {
    type Interval (line 12) | enum class Interval : uint8_t {

FILE: include/roq/layer.hpp
  type roq (line 15) | namespace roq {
    function Layer (line 18) | struct ROQ_PUBLIC Layer final {
  type fmt::formatter<roq::Layer> (line 28) | struct fmt::formatter<roq::Layer> {
    method parse (line 29) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 30) | auto format(roq::Layer const &value, format_context &context) const {

FILE: include/roq/leg.hpp
  type roq (line 16) | namespace roq {
    function final (line 19) | struct ROQ_PUBLIC Leg final {
  type fmt::formatter<roq::Leg> (line 30) | struct fmt::formatter<roq::Leg> {
    method parse (line 31) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 32) | auto format(roq::Leg const &value, format_context &context) const {

FILE: include/roq/legs_update.hpp
  type roq (line 23) | namespace roq {
    function LegsUpdate (line 26) | struct ROQ_PUBLIC LegsUpdate final {
  type fmt::formatter<roq::LegsUpdate> (line 42) | struct fmt::formatter<roq::LegsUpdate> {
    method parse (line 43) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 44) | auto format(roq::LegsUpdate const &value, format_context &context) con...

FILE: include/roq/limits.hpp
  type roq (line 7) | namespace roq {

FILE: include/roq/liquidity.hpp
  type roq (line 9) | namespace roq {
    type Liquidity (line 12) | enum class Liquidity : uint8_t {

FILE: include/roq/map.hpp
  type roq (line 8) | namespace roq {
    type detail (line 10) | namespace detail {
      type MapHelper (line 13) | struct MapHelper final {
        method MapHelper (line 14) | constexpr explicit MapHelper(std::tuple<Args...> const &args) : ar...
        method MapHelper (line 15) | constexpr explicit MapHelper(Args &&...args_) : args_{std::forward...
    type Map (line 35) | struct Map final {
      method Map (line 36) | explicit Map(Args &&...args) : args_{std::forward<Args>(args)...} {}
      method Map (line 37) | explicit Map(Args const &...args) : args_{args...} {}
      method Map (line 39) | Map(Map const &) = delete;
      method R (line 47) | R get() const {
      method helper (line 53) | std::optional<R> helper() const {
    function map (line 62) | inline auto map(Args &&...args) {

FILE: include/roq/margin_mode.hpp
  type roq (line 9) | namespace roq {
    type MarginMode (line 12) | enum class MarginMode : uint8_t {

FILE: include/roq/market_by_order_update.hpp
  type roq (line 26) | namespace roq {
    function MarketByOrderUpdate (line 29) | struct ROQ_PUBLIC MarketByOrderUpdate final {
  type fmt::formatter<roq::MarketByOrderUpdate> (line 53) | struct fmt::formatter<roq::MarketByOrderUpdate> {
    method parse (line 54) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 55) | auto format(roq::MarketByOrderUpdate const &value, format_context &con...

FILE: include/roq/market_by_price_update.hpp
  type roq (line 26) | namespace roq {
    function MarketByPriceUpdate (line 29) | struct ROQ_PUBLIC MarketByPriceUpdate final {
  type fmt::formatter<roq::MarketByPriceUpdate> (line 54) | struct fmt::formatter<roq::MarketByPriceUpdate> {
    method parse (line 55) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 56) | auto format(roq::MarketByPriceUpdate const &value, format_context &con...

FILE: include/roq/market_status.hpp
  type roq (line 22) | namespace roq {
    function MarketStatus (line 25) | struct ROQ_PUBLIC MarketStatus final {
  type fmt::formatter<roq::MarketStatus> (line 44) | struct fmt::formatter<roq::MarketStatus> {
    method parse (line 45) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 46) | auto format(roq::MarketStatus const &value, format_context &context) c...

FILE: include/roq/mask.hpp
  type roq (line 16) | namespace roq {
    type Mask (line 25) | struct Mask final {
      type sentinel (line 28) | struct sentinel final {}
      type iterator (line 30) | struct iterator final {
        method iterator (line 40) | iterator(Mask<T> value) : value_{value.get()} {}
        method reference (line 55) | reference operator*() const {
        method iterator (line 60) | iterator &operator++() { return *this; }
      method Mask (line 68) | constexpr Mask() = default;
      method Mask (line 70) | constexpr explicit Mask(value_type mask) : value_{mask} {}
      method Mask (line 72) | constexpr explicit Mask(T flag) : value_{static_cast<value_type>(fla...
      method Mask (line 74) | constexpr Mask(std::initializer_list<T> flags) {
      method Mask (line 81) | constexpr Mask(Mask const &other, Args &&...args) : value_{other.val...
      method empty (line 85) | constexpr bool empty() const { return value_ == value_type{}; }
      method reset (line 87) | constexpr void reset() { value_ = value_type{}; }
      method value_type (line 89) | constexpr value_type get() const { return value_; }
      method is_same (line 91) | constexpr bool is_same(T flag) const { return value_ == static_cast<...
      method has (line 93) | constexpr bool has(T flag) const { return value_ & static_cast<value...
      method has_any (line 95) | constexpr bool has_any(T flag) const { return (value_ & static_cast<...
      method has_any (line 97) | constexpr bool has_any(std::initializer_list<T> flags) const {
      method has_any (line 105) | constexpr bool has_any(Mask rhs) const { return (value_ & rhs.value_...
      method has_all (line 107) | constexpr bool has_all(T flag) const { return (value_ & static_cast<...
      method has_all (line 109) | constexpr bool has_all(std::initializer_list<T> flags) const {
      method has_all (line 117) | constexpr bool has_all(Mask rhs) const { return (value_ & rhs.value_...
      method Mask (line 119) | constexpr Mask &set(T flag) {
      method Mask (line 124) | constexpr Mask &set(Mask rhs) {
      method Mask (line 129) | constexpr Mask &remove(T flag) {
      method Mask (line 134) | constexpr Mask &remove(Mask rhs) {
      method has_none (line 139) | constexpr bool has_none(T flag) const { return !has_any(flag); }
      method has_none (line 141) | constexpr bool has_none(std::initializer_list<T> flags) const { retu...
      method has_none (line 143) | constexpr bool has_none(Mask rhs) const { return !has_any(rhs); }
      method Mask (line 145) | constexpr Mask negate() const { return Mask{~value_}; }
      method Mask (line 147) | constexpr Mask logical_and(Mask rhs) const { return Mask{value_ & rh...
      method Mask (line 149) | constexpr Mask &set(std::initializer_list<T> flags) {
      method Mask (line 156) | constexpr Mask operator~() const { return negate(); }
      method Mask (line 158) | constexpr Mask operator&(Mask rhs) const { return logical_and(rhs); }
      method Mask (line 160) | constexpr Mask &operator|=(T flag) {
      method Mask (line 165) | constexpr Mask &operator|=(Mask rhs) {
  type fmt::formatter<roq::Mask<T>> (line 177) | struct fmt::formatter<roq::Mask<T>> {
    method parse (line 178) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 179) | auto format(roq::Mask<T> const &value, format_context &context) const {

FILE: include/roq/mass_quote.hpp
  type roq (line 24) | namespace roq {
    function MassQuote (line 27) | struct ROQ_PUBLIC MassQuote final {
  type fmt::formatter<roq::MassQuote> (line 45) | struct fmt::formatter<roq::MassQuote> {
    method parse (line 46) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 47) | auto format(roq::MassQuote const &value, format_context &context) const {

FILE: include/roq/mass_quote_ack.hpp
  type roq (line 22) | namespace roq {
    function MassQuoteAck (line 25) | struct ROQ_PUBLIC MassQuoteAck final {
  type fmt::formatter<roq::MassQuoteAck> (line 46) | struct fmt::formatter<roq::MassQuoteAck> {
    method parse (line 47) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 48) | auto format(roq::MassQuoteAck const &value, format_context &context) c...

FILE: include/roq/mbo_update.hpp
  type roq (line 19) | namespace roq {
    function MBOUpdate (line 22) | struct ROQ_PUBLIC MBOUpdate final {
  type fmt::formatter<roq::MBOUpdate> (line 35) | struct fmt::formatter<roq::MBOUpdate> {
    method parse (line 36) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 37) | auto format(roq::MBOUpdate const &value, format_context &context) const {

FILE: include/roq/mbp_update.hpp
  type roq (line 16) | namespace roq {
    function MBPUpdate (line 19) | struct ROQ_PUBLIC MBPUpdate final {
  type fmt::formatter<roq::MBPUpdate> (line 31) | struct fmt::formatter<roq::MBPUpdate> {
    method parse (line 32) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 33) | auto format(roq::MBPUpdate const &value, format_context &context) const {

FILE: include/roq/measurement.hpp
  type roq (line 16) | namespace roq {
    function Measurement (line 19) | struct ROQ_PUBLIC Measurement final {
  type fmt::formatter<roq::Measurement> (line 27) | struct fmt::formatter<roq::Measurement> {
    method parse (line 28) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 29) | auto format(roq::Measurement const &value, format_context &context) co...

FILE: include/roq/message_info.hpp
  type roq (line 19) | namespace roq {
    function MessageInfo (line 22) | struct ROQ_PUBLIC MessageInfo final {
  type fmt::formatter<roq::MessageInfo> (line 40) | struct fmt::formatter<roq::MessageInfo> {
    method parse (line 41) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 42) | auto format(roq::MessageInfo const &value, format_context &context) co...

FILE: include/roq/modify_order.hpp
  type roq (line 22) | namespace roq {
    function ModifyOrder (line 25) | struct ROQ_PUBLIC ModifyOrder final {
  type fmt::formatter<roq::ModifyOrder> (line 46) | struct fmt::formatter<roq::ModifyOrder> {
    method parse (line 47) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 48) | auto format(roq::ModifyOrder const &value, format_context &context) co...

FILE: include/roq/name.hpp
  type roq (line 7) | namespace roq {

FILE: include/roq/option_type.hpp
  type roq (line 9) | namespace roq {
    type OptionType (line 12) | enum class OptionType : uint8_t {

FILE: include/roq/order_ack.hpp
  type roq (line 30) | namespace roq {
    function OrderAck (line 33) | struct ROQ_PUBLIC OrderAck final {
  type fmt::formatter<roq::OrderAck> (line 75) | struct fmt::formatter<roq::OrderAck> {
    method parse (line 76) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 77) | auto format(roq::OrderAck const &value, format_context &context) const {

FILE: include/roq/order_cancel_policy.hpp
  type roq (line 9) | namespace roq {
    type OrderCancelPolicy (line 12) | enum class OrderCancelPolicy : uint8_t {

FILE: include/roq/order_management.hpp
  type roq (line 9) | namespace roq {
    type OrderManagement (line 12) | enum class OrderManagement : uint8_t {

FILE: include/roq/order_status.hpp
  type roq (line 9) | namespace roq {
    type OrderStatus (line 12) | enum class OrderStatus : uint8_t {

FILE: include/roq/order_type.hpp
  type roq (line 9) | namespace roq {
    type OrderType (line 12) | enum class OrderType : uint8_t {

FILE: include/roq/order_update.hpp
  type roq (line 33) | namespace roq {
    function OrderUpdate (line 36) | struct ROQ_PUBLIC OrderUpdate final {
  type fmt::formatter<roq::OrderUpdate> (line 89) | struct fmt::formatter<roq::OrderUpdate> {
    method parse (line 90) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 91) | auto format(roq::OrderUpdate const &value, format_context &context) co...

FILE: include/roq/origin.hpp
  type roq (line 9) | namespace roq {
    type Origin (line 12) | enum class Origin : uint8_t {

FILE: include/roq/parameter.hpp
  type roq (line 15) | namespace roq {
    function Parameter (line 18) | struct ROQ_PUBLIC Parameter final {
  type fmt::formatter<roq::Parameter> (line 30) | struct fmt::formatter<roq::Parameter> {
    method parse (line 31) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 32) | auto format(roq::Parameter const &value, format_context &context) const {

FILE: include/roq/parameters_update.hpp
  type roq (line 23) | namespace roq {
    function ParametersUpdate (line 26) | struct ROQ_PUBLIC ParametersUpdate final {
  type fmt::formatter<roq::ParametersUpdate> (line 41) | struct fmt::formatter<roq::ParametersUpdate> {
    method parse (line 42) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 43) | auto format(roq::ParametersUpdate const &value, format_context &contex...

FILE: include/roq/portfolio.hpp
  type roq (line 26) | namespace roq {
    function Portfolio (line 29) | struct ROQ_PUBLIC Portfolio final {
  type fmt::formatter<roq::Portfolio> (line 49) | struct fmt::formatter<roq::Portfolio> {
    method parse (line 50) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 51) | auto format(roq::Portfolio const &value, format_context &context) const {

FILE: include/roq/portfolio_update.hpp
  type roq (line 25) | namespace roq {
    function PortfolioUpdate (line 28) | struct ROQ_PUBLIC PortfolioUpdate final {
  type fmt::formatter<roq::PortfolioUpdate> (line 46) | struct fmt::formatter<roq::PortfolioUpdate> {
    method parse (line 47) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 48) | auto format(roq::PortfolioUpdate const &value, format_context &context...

FILE: include/roq/position.hpp
  type roq (line 16) | namespace roq {
    function Position (line 19) | struct ROQ_PUBLIC Position final {
  type fmt::formatter<roq::Position> (line 30) | struct fmt::formatter<roq::Position> {
    method parse (line 31) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 32) | auto format(roq::Position const &value, format_context &context) const {

FILE: include/roq/position_effect.hpp
  type roq (line 9) | namespace roq {
    type PositionEffect (line 12) | enum class PositionEffect : uint8_t {

FILE: include/roq/position_update.hpp
  type roq (line 24) | namespace roq {
    function PositionUpdate (line 27) | struct ROQ_PUBLIC PositionUpdate final {
  type fmt::formatter<roq::PositionUpdate> (line 51) | struct fmt::formatter<roq::PositionUpdate> {
    method parse (line 52) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 53) | auto format(roq::PositionUpdate const &value, format_context &context)...

FILE: include/roq/precision.hpp
  type roq (line 9) | namespace roq {
    type Precision (line 12) | enum class Precision : uint8_t {

FILE: include/roq/precision_2.hpp
  type roq (line 14) | namespace roq {
    function Precision2 (line 18) | struct ROQ_PUBLIC Precision2 final {
  type fmt::formatter<roq::Precision2> (line 26) | struct fmt::formatter<roq::Precision2> {
    method parse (line 27) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 28) | auto format(roq::Precision2 const &value, format_context &context) con...

FILE: include/roq/priority.hpp
  type roq (line 9) | namespace roq {
    type Priority (line 12) | enum class Priority : uint8_t {

FILE: include/roq/protocol.hpp
  type roq (line 9) | namespace roq {
    type Protocol (line 12) | enum class Protocol : uint8_t {

FILE: include/roq/quality_of_service.hpp
  type roq (line 9) | namespace roq {
    type QualityOfService (line 12) | enum class QualityOfService : uint8_t {

FILE: include/roq/quantity_type.hpp
  type roq (line 9) | namespace roq {
    type QuantityType (line 12) | enum class QuantityType : uint8_t {

FILE: include/roq/quote.hpp
  type roq (line 18) | namespace roq {
    function Quote (line 21) | struct ROQ_PUBLIC Quote final {
  type fmt::formatter<roq::Quote> (line 36) | struct fmt::formatter<roq::Quote> {
    method parse (line 37) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 38) | auto format(roq::Quote const &value, format_context &context) const {

FILE: include/roq/rate_limit.hpp
  type roq (line 18) | namespace roq {
    function RateLimit (line 21) | struct ROQ_PUBLIC RateLimit final {
  type fmt::formatter<roq::RateLimit> (line 32) | struct fmt::formatter<roq::RateLimit> {
    method parse (line 33) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 34) | auto format(roq::RateLimit const &value, format_context &context) const {

FILE: include/roq/rate_limit_trigger.hpp
  type roq (line 27) | namespace roq {
    function RateLimitTrigger (line 30) | struct ROQ_PUBLIC RateLimitTrigger final {
  type fmt::formatter<roq::RateLimitTrigger> (line 51) | struct fmt::formatter<roq::RateLimitTrigger> {
    method parse (line 52) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 53) | auto format(roq::RateLimitTrigger const &value, format_context &contex...

FILE: include/roq/rate_limit_type.hpp
  type roq (line 9) | namespace roq {
    type RateLimitType (line 12) | enum class RateLimitType : uint8_t {

FILE: include/roq/rate_limits_update.hpp
  type roq (line 23) | namespace roq {
    function RateLimitsUpdate (line 26) | struct ROQ_PUBLIC RateLimitsUpdate final {
  type fmt::formatter<roq::RateLimitsUpdate> (line 42) | struct fmt::formatter<roq::RateLimitsUpdate> {
    method parse (line 43) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 44) | auto format(roq::RateLimitsUpdate const &value, format_context &contex...

FILE: include/roq/ready.hpp
  type roq (line 17) | namespace roq {
    type ROQ_PUBLIC (line 20) | struct ROQ_PUBLIC
  type fmt::formatter<roq::Ready> (line 31) | struct fmt::formatter<roq::Ready> {
    method parse (line 32) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 33) | auto format(roq::Ready const &, format_context &context) const {

FILE: include/roq/reference_data.hpp
  type roq (line 27) | namespace roq {
    function ReferenceData (line 30) | struct ROQ_PUBLIC ReferenceData final {
  type fmt::formatter<roq::ReferenceData> (line 74) | struct fmt::formatter<roq::ReferenceData> {
    method parse (line 75) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 76) | auto format(roq::ReferenceData const &value, format_context &context) ...

FILE: include/roq/remove_routes.hpp
  type roq (line 20) | namespace roq {
    function RemoveRoutes (line 23) | struct ROQ_PUBLIC RemoveRoutes final {
  type fmt::formatter<roq::RemoveRoutes> (line 36) | struct fmt::formatter<roq::RemoveRoutes> {
    method parse (line 37) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 38) | auto format(roq::RemoveRoutes const &value, format_context &context) c...

FILE: include/roq/request_id_type.hpp
  type roq (line 9) | namespace roq {
    type RequestIdType (line 12) | enum class RequestIdType : uint8_t {

FILE: include/roq/request_status.hpp
  type roq (line 9) | namespace roq {
    type RequestStatus (line 12) | enum class RequestStatus : uint8_t {

FILE: include/roq/request_type.hpp
  type roq (line 9) | namespace roq {
    type RequestType (line 12) | enum class RequestType : uint8_t {

FILE: include/roq/risk_limit.hpp
  type roq (line 16) | namespace roq {
    function RiskLimit (line 19) | struct ROQ_PUBLIC RiskLimit final {
  type fmt::formatter<roq::RiskLimit> (line 34) | struct fmt::formatter<roq::RiskLimit> {
    method parse (line 35) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 36) | auto format(roq::RiskLimit const &value, format_context &context) const {

FILE: include/roq/risk_limits.hpp
  type roq (line 23) | namespace roq {
    function RiskLimits (line 26) | struct ROQ_PUBLIC RiskLimits final {
  type fmt::formatter<roq::RiskLimits> (line 44) | struct fmt::formatter<roq::RiskLimits> {
    method parse (line 45) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 46) | auto format(roq::RiskLimits const &value, format_context &context) con...

FILE: include/roq/risk_limits_update.hpp
  type roq (line 23) | namespace roq {
    function RiskLimitsUpdate (line 26) | struct ROQ_PUBLIC RiskLimitsUpdate final {
  type fmt::formatter<roq::RiskLimitsUpdate> (line 43) | struct fmt::formatter<roq::RiskLimitsUpdate> {
    method parse (line 44) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 45) | auto format(roq::RiskLimitsUpdate const &value, format_context &contex...

FILE: include/roq/route.hpp
  type roq (line 15) | namespace roq {
    function Route (line 18) | struct ROQ_PUBLIC Route final {
  type fmt::formatter<roq::Route> (line 26) | struct fmt::formatter<roq::Route> {
    method parse (line 27) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 28) | auto format(roq::Route const &value, format_context &context) const {

FILE: include/roq/route_ack.hpp
  type roq (line 22) | namespace roq {
    function RouteAck (line 25) | struct ROQ_PUBLIC RouteAck final {
  type fmt::formatter<roq::RouteAck> (line 39) | struct fmt::formatter<roq::RouteAck> {
    method parse (line 40) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 41) | auto format(roq::RouteAck const &value, format_context &context) const {

FILE: include/roq/route_request_status.hpp
  type roq (line 9) | namespace roq {
    type RouteRequestStatus (line 12) | enum class RouteRequestStatus : uint8_t {

FILE: include/roq/routing.hpp
  type roq (line 18) | namespace roq {
    function Routing (line 21) | struct ROQ_PUBLIC Routing final {
  type fmt::formatter<roq::Routing> (line 36) | struct fmt::formatter<roq::Routing> {
    method parse (line 37) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 38) | auto format(roq::Routing const &value, format_context &context) const {

FILE: include/roq/security_type.hpp
  type roq (line 9) | namespace roq {
    type SecurityType (line 12) | enum class SecurityType : uint8_t {

FILE: include/roq/service_update.hpp
  type roq (line 22) | namespace roq {
    function ServiceUpdate (line 25) | struct ROQ_PUBLIC ServiceUpdate final {
  type fmt::formatter<roq::ServiceUpdate> (line 42) | struct fmt::formatter<roq::ServiceUpdate> {
    method parse (line 43) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 44) | auto format(roq::ServiceUpdate const &value, format_context &context) ...

FILE: include/roq/side.hpp
  type roq (line 9) | namespace roq {
    type Side (line 12) | enum class Side : uint8_t {

FILE: include/roq/start.hpp
  type roq (line 17) | namespace roq {
    type ROQ_PUBLIC (line 20) | struct ROQ_PUBLIC
  type fmt::formatter<roq::Start> (line 31) | struct fmt::formatter<roq::Start> {
    method parse (line 32) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 33) | auto format(roq::Start const &, format_context &context) const {

FILE: include/roq/state.hpp
  type roq (line 9) | namespace roq {
    type State (line 12) | enum class State : uint8_t {

FILE: include/roq/statistics.hpp
  type roq (line 19) | namespace roq {
    function Statistics (line 22) | struct ROQ_PUBLIC Statistics final {
  type fmt::formatter<roq::Statistics> (line 32) | struct fmt::formatter<roq::Statistics> {
    method parse (line 33) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 34) | auto format(roq::Statistics const &value, format_context &context) con...

FILE: include/roq/statistics_type.hpp
  type roq (line 9) | namespace roq {
    type StatisticsType (line 12) | enum class StatisticsType : uint8_t {

FILE: include/roq/statistics_update.hpp
  type roq (line 25) | namespace roq {
    function StatisticsUpdate (line 28) | struct ROQ_PUBLIC StatisticsUpdate final {
  type fmt::formatter<roq::StatisticsUpdate> (line 48) | struct fmt::formatter<roq::StatisticsUpdate> {
    method parse (line 49) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 50) | auto format(roq::StatisticsUpdate const &value, format_context &contex...

FILE: include/roq/stop.hpp
  type roq (line 17) | namespace roq {
    type ROQ_PUBLIC (line 20) | struct ROQ_PUBLIC
  type fmt::formatter<roq::Stop> (line 31) | struct fmt::formatter<roq::Stop> {
    method parse (line 32) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 33) | auto format(roq::Stop const &, format_context &context) const {

FILE: include/roq/strategy_update.hpp
  type roq (line 21) | namespace roq {
    function StrategyUpdate (line 24) | struct ROQ_PUBLIC StrategyUpdate final {
  type fmt::formatter<roq::StrategyUpdate> (line 41) | struct fmt::formatter<roq::StrategyUpdate> {
    method parse (line 42) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 43) | auto format(roq::StrategyUpdate const &value, format_context &context)...

FILE: include/roq/stream_status.hpp
  type roq (line 26) | namespace roq {
    function StreamStatus (line 29) | struct ROQ_PUBLIC StreamStatus final {
  type fmt::formatter<roq::StreamStatus> (line 54) | struct fmt::formatter<roq::StreamStatus> {
    method parse (line 55) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 56) | auto format(roq::StreamStatus const &value, format_context &context) c...

FILE: include/roq/string.hpp
  type roq (line 18) | namespace roq {
    function String (line 33) | struct ROQ_PACKED String {
    function copy (line 114) | constexpr void copy(std::string_view const &text) {
    function set_length (line 124) | constexpr void set_length(size_t len) {
  type fmt::formatter<roq::String<N>> (line 143) | struct fmt::formatter<roq::String<N>> {
    method parse (line 144) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 145) | auto format(roq::String<N> const &value, format_context &context) const {

FILE: include/roq/string_types.hpp
  type roq (line 9) | namespace roq {
    type detail (line 11) | namespace detail {
    type ROQ_PUBLIC (line 45) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 49) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 53) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 57) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 61) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 65) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 69) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 73) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 77) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 81) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 85) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 89) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 93) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 97) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 101) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 105) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 109) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 113) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 117) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 121) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 125) | struct ROQ_PUBLIC
    type ROQ_PUBLIC (line 129) | struct ROQ_PUBLIC
  type fmt::formatter<roq::Source> (line 161) | struct fmt::formatter<roq::Source> {
    method parse (line 162) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 163) | auto format(roq::Source const &value, format_context &context) const {
  type fmt::formatter<roq::User> (line 170) | struct fmt::formatter<roq::User> {
    method parse (line 171) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 172) | auto format(roq::User const &value, format_context &context) const {
  type fmt::formatter<roq::Account> (line 179) | struct fmt::formatter<roq::Account> {
    method parse (line 180) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 181) | auto format(roq::Account const &value, format_context &context) const {
  type fmt::formatter<roq::Exchange> (line 188) | struct fmt::formatter<roq::Exchange> {
    method parse (line 189) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 190) | auto format(roq::Exchange const &value, format_context &context) const {
  type fmt::formatter<roq::Symbol> (line 197) | struct fmt::formatter<roq::Symbol> {
    method parse (line 198) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 199) | auto format(roq::Symbol const &value, format_context &context) const {
  type fmt::formatter<roq::Currency> (line 206) | struct fmt::formatter<roq::Currency> {
    method parse (line 207) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 208) | auto format(roq::Currency const &value, format_context &context) const {
  type fmt::formatter<roq::CFICode> (line 215) | struct fmt::formatter<roq::CFICode> {
    method parse (line 216) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 217) | auto format(roq::CFICode const &value, format_context &context) const {
  type fmt::formatter<roq::MBOOrderId> (line 224) | struct fmt::formatter<roq::MBOOrderId> {
    method parse (line 225) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 226) | auto format(roq::MBOOrderId const &value, format_context &context) con...
  type fmt::formatter<roq::RequestTemplate> (line 233) | struct fmt::formatter<roq::RequestTemplate> {
    method parse (line 234) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 235) | auto format(roq::RequestTemplate const &value, format_context &context...
  type fmt::formatter<roq::ExternalAccount> (line 242) | struct fmt::formatter<roq::ExternalAccount> {
    method parse (line 243) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 244) | auto format(roq::ExternalAccount const &value, format_context &context...
  type fmt::formatter<roq::ExternalOrderId> (line 251) | struct fmt::formatter<roq::ExternalOrderId> {
    method parse (line 252) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 253) | auto format(roq::ExternalOrderId const &value, format_context &context...
  type fmt::formatter<roq::ExternalTradeId> (line 260) | struct fmt::formatter<roq::ExternalTradeId> {
    method parse (line 261) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 262) | auto format(roq::ExternalTradeId const &value, format_context &context...
  type fmt::formatter<roq::RoutingId> (line 269) | struct fmt::formatter<roq::RoutingId> {
    method parse (line 270) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 271) | auto format(roq::RoutingId const &value, format_context &context) const {
  type fmt::formatter<roq::ClOrdId> (line 278) | struct fmt::formatter<roq::ClOrdId> {
    method parse (line 279) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 280) | auto format(roq::ClOrdId const &value, format_context &context) const {
  type fmt::formatter<roq::RequestId> (line 287) | struct fmt::formatter<roq::RequestId> {
    method parse (line 288) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 289) | auto format(roq::RequestId const &value, format_context &context) const {
  type fmt::formatter<roq::Label> (line 296) | struct fmt::formatter<roq::Label> {
    method parse (line 297) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 298) | auto format(roq::Label const &value, format_context &context) const {
  type fmt::formatter<roq::MeasurementKey> (line 305) | struct fmt::formatter<roq::MeasurementKey> {
    method parse (line 306) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 307) | auto format(roq::MeasurementKey const &value, format_context &context)...
  type fmt::formatter<roq::MatrixKey> (line 314) | struct fmt::formatter<roq::MatrixKey> {
    method parse (line 315) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 316) | auto format(roq::MatrixKey const &value, format_context &context) const {
  type fmt::formatter<roq::Description> (line 323) | struct fmt::formatter<roq::Description> {
    method parse (line 324) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 325) | auto format(roq::Description const &value, format_context &context) co...
  type fmt::formatter<roq::TimeZone> (line 332) | struct fmt::formatter<roq::TimeZone> {
    method parse (line 333) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 334) | auto format(roq::TimeZone const &value, format_context &context) const {
  type fmt::formatter<roq::ParameterKey> (line 341) | struct fmt::formatter<roq::ParameterKey> {
    method parse (line 342) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 343) | auto format(roq::ParameterKey const &value, format_context &context) c...
  type fmt::formatter<roq::ParameterValue> (line 350) | struct fmt::formatter<roq::ParameterValue> {
    method parse (line 351) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 352) | auto format(roq::ParameterValue const &value, format_context &context)...

FILE: include/roq/subscribe.hpp
  type roq (line 22) | namespace roq {
    function Subscribe (line 25) | struct ROQ_PUBLIC Subscribe final {
  type fmt::formatter<roq::Subscribe> (line 39) | struct fmt::formatter<roq::Subscribe> {
    method parse (line 40) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 41) | auto format(roq::Subscribe const &value, format_context &context) const {

FILE: include/roq/support_type.hpp
  type roq (line 12) | namespace roq {
    type SupportType (line 15) | enum class SupportType : uint64_t {  // NOLINT(performance-enum-size)
  type fmt::formatter<roq::SupportType> (line 39) | struct fmt::formatter<roq::SupportType> {
    method parse (line 40) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 41) | auto format(roq::SupportType const &value, format_context &context) co...

FILE: include/roq/tick_size_step.hpp
  type roq (line 15) | namespace roq {
    function TickSizeStep (line 18) | struct ROQ_PUBLIC TickSizeStep final {
  type fmt::formatter<roq::TickSizeStep> (line 26) | struct fmt::formatter<roq::TickSizeStep> {
    method parse (line 27) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 28) | auto format(roq::TickSizeStep const &value, format_context &context) c...

FILE: include/roq/time_in_force.hpp
  type roq (line 9) | namespace roq {
    type TimeInForce (line 12) | enum class TimeInForce : uint8_t {

FILE: include/roq/time_series_update.hpp
  type roq (line 28) | namespace roq {
    function TimeSeriesUpdate (line 31) | struct ROQ_PUBLIC TimeSeriesUpdate final {
  type fmt::formatter<roq::TimeSeriesUpdate> (line 52) | struct fmt::formatter<roq::TimeSeriesUpdate> {
    method parse (line 53) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 54) | auto format(roq::TimeSeriesUpdate const &value, format_context &contex...

FILE: include/roq/timer.hpp
  type roq (line 20) | namespace roq {
    function Timer (line 23) | struct ROQ_PUBLIC Timer final {
  type fmt::formatter<roq::Timer> (line 36) | struct fmt::formatter<roq::Timer> {
    method parse (line 37) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 38) | auto format(roq::Timer const &value, format_context &context) const {

FILE: include/roq/top_of_book.hpp
  type roq (line 24) | namespace roq {
    function TopOfBook (line 27) | struct ROQ_PUBLIC TopOfBook final {
  type fmt::formatter<roq::TopOfBook> (line 49) | struct fmt::formatter<roq::TopOfBook> {
    method parse (line 50) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 51) | auto format(roq::TopOfBook const &value, format_context &context) const {

FILE: include/roq/trace.hpp
  type roq (line 13) | namespace roq {
    type Trace (line 16) | struct Trace final {
      method Trace (line 19) | Trace(TraceInfo const &trace_info, T const &value) : trace_info{trac...
      method Trace (line 21) | Trace(Trace &&) = delete;
      method Trace (line 22) | Trace(Trace const &) = delete;
      method create_and_dispatch (line 36) | static void create_and_dispatch(auto &handler, TraceInfo const &trac...
    function create_trace_and_dispatch (line 43) | inline void create_trace_and_dispatch(auto &handler, TraceInfo const &...
  type fmt::formatter<roq::Trace<T>> (line 50) | struct fmt::formatter<roq::Trace<T>> {
    method parse (line 51) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 52) | auto format(roq::Trace<T> const &event, format_context &context) const {

FILE: include/roq/trace_info.hpp
  type roq (line 16) | namespace roq {
    function TraceInfo (line 22) | struct ROQ_PUBLIC TraceInfo final {
  type fmt::formatter<roq::TraceInfo> (line 49) | struct fmt::formatter<roq::TraceInfo> {
    method parse (line 50) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 51) | auto format(roq::TraceInfo const &value, format_context &context) const {

FILE: include/roq/trade.hpp
  type roq (line 17) | namespace roq {
    function Trade (line 20) | struct ROQ_PUBLIC Trade final {
  type fmt::formatter<roq::Trade> (line 32) | struct fmt::formatter<roq::Trade> {
    method parse (line 33) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 34) | auto format(roq::Trade const &value, format_context &context) const {

FILE: include/roq/trade_summary.hpp
  type roq (line 25) | namespace roq {
    function TradeSummary (line 28) | struct ROQ_PUBLIC TradeSummary final {
  type fmt::formatter<roq::TradeSummary> (line 49) | struct fmt::formatter<roq::TradeSummary> {
    method parse (line 50) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 51) | auto format(roq::TradeSummary const &value, format_context &context) c...

FILE: include/roq/trade_update.hpp
  type roq (line 29) | namespace roq {
    function TradeUpdate (line 32) | struct ROQ_PUBLIC TradeUpdate final {
  type fmt::formatter<roq::TradeUpdate> (line 66) | struct fmt::formatter<roq::TradeUpdate> {
    method parse (line 67) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 68) | auto format(roq::TradeUpdate const &value, format_context &context) co...

FILE: include/roq/trading_status.hpp
  type roq (line 9) | namespace roq {
    type TradingStatus (line 12) | enum class TradingStatus : uint8_t {

FILE: include/roq/transport.hpp
  type roq (line 9) | namespace roq {
    type Transport (line 12) | enum class Transport : uint8_t {

FILE: include/roq/update_action.hpp
  type roq (line 9) | namespace roq {
    type UpdateAction (line 12) | enum class UpdateAction : uint8_t {

FILE: include/roq/update_reason.hpp
  type roq (line 9) | namespace roq {
    type UpdateReason (line 12) | enum class UpdateReason : uint8_t {

FILE: include/roq/update_type.hpp
  type roq (line 9) | namespace roq {
    type UpdateType (line 12) | enum class UpdateType : uint8_t {

FILE: include/roq/uuid.hpp
  type roq (line 9) | namespace roq {
    type UUID (line 17) | struct alignas(16) UUID final {
      method UUID (line 20) | UUID() = default;
      method UUID (line 22) | UUID(UUID const &) = default;
      method UUID (line 24) | UUID &operator=(UUID const &) = default;
      method UUID (line 26) | explicit UUID(value_type value) : value_{create(value)} {}
      method UUID (line 28) | UUID(uint64_t high, uint64_t low) : value_{create(high, low)} {}
      method value_type (line 52) | constexpr value_type *data() { return &value_; }
      method value_type (line 53) | constexpr value_type const *data() const { return &value_; }
      method size (line 55) | constexpr size_t size() const { return sizeof(value_); }
      method empty (line 57) | constexpr bool empty() const { return value_ == value_type{}; }
      method value_type (line 60) | static value_type create(value_type value) {
      method value_type (line 67) | static value_type create(uint64_t high, uint64_t low) {
  type fmt::formatter<roq::UUID> (line 86) | struct fmt::formatter<roq::UUID> {
    method parse (line 87) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 88) | auto format(roq::UUID const &value, format_context &context) const {

FILE: include/roq/variant_type.hpp
  type roq (line 9) | namespace roq {
    type VariantType (line 12) | enum class VariantType : uint8_t {

FILE: include/roq/version.hpp
  type roq (line 9) | namespace roq {
    type Version (line 11) | struct Version final {
  type fmt::formatter<roq::Version> (line 22) | struct fmt::formatter<roq::Version> {
    method parse (line 23) | constexpr auto parse(format_parse_context &context) { return std::begi...
    method format (line 24) | auto format(roq::Version const &value, format_context &context) const {

FILE: test/main.cpp
  function main (line 7) | int main(int argc, char **argv) {

FILE: test/mask.cpp
  type E (line 16) | enum class E : uint32_t {
  type E2 (line 51) | enum class E2 : uint32_t {
Condensed preview — 284 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (338K chars).
[
  {
    "path": ".clang-format",
    "chars": 737,
    "preview": "---\nBasedOnStyle: Google\nAlignAfterOpenBracket: AlwaysBreak\nAllowAllParametersOfDeclarationOnNextLine: true\nAllowShortCa"
  },
  {
    "path": ".clang-tidy",
    "chars": 1693,
    "preview": "---\nChecks: bugprone-*, modernize-*, performance-*, readability-*, -bugprone-branch-clone,\n  -bugprone-easily-swappable-"
  },
  {
    "path": ".cmake-format.yaml",
    "chars": 44,
    "preview": "---\nformat:\n  line_width: 160\n  tab_size: 2\n"
  },
  {
    "path": ".gitattributes",
    "chars": 95,
    "preview": "cmake/* linguist-vendored\ndoxygen/Doxyfile.in linguist-vendored\n*.hpp.in linguist-language=C++\n"
  },
  {
    "path": ".gitignore",
    "chars": 268,
    "preview": "# vim\n*.sw[po]\n\n# cmake\n*.[ao]\n*.cmake\n*.so\n*.dylib\nCMake*.in\nCMakeCache.txt\nCMakeFiles/\nDartConfiguration.tcl\nMakefile\n"
  },
  {
    "path": ".gitmodules",
    "chars": 218,
    "preview": "[submodule \"roq-cmake\"]\n\tpath = cmake\n\turl = https://github.com/roq-trading/roq-cmake.git\n\tignore = dirty\n[submodule \"ro"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 21975,
    "preview": "# Change Log\n\nAll notable changes will be documented in this file.\n\n## Head\n\n## 1.1.3 &ndash; 2026-03-12\n\n### Changed\n\n*"
  },
  {
    "path": "CMakeLists.txt",
    "chars": 2218,
    "preview": "cmake_minimum_required(VERSION 4.0)\n\nset(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})\n\n# co"
  },
  {
    "path": "LICENSE",
    "chars": 1079,
    "preview": "MIT License\n\nCopyright (c) 2017-2026, Hans Erik Thrane\n\nPermission is hereby granted, free of charge, to any person obta"
  },
  {
    "path": "README.md",
    "chars": 4752,
    "preview": "# roq-api\n\nAPI for algorithmic and high-frequency trading (HFT).\n\n> This project does **not** contain the closed source "
  },
  {
    "path": "conda/bld.bat",
    "chars": 5,
    "preview": "#xyz\n"
  },
  {
    "path": "conda/meta.yaml",
    "chars": 629,
    "preview": "package:\n  name: roq-api\n  version: {{ GIT_DESCRIBE_TAG }}\n\nsource:\n  git_url: ..\n\nbuild:\n  skip: true  # [not unix]\n  n"
  },
  {
    "path": "doxygen/.gitignore",
    "chars": 38,
    "preview": "Doxyfile\ndoxygen-build.stamp\nhtml\nxml\n"
  },
  {
    "path": "doxygen/CMakeLists.txt",
    "chars": 826,
    "preview": "set(TARGET_NAME ${PROJECT_NAME}-doxygen)\n\nset(TARGET_DIR ${CMAKE_INSTALL_DATADIR}/doc/${PROJECT_NAME})\n\n# doxyfile\n\nset("
  },
  {
    "path": "doxygen/Doxyfile.in",
    "chars": 602,
    "preview": "PROJECT_NAME           = \"roq-api\"\nPROJECT_NUMBER         = \"@ROQ_VERSION@\"\nEXTRACT_ALL            = YES\nEXTRACT_PRIVATE"
  },
  {
    "path": "include/roq/CMakeLists.txt",
    "chars": 3188,
    "preview": "set(TARGET_NAME ${PROJECT_NAME}-include-cpp)\n\ninclude(RoqAutogen)\n\nset(TARGET_DIR ${CMAKE_INSTALL_INCLUDEDIR}/roq)\n\n# sc"
  },
  {
    "path": "include/roq/action.hpp",
    "chars": 303,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/add_market.hpp",
    "chars": 1101,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/add_routes.hpp",
    "chars": 1040,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/api.hpp",
    "chars": 6582,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include \"roq/compat.hpp\"\n\n// convenience\n\n#include \"roq/"
  },
  {
    "path": "include/roq/api.hpp.in",
    "chars": 6636,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include \"roq/compat.hpp\"\n\n// convenience\n\n#include \"roq/"
  },
  {
    "path": "include/roq/args/parser.hpp",
    "chars": 592,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include \"roq/compat.hpp\"\n\n#include <span>\n#include <stri"
  },
  {
    "path": "include/roq/bar.hpp",
    "chars": 2107,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/batch_begin.hpp",
    "chars": 858,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/batch_end.hpp",
    "chars": 842,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/buffer_capacity.hpp",
    "chars": 482,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/cancel_all_orders.hpp",
    "chars": 1536,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/cancel_all_orders_ack.hpp",
    "chars": 3291,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/cancel_order.hpp",
    "chars": 1991,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/cancel_quotes.hpp",
    "chars": 1094,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/cancel_quotes_ack.hpp",
    "chars": 2182,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/category.hpp",
    "chars": 304,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/client/custom_message.hpp",
    "chars": 1245,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n#pragma once\n\n#include \"roq/compat.hpp\"\n\n#include <fmt/format.h>\n\n#inclu"
  },
  {
    "path": "include/roq/clock.hpp",
    "chars": 1010,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include <chrono>\n#include <cstdint>\n#include <ctime>\n\n#i"
  },
  {
    "path": "include/roq/compat.hpp",
    "chars": 928,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include <cstddef>\n\n#if defined(__GNUC__)\n#define ROQ_PUB"
  },
  {
    "path": "include/roq/connected.hpp",
    "chars": 814,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/connection_status.hpp",
    "chars": 497,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/control.hpp",
    "chars": 1782,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/control_ack.hpp",
    "chars": 1658,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/create_order.hpp",
    "chars": 4237,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/custom_matrix.hpp",
    "chars": 2093,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/custom_matrix_update.hpp",
    "chars": 2505,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/custom_metrics.hpp",
    "chars": 1741,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/custom_metrics_update.hpp",
    "chars": 2090,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/data_source.hpp",
    "chars": 298,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/decimal.hpp",
    "chars": 1623,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include <fmt/format.h>\n\n#include \"roq/limits.hpp\"\n#inclu"
  },
  {
    "path": "include/roq/disconnected.hpp",
    "chars": 1054,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/download_begin.hpp",
    "chars": 1019,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/download_end.hpp",
    "chars": 1155,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/encoding.hpp",
    "chars": 1152,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/error.hpp",
    "chars": 2893,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/event.hpp",
    "chars": 2286,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include <fmt/format.h>\n\n#include <type_traits>\n#include "
  },
  {
    "path": "include/roq/exceptions.hpp",
    "chars": 14058,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include \"roq/compat.hpp\"\n\n#include <fmt/format.h>\n\n#incl"
  },
  {
    "path": "include/roq/execution_instruction.hpp",
    "chars": 1632,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/external_latency.hpp",
    "chars": 1314,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/fill.hpp",
    "chars": 2294,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/filter.hpp",
    "chars": 1283,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/format_str.hpp",
    "chars": 2304,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include <fmt/format.h>\n\n#include <array>\n#include <sourc"
  },
  {
    "path": "include/roq/funds_update.hpp",
    "chars": 2814,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/gateway_settings.hpp",
    "chars": 3165,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/gateway_status.hpp",
    "chars": 1567,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/interval.hpp",
    "chars": 526,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/layer.hpp",
    "chars": 1182,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/leg.hpp",
    "chars": 1196,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/legs_update.hpp",
    "chars": 1412,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/limits.hpp",
    "chars": 187,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include <limits>\n\nnamespace roq {\nconstexpr auto const N"
  },
  {
    "path": "include/roq/liquidity.hpp",
    "chars": 299,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/map.hpp",
    "chars": 1439,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include <optional>\n#include <tuple>\n\nnamespace roq {\n\nna"
  },
  {
    "path": "include/roq/margin_mode.hpp",
    "chars": 338,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/market_by_order_update.hpp",
    "chars": 2904,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/market_by_price_update.hpp",
    "chars": 3025,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/market_status.hpp",
    "chars": 1991,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/mask.hpp",
    "chars": 5159,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include <fmt/format.h>\n#include <fmt/ranges.h>\n\n#include"
  },
  {
    "path": "include/roq/mass_quote.hpp",
    "chars": 1854,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/mass_quote_ack.hpp",
    "chars": 2081,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/mbo_update.hpp",
    "chars": 1670,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/mbp_update.hpp",
    "chars": 1600,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/measurement.hpp",
    "chars": 890,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/message_info.hpp",
    "chars": 2661,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/modify_order.hpp",
    "chars": 2262,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/name.hpp",
    "chars": 186,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include <string_view>\n\nnamespace roq {\n\ntemplate <typena"
  },
  {
    "path": "include/roq/option_type.hpp",
    "chars": 293,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/order_ack.hpp",
    "chars": 5364,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/order_cancel_policy.hpp",
    "chars": 403,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/order_management.hpp",
    "chars": 340,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/order_status.hpp",
    "chars": 858,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/order_type.hpp",
    "chars": 311,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/order_update.hpp",
    "chars": 7766,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/origin.hpp",
    "chars": 355,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/parameter.hpp",
    "chars": 1279,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/parameters_update.hpp",
    "chars": 1433,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/portfolio.hpp",
    "chars": 2121,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/portfolio_update.hpp",
    "chars": 1881,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/position.hpp",
    "chars": 1280,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/position_effect.hpp",
    "chars": 328,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/position_update.hpp",
    "chars": 2754,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/precision.hpp",
    "chars": 371,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/precision_2.hpp",
    "chars": 840,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include \"roq/compat.hpp\"\n\n#include <fmt/format.h>\n\n#incl"
  },
  {
    "path": "include/roq/priority.hpp",
    "chars": 306,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/protocol.hpp",
    "chars": 400,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/quality_of_service.hpp",
    "chars": 325,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/quantity_type.hpp",
    "chars": 320,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/quote.hpp",
    "chars": 2100,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/rate_limit.hpp",
    "chars": 1253,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/rate_limit_trigger.hpp",
    "chars": 2499,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/rate_limit_type.hpp",
    "chars": 445,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/rate_limits_update.hpp",
    "chars": 1503,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/ready.hpp",
    "chars": 817,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/reference_data.hpp",
    "chars": 5673,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/remove_routes.hpp",
    "chars": 1061,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/request_id_type.hpp",
    "chars": 446,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/request_status.hpp",
    "chars": 654,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/request_type.hpp",
    "chars": 363,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/risk_limit.hpp",
    "chars": 1967,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/risk_limits.hpp",
    "chars": 1755,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/risk_limits_update.hpp",
    "chars": 1674,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/route.hpp",
    "chars": 914,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/route_ack.hpp",
    "chars": 1215,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/route_request_status.hpp",
    "chars": 336,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/routing.hpp",
    "chars": 1231,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/security_type.hpp",
    "chars": 427,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/service_update.hpp",
    "chars": 1622,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/side.hpp",
    "chars": 294,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/start.hpp",
    "chars": 795,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/state.hpp",
    "chars": 304,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/statistics.hpp",
    "chars": 1248,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/statistics_type.hpp",
    "chars": 1053,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/statistics_update.hpp",
    "chars": 2223,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/stop.hpp",
    "chars": 789,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/strategy_update.hpp",
    "chars": 1496,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/stream_status.hpp",
    "chars": 2774,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/string.hpp",
    "chars": 4315,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include \"roq/compat.hpp\"\n\n#include <fmt/format.h>\n\n#incl"
  },
  {
    "path": "include/roq/string_types.hpp",
    "chars": 13801,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include <fmt/format.h>\n\n#include \"roq/string.hpp\"\n\nnames"
  },
  {
    "path": "include/roq/subscribe.hpp",
    "chars": 1177,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/support_type.hpp",
    "chars": 2594,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/tick_size_step.hpp",
    "chars": 944,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/time_in_force.hpp",
    "chars": 885,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/time_series_update.hpp",
    "chars": 2328,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/timer.hpp",
    "chars": 992,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/top_of_book.hpp",
    "chars": 2514,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/trace.hpp",
    "chars": 1782,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include <fmt/format.h>\n\n#include <type_traits>\n#include "
  },
  {
    "path": "include/roq/trace_info.hpp",
    "chars": 2022,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include \"roq/compat.hpp\"\n\n#include <fmt/chrono.h>\n#inclu"
  },
  {
    "path": "include/roq/trade.hpp",
    "chars": 1512,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/trade_summary.hpp",
    "chars": 2439,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/trade_update.hpp",
    "chars": 4251,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/trading_status.hpp",
    "chars": 1246,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/transport.hpp",
    "chars": 302,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/update_action.hpp",
    "chars": 374,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/update_reason.hpp",
    "chars": 365,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/update_type.hpp",
    "chars": 381,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/uuid.hpp",
    "chars": 3115,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include <fmt/format.h>\n\n#include <bit>\n\nnamespace roq {\n"
  },
  {
    "path": "include/roq/variant_type.hpp",
    "chars": 804,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n/* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */\n\n#pragma once\n\n#include"
  },
  {
    "path": "include/roq/version.hpp",
    "chars": 647,
    "preview": "/* Copyright (c) 2017-2026, Hans Erik Thrane */\n\n#pragma once\n\n#include <cstdint>\n\n#include <fmt/format.h>\n\nnamespace ro"
  },
  {
    "path": "schema/roq/CMakeLists.txt",
    "chars": 2517,
    "preview": "set(TARGET_NAME ${PROJECT_NAME}-schema-roq)\n\n# XXX FIXME share with other subdirectories\nset(SCHEMA_ROQ\n    action.json\n"
  },
  {
    "path": "schema/roq/action.json",
    "chars": 27,
    "preview": "{\n  \"link\": \"roq/Action\"\n}\n"
  },
  {
    "path": "schema/roq/add_market.json",
    "chars": 30,
    "preview": "{\n  \"link\": \"roq/AddMarket\"\n}\n"
  },
  {
    "path": "schema/roq/add_routes.json",
    "chars": 30,
    "preview": "{\n  \"link\": \"roq/AddRoutes\"\n}\n"
  },
  {
    "path": "schema/roq/bar.json",
    "chars": 24,
    "preview": "{\n  \"link\": \"roq/Bar\"\n}\n"
  },
  {
    "path": "schema/roq/batch_begin.json",
    "chars": 31,
    "preview": "{\n  \"link\": \"roq/BatchBegin\"\n}\n"
  },
  {
    "path": "schema/roq/batch_end.json",
    "chars": 29,
    "preview": "{\n  \"link\": \"roq/BatchEnd\"\n}\n"
  },
  {
    "path": "schema/roq/buffer_capacity.json",
    "chars": 35,
    "preview": "{\n  \"link\": \"roq/BufferCapacity\"\n}\n"
  },
  {
    "path": "schema/roq/cancel_all_orders.json",
    "chars": 36,
    "preview": "{\n  \"link\": \"roq/CancelAllOrders\"\n}\n"
  },
  {
    "path": "schema/roq/cancel_all_orders_ack.json",
    "chars": 39,
    "preview": "{\n  \"link\": \"roq/CancelAllOrdersAck\"\n}\n"
  },
  {
    "path": "schema/roq/cancel_order.json",
    "chars": 32,
    "preview": "{\n  \"link\": \"roq/CancelOrder\"\n}\n"
  },
  {
    "path": "schema/roq/cancel_quotes.json",
    "chars": 33,
    "preview": "{\n  \"link\": \"roq/CancelQuotes\"\n}\n"
  },
  {
    "path": "schema/roq/cancel_quotes_ack.json",
    "chars": 36,
    "preview": "{\n  \"link\": \"roq/CancelQuotesAck\"\n}\n"
  },
  {
    "path": "schema/roq/category.json",
    "chars": 29,
    "preview": "{\n  \"link\": \"roq/Category\"\n}\n"
  },
  {
    "path": "schema/roq/connected.json",
    "chars": 30,
    "preview": "{\n  \"link\": \"roq/Connected\"\n}\n"
  },
  {
    "path": "schema/roq/connection_status.json",
    "chars": 37,
    "preview": "{\n  \"link\": \"roq/ConnectionStatus\"\n}\n"
  },
  {
    "path": "schema/roq/control.json",
    "chars": 28,
    "preview": "{\n  \"link\": \"roq/Control\"\n}\n"
  },
  {
    "path": "schema/roq/control_ack.json",
    "chars": 31,
    "preview": "{\n  \"link\": \"roq/ControlAck\"\n}\n"
  },
  {
    "path": "schema/roq/create_order.json",
    "chars": 32,
    "preview": "{\n  \"link\": \"roq/CreateOrder\"\n}\n"
  },
  {
    "path": "schema/roq/custom_matrix.json",
    "chars": 33,
    "preview": "{\n  \"link\": \"roq/CustomMatrix\"\n}\n"
  },
  {
    "path": "schema/roq/custom_matrix_update.json",
    "chars": 39,
    "preview": "{\n  \"link\": \"roq/CustomMatrixUpdate\"\n}\n"
  },
  {
    "path": "schema/roq/custom_metrics.json",
    "chars": 34,
    "preview": "{\n  \"link\": \"roq/CustomMetrics\"\n}\n"
  },
  {
    "path": "schema/roq/custom_metrics_update.json",
    "chars": 40,
    "preview": "{\n  \"link\": \"roq/CustomMetricsUpdate\"\n}\n"
  },
  {
    "path": "schema/roq/data_source.json",
    "chars": 31,
    "preview": "{\n  \"link\": \"roq/DataSource\"\n}\n"
  },
  {
    "path": "schema/roq/disconnected.json",
    "chars": 33,
    "preview": "{\n  \"link\": \"roq/Disconnected\"\n}\n"
  },
  {
    "path": "schema/roq/download_begin.json",
    "chars": 34,
    "preview": "{\n  \"link\": \"roq/DownloadBegin\"\n}\n"
  },
  {
    "path": "schema/roq/download_end.json",
    "chars": 32,
    "preview": "{\n  \"link\": \"roq/DownloadEnd\"\n}\n"
  },
  {
    "path": "schema/roq/encoding.json",
    "chars": 29,
    "preview": "{\n  \"link\": \"roq/Encoding\"\n}\n"
  },
  {
    "path": "schema/roq/error.json",
    "chars": 26,
    "preview": "{\n  \"link\": \"roq/Error\"\n}\n"
  },
  {
    "path": "schema/roq/execution_instruction.json",
    "chars": 41,
    "preview": "{\n  \"link\": \"roq/ExecutionInstruction\"\n}\n"
  },
  {
    "path": "schema/roq/external_latency.json",
    "chars": 36,
    "preview": "{\n  \"link\": \"roq/ExternalLatency\"\n}\n"
  },
  {
    "path": "schema/roq/fill.json",
    "chars": 25,
    "preview": "{\n  \"link\": \"roq/Fill\"\n}\n"
  },
  {
    "path": "schema/roq/filter.json",
    "chars": 27,
    "preview": "{\n  \"link\": \"roq/Filter\"\n}\n"
  },
  {
    "path": "schema/roq/funds_update.json",
    "chars": 32,
    "preview": "{\n  \"link\": \"roq/FundsUpdate\"\n}\n"
  },
  {
    "path": "schema/roq/gateway_settings.json",
    "chars": 36,
    "preview": "{\n  \"link\": \"roq/GatewaySettings\"\n}\n"
  },
  {
    "path": "schema/roq/gateway_status.json",
    "chars": 34,
    "preview": "{\n  \"link\": \"roq/GatewayStatus\"\n}\n"
  },
  {
    "path": "schema/roq/interval.json",
    "chars": 29,
    "preview": "{\n  \"link\": \"roq/Interval\"\n}\n"
  },
  {
    "path": "schema/roq/layer.json",
    "chars": 26,
    "preview": "{\n  \"link\": \"roq/Layer\"\n}\n"
  },
  {
    "path": "schema/roq/leg.json",
    "chars": 24,
    "preview": "{\n  \"link\": \"roq/Leg\"\n}\n"
  },
  {
    "path": "schema/roq/legs_update.json",
    "chars": 31,
    "preview": "{\n  \"link\": \"roq/LegsUpdate\"\n}\n"
  },
  {
    "path": "schema/roq/liquidity.json",
    "chars": 30,
    "preview": "{\n  \"link\": \"roq/Liquidity\"\n}\n"
  },
  {
    "path": "schema/roq/margin_mode.json",
    "chars": 31,
    "preview": "{\n  \"link\": \"roq/MarginMode\"\n}\n"
  },
  {
    "path": "schema/roq/market_by_order_update.json",
    "chars": 40,
    "preview": "{\n  \"link\": \"roq/MarketByOrderUpdate\"\n}\n"
  },
  {
    "path": "schema/roq/market_by_price_update.json",
    "chars": 40,
    "preview": "{\n  \"link\": \"roq/MarketByPriceUpdate\"\n}\n"
  },
  {
    "path": "schema/roq/market_status.json",
    "chars": 33,
    "preview": "{\n  \"link\": \"roq/MarketStatus\"\n}\n"
  },
  {
    "path": "schema/roq/mass_quote.json",
    "chars": 30,
    "preview": "{\n  \"link\": \"roq/MassQuote\"\n}\n"
  },
  {
    "path": "schema/roq/mass_quote_ack.json",
    "chars": 33,
    "preview": "{\n  \"link\": \"roq/MassQuoteAck\"\n}\n"
  }
]

// ... and 84 more files (download for full content)

About this extraction

This page contains the full source code of the roq-trading/roq-api GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 284 files (299.9 KB), approximately 83.0k tokens, and a symbol index with 808 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!