nexusfix
Use when building, reviewing, debugging, or optimizing NexusFIX-based C++ FIX protocol code. Covers session management, order entry, market data subscription, low-latency message parsing, and zero-allocation hot-path constraints. Also use when generating new FIX connectivity code that must follow C++23 best practices with std::expected error handling, fixed-point arithmetic, and SIMD-accelerated parsing.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/alan-stratcraftsai/nexusfixNexusFIX Development Expert
When to Use
When the user needs to build, optimize, or debug FIX protocol connectivity in C++. Covers session management, order entry, market data, and low-latency message parsing.
Architecture
NexusFIX is a header-only C++23 FIX protocol engine. Parse latency is under 250ns for ExecutionReport messages. Throughput exceeds 4M msg/sec single-threaded.
Key design decisions:
- Zero-copy parsing:
std::span<const char>views over raw buffer. No intermediate string copies. - Two-stage SIMD parsing: AVX2/AVX-512 scans for SOH delimiters first (structural index), then extracts fields by tag. Similar to how simdjson handles JSON.
- Builder pattern for outbound messages:
NewOrderSingle::Builderchains field setters, calls.build(assembler)to serialize. std::expectederror handling: All parse functions returnstd::expected<T, ParseError>. No exceptions on hot path.- Fixed-point arithmetic:
FixedPrice(8 decimal places) andQty(4 decimal places). No floating-point for prices. - PMR memory pools: Pre-allocated buffers, zero heap allocations during message processing.
Constraints (Strict)
When generating code that uses NexusFIX, the following rules are mandatory:
- C++23 only. Use designated initializers,
std::expected, concepts,constexpr/consteval. - Zero allocations on hot path. No
new,delete,std::map,std::unordered_map, orstd::stringconstruction in message processing loops. - No
std::endl. Use\n. - No
virtualfunctions in performance-critical code. - No
std::shared_ptron hot path. - No floating-point for prices. Use
FixedPrice::from_double()orFixedPrice::from_string(). - All functions that can fail return
std::expected. Check.has_value()before accessing. - Mark hot-path functions
noexcept. - Use
[[nodiscard]]on all API return values.
Common Patterns
Connecting and Sending an Order
#include <nexusfix/nexusfix.hpp>
using namespace nfx;
using namespace nfx::fix44;
TcpTransport transport;
transport.connect("fix.broker.com", 9876);
SessionConfig config{
.sender_comp_id = "MY_CLIENT",
.target_comp_id = "BROKER",
.heartbeat_interval = 30
};
SessionManager session{transport, config};
session.initiate_logon();
while (!session.is_active()) {
session.poll();
}
MessageAssembler asm_;
NewOrderSingle::Builder order;
auto msg = order
.cl_ord_id("ORD001")
.symbol("AAPL")
.side(Side::Buy)
.order_qty(Qty::from_int(100))
.ord_type(OrdType::Limit)
.price(FixedPrice::from_double(150.00))
.build(asm_);
transport.send(msg);
Parsing an ExecutionReport
void on_message(std::span<const char> data) {
auto result = ExecutionReport::from_buffer(data);
if (!result) return;
auto& exec = *result;
if (exec.is_fill()) {
// handle fill
}
}
Message Routing
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-alan-stratcraftsai-nexusfix": {
"enabled": true,
"auto_update": true
}
}
}