Skip to main content

Binance Spot FIX Trade Connector

Features

fix-binanceConnector Key
Instruments
FX
Request Types
SUBMITCANCEL
Order Types
MARKETLIMIT
Time In Force
GTCFOKIOC
Order ID Mapper
COMPOSITE
Order Status Request
Cancel On Disconnect
Commission
Post Only
Fast Cancel
Fast Replace

Notes

Message Recovery

Binance does not resend missed messages.

Private Key

The FIX Binance Spot connector requires Ed25519 API keys.

Client Order ID

The length of ClOrdID(11) must not exceed 36 characters.
Client Order ID allows only the following characters: a-z, A-Z, 0-9, -, _

The connector passes {SOURCE_ID}_{EMBER_ORDER_ID} value in ClOrdID(11).

Self-Match Prevention

There are four possible modes for self-trade prevention:

ConfigTag 25001Description
NONEThis mode exempts the order from self-trade prevention. Accounts or Trade group IDs will not be compared, no orders will be expired, and the trade will occur.
CANCEL_RESTING3This mode prevents a trade by immediately expiring the potential maker order's remaining quantity.
CANCEL_TAKING2This mode prevents a trade by immediately expiring the taker order's remaining quantity.
CANCEL_BOTH4This mode prevents a trade by immediately expiring both the taker and the potential maker orders' remaining quantities.

The STP event will occur depending on the STP mode of the taker order.
Thus, the STP mode of an order that goes on the book is no longer relevant and will be ignored for all future order processing.

SOR

Smart Order Routing (SOR) enhances liquidity by filling orders from multiple order books with the same base asset and interchangeable quote assets, such as stablecoins pegged to the same fiat currency.

Though quote assets are interchangeable, selling the base asset will always result in receiving the quote asset of your order's symbol.

SOR checks eligible order books for the best price levels and fills orders accordingly.

Price and Quantity Increment

If the price or quantity does not match the tick/increment size, Binance rejects the order.

Connection

Binance FIX requires a secure connection via stunnel.

Stunnel configuration:

[BINANCE]
client = yes
accept = 19000
connect = fix-oe.binance.com:9000
verify = 0

Symbology

Currency pairs without separator, uppercase required, e.g. BTCUSDT, LTCUSDT.

For the full list of available currency pairs, see the exchange GUI or query the public REST API: https://api.binance.com/api/v3/exchangeInfo

Schedule

Trading is available 24/7/365.

Configuration

Connector settings

ParameterDefault ValueDescription
apiKeyAPI Key.
privateKeyPrivate Key.
useSORfalseSmart Order Routing flag.
selfMatchPreventionInstructionDefines the strategy of dealing with matching orders if self-match prevention is triggered. Valid values: CANCEL_RESTING, CANCEL_TAKING, CANCEL_BOTH.

Supported order attributes

KeyDescription
18Pass 6 to send Post Only order.
25032Pass Y to use SOR.
25001SelfMatchPreventionStrategy(2964). Defines the strategy of dealing with matching orders if self-match prevention is triggered. Valid values: 2 (Cancel taker order), 3 (Cancel maker order), 4 (Cancel both).

Config sample

connectors {
BINANCEFIX: ${template.connector.fix.binance} {
settings {
host = "<STUNNEL_HOST>"
port = <STUNNEL_PORT>

senderCompId = "<SENDER_COMP_ID>"
targetCompId = "<TARGET_COMP_ID>"

apiKey = "<API_KEY>"
privateKey = "<PRIVATE_KEY>"
}
}
}