Introduction#
OUCH 5.0 Client Library is a production-ready C++ client library for the Nasdaq OUCH 5.0 protocol, built on top of SoupBinTCP for reliable message transport.
What is OUCH 5.0?#
OUCH (Order Entry Protocol) is a low-level, high-performance order entry protocol for sending, replacing, canceling, and receiving updates on orders. It is designed for proprietary trading systems requiring maximal throughput and minimal latency.
OUCH 5.0 is the latest version of the protocol, featuring:
TagValue Appendages: Variable-length messages with optional fields
UserRefNum: Strictly increasing 4-byte reference numbers
Price Format: UInt64 on wire (8 bytes), 4 implied decimals
Timestamps: Nanoseconds since midnight
Overview#
This library provides a complete implementation of the OUCH 5.0 protocol specification, including:
Session Management: Connection handling, login/logout, state management
Message Types: All OUCH 5.0 egress (Client → Exchange) and ingress (Exchange → Client) message types
TagValue Support: Variable-length message appendages with optional fields
UserRefNum Management: Strictly increasing reference number generation with persistence
Message Buffering: Optional egress message buffering for retransmission
Timestamp Handling: Type-safe OUCH 5.0 timestamp utilities (nanoseconds since midnight)
Price Type: Type-safe price handling with 4 implied decimals
Error Handling: Comprehensive error handling and recovery
Architecture#
Components#
Session (
Session.h): Main session class for OUCH 5.0 communicationMessages (
Messages.h): All OUCH 5.0 message type definitionsTagValue (
TagValue.h): TagValue appendage infrastructure for variable-length messagesUserRefNumGenerator (
UserRefNumGenerator.h): Strictly increasing reference number managementOutboundMessageBuffer (
OutboundMessageBuffer.h): Optional message buffering for retransmissionTimestampUtil (
TimestampUtil.h): OUCH 5.0 timestamp utilities (nanoseconds since midnight)Price (
Types.h): Type-safe price handling with 4 implied decimalsMessageView (
MessageView.h): Lightweight message wrapper for manual parsing
Namespace#
All OUCH 5.0 code is in the b2bits::nasdaq::ouch5 namespace.
Next Steps#
Installation Guide - Learn how to build and install the library
Quick Start - Get up and running in minutes
API Reference - Explore the complete API documentation