Institutional FIX API (4.2 / 4.4 / 5.0 / 5.2)
Institutional FIX 4.2, 4.4, 5.0, and 5.2 connectivity: Order Entry (:9878), Real-Time Drop Copy (797=Y / 9406=Y), Market Data (:9879), and QuickFIX XML schema.
SKILL.mdDrop-in Claude Code skill with HMAC-SHA256 signing, /fapi/v1 & /fapi/v2 schemas, and secret-redaction guardrails.
AGENTS.mdDrop-in repository AGENTS.md for OpenAI Codex CLI — tick-size rules, rate-limit budgets, and self-custody boundaries.
AGY.mdGoogle Antigravity (agy) & Gemini agent spec with verified async Python WebSocket + REST execution templates.
llms.txtSingle-URL machine-readable index of all GaiaEx documentation pages, OpenAPI 3.0 schema, and Postman collection.
1. Architecture & Multi-Version Overview
The GaiaEx Native C++26 Institutional FIX Gateway provides deterministic, ultra-low-latency Order Entry, Real-Time Drop Copy, Position & Order Inquiry, and L1/L2 Market Data streaming over persistent TCP/TLS sessions.
Download QuickFIX / OnixS XML Schema: /fix-dictionary.xml — compatible with QuickFIX (C++/Python/Go), QuickFIX/J, OnixS, OneZero, and institutional OMS platforms. Configure your client engine with ValidateUserDefinedFields=N and ValidateFieldsOutOfOrder=N for forward compatibility.
| Gateway Session Type | Port | Supported Versions | Capabilities | Access Policy |
|---|---|---|---|---|
| Order Management (OE) | 9878 | FIX.4.2, FIX.4.4, FIX.5.0, FIX.5.2 | Order entry (35=D), Cancel (35=F), Amend (35=G), Mass Cancel (35=q), Order Status (35=H), Positions (35=AN), Rate Limits (35=XLQ), Instruments (35=x) | Read + Trade API Key |
| Drop Copy (DC) | 9878 | FIX.4.2, FIX.4.4, FIX.5.0, FIX.5.2 | Real-time consolidated ExecutionReport (35=8) stream tagged with 797=Y and 9406=Y across all FIX and REST/HTTP orders | Read-Only Enforced (35=j rejects orders) |
| Market Data (MD) | 9879 | FIX.4.2, FIX.4.4, FIX.5.0, FIX.5.2 | Real-time L1/L2 Snapshot (35=W), IncrementalRefresh (35=X), and MarketDataRequestReject (35=Y) | Read-Only Enforced (35=j rejects orders) |
Version Negotiation & Wire Rules
| FIX Version | BeginString (8) | Logon Tag (35=A) | App Header Tag | Trade ExecType (150) | ExecTransType (20) Rule |
|---|---|---|---|---|---|
| FIX 4.2 | 8=FIX.4.2 | None | None | 150=1 (Partial), 150=2 (Fill) | Mandatory (20=0 New, 20=3 Status) |
| FIX 4.4 | 8=FIX.4.4 | None | None | 150=F (Trade) w/ 39=1/2 | Forbidden (rejected via 35=3, 371=20, 373=2) |
| FIX 5.0 | 8=FIXT.1.1 | 1137=7 | 1128=7 | 150=F (Trade) w/ 39=1/2 | Forbidden (rejected via 35=3, 371=20, 373=2) |
| FIX 5.2 (5.0 SP2) | 8=FIXT.1.1 | 1137=9 | 1128=9 | 150=F (Trade) w/ 39=1/2 | Forbidden (rejected via 35=3, 371=20, 373=2) |
2. Session Management & HMAC-SHA256 Logon (35=A)
Every FIX session begins with a Logon (35=A) frame authenticated via your GaiaEx API Key (Tag 553), API Secret (Tag 554), and a lowercase hex HMAC-SHA256 signature in RawData (Tag 96).
import hmac, hashlib
def sign_fix_logon(api_secret: str, sending_time: str, seq_num: int, sender_comp_id: str, target_comp_id: str) -> str:
# Canonical prehash string: SendingTime(52) | MsgType(35) | MsgSeqNum(34) | SenderCompID(49) | TargetCompID(56)
payload = f"{sending_time}|A|{seq_num}|{sender_comp_id}|{target_comp_id}"
return hmac.new(api_secret.encode("utf-8"), payload.encode("utf-8"), hashlib.sha256).hexdigest()| Tag | Field Name | Req | Description |
|---|---|---|---|
98 | EncryptMethod | Y | 0 = None / TLS transport encryption |
108 | HeartBtInt | Y | Heartbeat interval in seconds (recommended: 30) |
141 | ResetSeqNumFlag | N | Y = Reset sequence numbers to 1; N = Resume intraday sequence state |
553 | Username | Y | GaiaEx API Key |
554 | Password | Y | GaiaEx API Secret |
96 | RawData | Y | 64-char hex HMAC-SHA256 signature over 52|A|34|49|56 |
797 / 9406 | CopyMsgIndicator / DropCopyFlag | N | Set 797=Y, 9406=Y, or 50=DROPCOPY to register a read-only Drop Copy session |
1409 | SessionStatus | Out | Returned in 35=A / 35=5: 0=Active, 4=Logout Complete, 5=Bad Auth, 6=Seq Too Low, 101=100M Seq Cap |
Gap Recovery (35=2 & 35=4) & Cancel-on-Disconnect (CoD)
- Inbound Gap Detection: If an incoming message carries
MsgSeqNum (34) > ExpectedSeqNum, the gateway immediately emitsResendRequest (35=2, 7=ExpectedSeqNum, 16=0). IfMsgSeqNum (34) < ExpectedSeqNumwithoutPossDupFlag (43=Y), the gateway emitsLogout (35=5, 1409=6)and closes the socket. - Outbound Replay: When the client sends
ResendRequest (35=2), the gateway replays all application messages (including Drop Copy35=8reports) with43=Yand122=OrigSendingTime, and coalesces administrative frames intoSequenceReset-GapFill (35=4, 123=Y). - Automatic Cancel-on-Disconnect (CoD): When an Order Management session disconnects, all open resting orders (
OrdStatus 39=0) placed on that session are automatically cancelled (150=4, 39=4, 103=3020) and broadcasted in real time to any active Drop Copy session.
3. Order Entry, Modification, Cancellation & Inquiry (35=D, G, F, q, H, AN, XLQ)
NewOrderSingle (35=D)
| Tag | Field Name | Req | Supported Values & Notes |
|---|---|---|---|
11 | ClOrdID | Y | Client-assigned unique order identifier (up to 31 chars) |
1 | Account | N | Self-custody vault address (0x...) or sub-account identifier |
50 | SenderSubID | N | Trader or strategy ID; echoed back in TargetSubID (57) on 35=8 |
55 | Symbol | Y | USDC Perps (BTCUSDC, ETHUSDC, SOLUSDC), USDT Perps (BTCUSDT, ETHUSDT), RWA Perps (xyz:GOLD / GOLDUSDC, xyz:NVDA, xyz:TSLA) |
54 | Side | Y | 1 = Buy, 2 = Sell |
38 | OrderQty | Y | Order quantity in base asset (supports 4-decimal fractional precision, e.g. 0.0050) |
40 | OrdType | Y | 1 = Market, 2 = Limit, 4 = Stop Limit (requires 99=StopPx), p = Post-Only (or 18=6) |
44 | Price | C | Limit price (required for 40=2, 40=4, 40=p) |
59 | TimeInForce | N | 1 = GTC (default), 3 = IOC, 4 = FOK, 5 = GTX |
544 | CashMargin | N | 1 = Cash (default), 2 = Margin Open, 3 = Margin Close |
Amend (35=G), Cancel (35=F), Mass Cancel (35=q), Status (35=H), Positions (35=AN) & Limits (35=XLQ)
| MsgType | Message Name | Key Request Tags | Gateway Response |
|---|---|---|---|
35=G | OrderCancelReplaceRequest | 11=ClOrdID, 41=OrigClOrdID, 55=Symbol, 54=Side, 38=OrderQty, 44=Price | 35=8 with 150=5, 39=5 (Replaced) or 35=9 (434=2) |
35=F | OrderCancelRequest | 11=ClOrdID, 41=OrigClOrdID, 55=Symbol, 54=Side | Two-step 35=8: 150=6, 39=6 (Pending Cancel) → 150=4, 39=4 (Canceled), or 35=9 (434=1) |
35=q | OrderMassCancelRequest | 11=ClOrdID, 530=7 (Cancel all orders) | 35=r (1369=MassActionReportID, 531=7) + one 35=8 (150=4, 39=4) per cancelled order |
35=H | OrderStatusRequest | 11=ClOrdID (or 37=OrderID), 790=OrdStatusReqID | 35=8 with 150=I (Order Status) or 150=8, 103=5 (Unknown order) |
35=AN | RequestForPositions | 710=PosReqID, 724=0 (Positions), 1=Account, 55=Symbol | PositionReport (35=AP) with 721=PosMaintRptID, 728=0, 704=LongQty, 705=ShortQty, 730=SettlePrice |
35=XLQ | LimitQuery | 25003=ReqID | LimitResponse (35=XLR) with 25005=ORDERS (500/s) and 25005=CONNECTIONS (20/account) |
4. Real-Time Drop Copy & Reconciliation (797=Y / 9406=Y)
Drop Copy provides prime brokers, risk engines, and back-office reconciliation systems with a real-time, read-only stream of all ExecutionReport (35=8) events across both FIX Order Entry sessions and REST/HTTP API orders.
- Universal Subscription Flags: Connect to port
9878and sendLogon (35=A)with797=Y(CopyMsgIndicator),9406=Y(DropCopyFlag), or50=DROPCOPY(SenderSubID). - Dual-Tag Outbound Stamping: Every Drop Copy
35=8frame carries57=DROPCOPY,797=Y, and9406=Y, plus full fee/rebate breakdown (381=GrossTradeAmt,1057=AggressorIndicator,136=1|137=MiscFeeAmt|138=MiscFeeCurr|139=4,20000=TradeFeeRebateAmt). - Strict Read-Only Protection: Any attempt to submit
35=D,35=F,35=G, or35=qon a Drop Copy session is immediately rejected viaBusinessMessageReject (35=j, 380=4). - Sequence Gap Recovery: Outbound Drop Copy reports are persisted in the session sequence store and can be replayed via
ResendRequest (35=2)withPossDupFlag (43=Y).
5. Market Data (35=V, W, X, Y) & Reference Data (35=x, y, h)
Connect to port 9879 for dedicated Market Data streaming or query instrument specifications via SecurityListRequest (35=x).
- MarketDataRequest (
35=V): Send262=MDReqID,263=1(Snapshot + Updates) or0(Snapshot),264=1(Top of Book) or20(Full Depth), and55=Symbol. ReturnsMarketDataSnapshotFullRefresh (35=W)followed byMarketDataIncrementalRefresh (35=X). Unknown symbols returnMarketDataRequestReject (35=Y, 281=0). - SecurityListRequest (
35=x): Send320=SecurityReqIDand559=0(single symbol in55) or559=4(all instruments). ReturnsSecurityList (35=y)with tick size (969=MinPriceIncrement), min/max order quantity (8000/8001), and decimal precision (8002/8003). - TradingSessionStatus (
35=h): Returns340=2(Open 24x7x365) or340=1(Halted).
QuickFIX Client Configuration Template (gaiaex_fix.cfg)
[DEFAULT]
ConnectionType=initiator
ReconnectInterval=5
FileStorePath=./store
FileLogPath=./log
StartTime=00:00:00
EndTime=00:00:00
UseDataDictionary=Y
DataDictionary=./fix-dictionary.xml
ValidateUserDefinedFields=N
ValidateFieldsOutOfOrder=N
HeartBtInt=30
[SESSION]
BeginString=FIX.4.4
SenderCompID=INST_CLIENT_OE
TargetCompID=GAIAEX_PROD
SocketConnectHost=10.10.0.51
SocketConnectPort=9878
ResetOnLogon=N
[SESSION]
BeginString=FIX.4.4
SenderCompID=INST_CLIENT_DC
TargetCompID=GAIAEX_PROD
SenderSubID=DROPCOPY
SocketConnectHost=10.10.0.51
SocketConnectPort=9878
ResetOnLogon=N