Bitstamp FIX Trade Connector
Features
fix-bitstampConnector KeyNotes
FIX API Access
FIX API endpoint is not available by default.
Contact Bitstamp support to enable access.
Rounding
Prices and quantities can be silently rounded if not matched to tick size or qty increment.
The order quantity which does not match qty increment may lead to "overfills".
Cancel On Disconnect
On default the orders are canceled on logout.
In the vast majority of scenarios all orders will be canceled as expected on disconnect. However, there is a possibility that a network (or other similar) anomaly may result in some orders not being canceled.
To preserves orders on logout set preserveOrders = true.
Zero Average Price
Bitstamp sends zero as the average price even for executed orders.
For filled orders, the connector uses LastPx(31) as the average price.
Connectivity
Bitstamp requires secure (SSL) TCP/IP socket connection to Bitstamp FIX Gateway.
Stunnel configuration:
[BITSTAMP]
client = yes
accept = 15001
connect = fixserver.bitstamp.net:5001
verify = 0
FIX Server Restart
Occasionally servers need to be restarted (e.g. due to software updates).
Symbology
Currency pairs in BASE/QUOTE format, e.g. BTC/USDT.
Schedule
Bitstamp FIX session operates 24/7.
Sequence numbers will be reset when a user reaches a predefined threshold.
The threshold of sequence number is currently set to 1,000,000.
When the threshold is reached, the server sends a FIX news event to notify the user of the upcoming reset.
The user then has 5 seconds to reconnect and reset sequence numbers.
If the user does not respond, the server sends a Logout event with ResetSeqNumFlag = Y.
https://www.bitstamp.net/fix/v2/#fix-sequence-numbers-reset
Configuration
Connector settings
| Parameter | Default Value | Description |
|---|---|---|
| account | 0 | Trade account ID. It needs to match the sub-account unique id of the API key used for login. Trade account id for main account is 0 |
| useAccount | false | The flag to force using request's account in preference of default account. |
| apiVersion | V2.2 | Bitstamp FIX API version. |
| asyncSession | false | This flag enables an async session. An async session enables significantly higher throughput, but does not guarantee an execution order (i.e. orders that were sent sooner might be placed later and vice versa). |
| preserveOrders | false | This flag allows to preserves order on logout. On default the orders are canceled on logout. |
| marginType | CROSS | Margin type. Valid values: ISOLATED, CROSS. |
| leverage | 1 | Valid values for leverage are decimal numbers greater than, or equal to 1. |
Supported order attributes
| Key | Description |
|---|---|
| 18 | ExecInst(18). Valid values: 6 for PostOnly orders. |
| 30000, 6030 | Margin Type. Valid values: I - ISOLATED, C - CROSS. Specifies the margin mode for derivatives markets. This field is required for orders placed in either CROSS or ISOLATED margin mode. Applicable for margin trading, defining how margin is applied to the order. |
| 30001, 6031 | Leverage. The decimal number greater than, or equal to 1. Leverage rate for margin trading. This field is required for CROSS/ISOLATED margin mode. Applicable for margin orders to define the leverage rate. |
| 30006 | White Label Account. Indicates on behalf of which account the order is placed. |
Config sample
connectors {
BITSTAMP: ${template.connector.fix.bitstamp} {
settings {
host = "<STUNNEL_HOST>"
port = <STUNNEL_PORT>
senderCompId = "<CUSTOMER_ID>"
targetCompId = BITSTAMP
username = "<USERNAME>"
password = "<PASSWORD>"
account = 0 # Trade account ID (0 means main account)
}
}
}