FIX API 101: Best Practices for Connecting to Liquidity Providers

If you’re wiring your trading stack to a bank or Prime of Prime (PoP) via FIX, success boils down to: clear commercial & technical scope, clean network and security, tight session/sequence discipline, precise mapping and risk controls, as well as robust monitoring and a tested failover plan. This playbook shows how to go live fast and stay live.

What FIX is? when to use it?

FIX (Financial Information eXchange) is a text‑based, low‑latency protocol widely used for order routing, execution, and market data. Connecting to a Liquidity Provider (LP) via FIX gives you:

  • Direct, deterministic order flow (vs. REST/WS gateways)
  • Rich execution states (partial fills, rejects, cancels)
  • Mature risk and session primitives (heartbeats, resends)

Good fit: high‑frequency order flow, precise control, multi LP aggregation, exchange/ECN connectivity. Less ideal: one off, low touch flows better served by managed bridges.

Pre‑integration checklist (commercial + technical)

Before you touch a socket, align the following: Commercial / operational

  • Trading scope: symbols, venues, session windows, supported order types (Market/Limit/Stop/Stop‑Limit/IOC/FOK/GTD/GTC).
  • Economic terms: spreads/commissions, minimum ticket, rollover, swap rules, reject policy, COD (Cancel On Disconnect).
  • SLA & contacts: NOC hours, escalation ladder, change window policy, weekend resets.

Technical

  • FIX versions: Trade (usually FIX 4.2/4.4) vs Market Data sessions (often separate). Confirm data dictionaries.
  • Environment plan: UAT vs PROD endpoints, static IPs for whitelisting, TCP ports, TLS/mTLS requirements, certificates.
  • Message model: Execution Reports vs Drop Copy (ExecRpt/TradeCaptureReport), fills aggregation policy, multi account handling.
  • Identifiers: SenderCompID(49), TargetCompID(56), OnBehalfOfCompID(115) if routing, account tags (1/448/452/802 etc.).
  • Precision: price/size decimals, min tick, notional limits, symbol format (e.g., EUR/USD vs EURUSD).

Network & security hardening

  • Transport: Prefer TLS 1.2+; if mTLS, exchange certs early; document renewal cadence.
  • IP hygiene: Static egress IPs, strict LP ACLs both ways; avoid NAT churn.
  • Clock sync: NTP (or PTP if co‑lo). Keep delta < 100 ms; FIX uses SendingTime(52).
  • Throughput: Pre‑size bandwidth; set TCP buffers; enable TCP_NODELAY for latency‑sensitive legs.
  • Secrets: Store certs/credentials in a vault, not in repos. Rotate on staff changes.

Session & sequence discipline (the #1 go‑live blocker)

Core Admin MsgTypes: Logon(A), Logout(5), Heartbeat(0), TestRequest(1), ResendRequest(2), Reject(3), SequenceReset(4).

Golden rules

  • Persist incoming/outgoing MsgSeqNum(34) across restarts. Do not reset casually.
  • Answer TestRequest(1) with Heartbeat(0) echoing TestReqID(112) within your heartbeat interval.
  • On gaps, send ResendRequest(2) with precise ranges; honor LP resends; fill missing messages.
  • Prefer SequenceReset(4) GapFillFlag=Y for administrative gap‑fills (don’t alter state).
  • Use PossDupFlag(43)=Y with OrigSendingTime(122) on resends; de‑duplicate idempotently.
  • Align daily reset policy (some LPs reset at 00:00 UTC; others maintain running sequences).

Timeouts (typical)

  • HeartBtInt = 30s; consider 15s for HFT.
  • Disconnect if missed heartbeats; backoff reconnect (e.g., 5s→10s→30s, max 60s).

Order flow you must get right

Primary messages

  • NewOrderSingle (D)
  • OrderCancelRequest (F)
  • OrderCancelReplaceRequest (G)
  • ExecutionReport (8) — your source of truth
  • OrderCancelReject (9)
  • OrderMassCancelRequest (q) / OrderMassCancelReport (r) (if supported)

Best practices

  • Provide stable ClOrdID(11) (unique per day); mirrors in replacements/cancels via OrigClOrdID(41).
  • Treat ExecType(150) + OrdStatus(39) as the canonical state machine; don’t infer from side effects.
  • Keep time‑in‑force consistent (59): Day, IOC, FOK, GTC, GTD (ExpirationTime(126)).
  • Validate price bands, min/max qty, and notional checks before hitting the wire to reduce rejects.
  • Respect LP‑specific tags (e.g., Account(1), ClientID(109), HandlInst(21), TradeLiquidityIndicator(9730) variants).

Market data without surprises

Messages: MarketDataRequest (V)SnapshotFullRefresh (W) and/or IncrementalRefresh (X); rejections via (Y).

Tips

  • Request only what you use (L1 vs L2 depth) to avoid throttling.
  • Honor MDReqID(262) echo; track book integrity via MDEntryID(278)/MDUpdateAction(279).
  • Recover after disconnect: resubscribe cleanly; don’t stitch stale books.
  • Understand policies: RFS vs streaming, refresh rates, throttles, symbol filters, trade vs quote channels.

Risk, throttles, and kill‑switches

  • Pre‑trade: price banding, fat‑finger checks, max order qty/notional, per‑symbol and per‑account limits.
  • Rate limits: client‑side throttling (orders/sec, cancels/sec); exponential backoff on 2xx administrative rejects.
  • COD: if supported, enable Cancel On Disconnect; otherwise build a mass cancel on reconnect playbook.
  • Kill switch: operator triggered mass cancel + session logout with auditable reason.

Observability & compliance (build it in day one)

  • Structured logging: persist raw FIX (redact PII if needed) + parsed events. Rotate daily with retention.
  • Metrics: session up time, resend volume, round‑trip latency (client send→ExecRpt receive), reject rates by reason.
  • Tracing: stamp a ClOrdID to trade lifecycle ID; expose in dashboards.
  • Clock compliance: keep audit trail in UTC; record TransactTime(60) and gateway timestamps if provided.
  • Record‑keeping: match your regime (e.g., 5–7 years). Include drop‑copy feeds if used.

Failover & disaster recovery

  • Primary/Secondary sessions to the same LP (or multi LP aggregation). Ensure independent SenderCompID/stores.
  • Hot‑standby engines with shared persistent stores prevent seq regressions.
  • Network HA: dual ISPs/cross connects; redundant firewalls; health checked VIPs.
  • DR runbooks: simulate site failover quarterly; validate gap fill logic after flips.

Conformance & negative testing plan

Must‑pass cases

  1. Happy‑path market/limit order → partial fill → replace → cancel.
  2. Throttling: burst 50 orders; observe admin rejects and backoff.
  3. Sequence gap: force missing 34; assert clean resend.
  4. Heartbeat/TestRequest handling during traffic spikes.
  5. Market data resubscribe after mid‑fill disconnect.
  6. COD: drop link mid‑book → orders canceled (or your mass‑cancel executes).

Document each with input, expected ExecRpt(s), and final state.

Common integration gotchas (and quick fixes)

  • Infinite resend loops: Your store rewound or LP reset unexpectedly → stop, reconcile highest known 34, apply gap fill, then reconnect.
  • Daylight Savings surprises: Set Use UTC everywhere; do not bind sessions to local time.
  • Symbol mismatches: Normalize instruments at a single boundary; reject unknowns early with actionable logs.
  • Decimal/lot size drift: Store per‑symbol precision server‑side; validate before encode.
  • Silent timeouts: Missed TestRequest handling ensure heartbeat worker is independent of order pipeline.

Sample QuickFIX/J configs (Trade & Market Data)

# quickfixj-core (FIX 4.4) — defaults
[default]
BeginString=FIX.4.4
ConnectionType=initiator
HeartBtInt=30
ReconnectInterval=5
FileStorePath=./store
FileLogPath=./log
UseDataDictionary=Y
DataDictionary=FIX44.xml
CheckLatency=Y
MaxLatency=120
ValidateFieldsOutOfOrder=N
ValidateUserDefinedFields=N
SocketUseSSL=Y
SSLProtocol=TLSv1.2
# mTLS (optional)
# SSLCertificate=client.p12
# SSLPassphrase=********


# --- TRADE session ---
[session]
# Trading days/hours in UTC
StartTime=00:00:00
EndTime=23:59:59
UseLocalTime=N
TimeZone=UTC


SenderCompID=YOUR_TRADER
TargetCompID=LP_TRADE
SocketConnectHost=lp.trade.endpoint
SocketConnectPort=9901


ResetOnLogon=N
ResetOnDisconnect=N
# Consider NonStopSession=Y for 24/5 venues


# --- MARKET DATA session ---
[session]
StartTime=00:00:00
EndTime=23:59:59
UseLocalTime=N
TimeZone=UTC


SenderCompID=YOUR_MD
TargetCompID=LP_MD
SocketConnectHost=lp.md.endpoint
SocketConnectPort=9902


ResetOnLogon=N
ResetOnDisconnect=N

Tip: Keep separate stores per session; never share SenderCompID across Trade/MD.

Minimal FIX tag cheat‑sheet

  • Admin: 34 MsgSeqNum, 49/56 Sender/Target, 52 SendingTime, 112 TestReqID, 43/122 PossDup/OrigSendingTime.
  • Orders: 11 ClOrdID, 41 OrigClOrdID, 55 Symbol, 54 Side, 38 OrderQty, 44 Price, 59 TimeInForce, 21 HandlInst.
  • State: 150 ExecType, 39 OrdStatus, 17 ExecID, 37 OrderID, 32/31 LastQty/LastPx, 14 CumQty, 151 LeavesQty.
  • MD: 262 MDReqID, 268 NoMDEntries, 269 MDEntryType, 278 MDEntryID, 279 MDUpdateAction.

How EBS FinTech helps (fast, safe, production ready)

  • Connectivity & Aggregation: Multi LP FIX onboarding, symbol normalization, smart‑routing.
  • Bridging: MT4/MT5, cTrader, TradeView, xTrader connectors and risk‑books.
  • Hosting: Low latency VPS/co‑lo, DDoS‑hardened edges, 24×5 NOC with SRE on call.
  • Risk & Controls: Pre‑trade gates, throttles, COD/mass cancel playbooks, kill switches.
  • Observability: Central FIX log lake, dashboards (latency, rejects, resend heatmaps), alerting.
  • Conformance: LP test harnesses, negative testing, audit‑ready runbooks.

Get a 30‑minute technical review of your current FIX setup (gratis) and a prioritized punch list to de‑risk go‑live.

Contact: EBS FinTech · Brokerage Tech • Prop Trading • Crypto Infrastructure
[email protected] | ebsfintech.com

Scroll to Top