Binance Spot FIX Trade Connector
Features
fix-binanceConnector KeyNotes
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:
| Config | Tag 25001 | Description |
|---|---|---|
NONE | This 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_RESTING | 3 | This mode prevents a trade by immediately expiring the potential maker order's remaining quantity. |
CANCEL_TAKING | 2 | This mode prevents a trade by immediately expiring the taker order's remaining quantity. |
CANCEL_BOTH | 4 | This 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
| Parameter | Default Value | Description |
|---|---|---|
| apiKey | API Key. | |
| privateKey | Private Key. | |
| useSOR | false | Smart Order Routing flag. |
| selfMatchPreventionInstruction | Defines the strategy of dealing with matching orders if self-match prevention is triggered. Valid values: CANCEL_RESTING, CANCEL_TAKING, CANCEL_BOTH. |
Supported order attributes
| Key | Description |
|---|---|
| 18 | Pass 6 to send Post Only order. |
| 25032 | Pass Y to use SOR. |
| 25001 | SelfMatchPreventionStrategy(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>"
}
}
}