For the complete documentation index, see llms.txt. This page is also available as Markdown.

FIX Market Data

Use the FIX Market Data session to receive market data from the FIX API

For assistance or information regarding implementation of the FIX API, please contact support@sfox.com

sFOX uses FIX 4.4

Connectivity

Before logging onto a FIX session, you must establish a secure connection to the FIX gateway

Endpoints

Environment
URL
SSL Required

Production

fix-md.sfox.com:5001

Y

Sandbox

fix-md.staging.sfox.com:5001 Contact support to access the Sandbox environment

Y

TCP SSL

If your FIX implementation does not support establishing a native TCP SSL connection with SNI support, set up a local proxy such as stunnel to establish a secure connection to the FIX gateway. Refer to our QuickFIX Integration Guide for details and examples

Standard Header

SenderCompIDs must be provided by sFOX. Contact support@sfox.com to be provided with a SenderCompID for your session.

Tag
Field
Description

8

BeginString

Must be FIX.4.4

49

SenderCompID

Value provided by sFOX. Must be unique per session

56

TargetCompID

Must be SFOX

QuickFIX session configuration

Configure these values in your QuickFIX session settings. They are not transmitted FIX header fields.

Setting
Value

StartDay

Sunday

EndDay

Sunday

StartTime

00:00:05

EndTime

00:00:00

TimeZone

ETC or UTC

Messages

Logon - A

Only one session may exist per SenderCompID. Attempting to log on using an active SenderCompID results in an error.

Tag
Name
Required
Description

108

HeartBtInt

Y

Heartbeat interval. Must be <= 30 seconds.

554

Password

Y

Your API Key

Market Data Request – V

Subscribes the current session to Market Data

Tag
Name
Required
Description

262

MDReqID

Y

Market data request ID, included in all MarketDataSnapshotFullRefresh updates

263

SubscriptionRequestType

Y

1: Snapshot Plus Updates 2: Disable Previous Snapshot Plus Updates

20030

FeedType

N

Market data feed. Omit this field to use NPR books. delta: Delta. Recommended for new integrations. net: Net Price. smart: Smart. Notice: Net Price and Smart feeds may be deprecated in a future release.

264

MarketDepth

N

Requested order book depth per side. This field is ignored for the delta feed. Delta snapshots are capped by the ob-delta service configuration.

20050

LastPublished

N

Set to 1 to include last-published timestamps on order book responses (W and X). Not included on trade messages.

267

NoMDEntryTypes

N

Number of MDEntryTypes requested. If empty the default is to subscribe to the order book.

-> 269

MDEntryType

N

0: Bid 1: Offer 2: Trade Note: 0 and/or 1 will give both sides of the order book.

146

NoRelatedSym

Y

Number of symbols in this request

-> 55

Symbol

Y

Pair to subscribe to, basequote format.

Example (Delta Feed): 35=V|262=1|263=1|264=0|20030=delta|146=1|55=btcusd

In this example, | represents the ASCII SOH delimiter (0x01). Actual FIX messages use SOH. Standard engine-managed fields are omitted.

Optional: append |20050=1 to receive last-published timestamps on order book responses. To unsubscribe, send the same MDReqID with SubscriptionRequestType (263) = 2.

Message flow

  1. After a successful subscribe, you receive a Market Data Snapshot/Full Refresh (W). For delta, this contains the depth configured by the ob-delta service.

  2. Subsequent book changes arrive as Market Data Incremental Refresh (X) messages.

  3. A new W snapshot may be sent at any time. This includes gaps or resyncs. Always replace local state with the snapshot.

  4. Requested trades arrive as W messages with MDEntryType = 2. They do not use incremental refreshes. The feed identifier is trades.sfox.{pair}, not orderbook.delta.*.

After reconnecting, resubscribe and rebuild local state from the new W snapshot.

Market Data Snapshot/Full Refresh - W

Tag
Name
Description

262

MDReqID

Original MDReqID that generated this refresh

55

Symbol

Symbol/currency pair of the market data entry

106

Issuer

The full feed recipient, for example orderbook.delta.btcusd

268

NoMDEntries

Number of market data entries in this message

-> 269

MDEntryType

0: Bid 1: Offer 2: Trade

-> 270

MDEntryPx

Price of the market data entry

-> 271

MDEntrySize

Size/Quantity of the market data entry

-> 273

MDEntryTime

Only for trades

-> 37

OrderID

Only for trades

-> 275

MDMkt

Market or liquidity source of the entry

-> 2446

AggressorSide

1: Buy 2: Sell

20050

LastPublished

UNIX timestamp (milliseconds) this order book was last published. Only present if requested with 20050=1 on the Market Data Request.

Market Data Incremental Refresh – X

Apply each entry to the local order book. Do not replace the full book unless a new snapshot (W) is received.

Tag
Name
Description

262

MDReqID

Original MDReqID that generated this refresh

268

NoMDEntries

Number of market data entries in this message

→ 55

Symbol

Symbol/currency pair of the market data entry

→ 269

MDEntryType

0: Bid 1: Offer

→ 279

MDUpdateAction

1: Change - insert or replace the level 2: Delete - remove the level

→ 270

MDEntryPx

Price of the market data entry

→ 271

MDEntrySize

Size/Quantity of the market data entry. Omitted when MDUpdateAction is Delete.

→ 275

MDMkt

Market / liquidity source of the entry

20050

LastPublished

UNIX timestamp (milliseconds) this order book was last published. Only present if requested with 20050=1 on the Market Data Request.

Applying updates

Order book levels are identified by price, market, and side (MDEntryPx + MDMkt + MDEntryType).

For each entry in an incremental refresh:

  1. Change (279=1): insert or replace the level at that price, market, and side with the given size.

  2. Delete (279=2): remove the level at that price, market, and side.

On any Snapshot/Full Refresh (W), discard local book state for that symbol and load the snapshot entries in full.

Trades – W

When MDEntryType = 2 is requested, trades arrive as snapshot messages (W) on the trades.sfox.{pair} feed.

Tag
Name
Description

262

MDReqID

Original MDReqID that generated this refresh

55

Symbol

Symbol/currency pair

106

Issuer

Feed identifier, e.g. trades.sfox.btcusd

268

NoMDEntries

Number of trade entries (typically 1)

→ 269

MDEntryType

2: Trade

→ 270

MDEntryPx

Trade price

→ 271

MDEntrySize

Trade quantity

→ 275

MDMkt

Market / exchange of the trade

→ 273

MDEntryTime

Trade timestamp

→ 37

OrderID

Trade ID

→ 2446

AggressorSide

1: Buy 2: Sell

Security List Request - x

Returns a Security List - y response containing supported symbols

Tag
Name
Required
Description

320

SecurityReqID

Y

559

SecurityListRequestType

Y

4: All Securities

Security List - y

The response containing the list of symbols from a Security List Request - x request

Tag
Name
Description

320

SecurityReqID

SecurityReqID from the SecurityListRequest

322

SecurityResponseID

Unique identifier of the response

560

SecurityRequestResult

0: Valid Request

146

NoRelatedSym

Specifies the number of returned symbols

-> 55

Symbol

Currency pair in lowercase basequote format, for example btcusd

Last updated