Gate.IO Futures Trade Connector
Features
crypto-gateiofutConnector KeyNotes
Settle Currency and WebSocket URL settings
Important: The connector supports trading in one settle currency per instance. The settleCurrency and websocketUrl settings must match:
| Settle Currency | WebSocket URL |
|---|---|
usdt | wss://fx-ws.gateio.ws/v4/ws/usdt |
btc | wss://fx-ws.gateio.ws/v4/ws/btc |
Market Orders
MARKET orders are supported with IMMEDIATE_OR_CANCEL time in force only.
Price and Quantity Precision
Submit orders with price and quantity precision matching the exchange symbols' specification. The exchange accepts higher precision but truncates the less significant digits. Orders with such discrepancies cannot be matched during order synchronization.
Self-Match Prevention
There are four possible modes for self-trade prevention:
| Config | Exchange value | Description |
|---|---|---|
NONE | This mode exempts the order from self-trade prevention. | |
CANCEL_RESTING | co | Cancel oldest. Cancel old orders and keep new ones. |
CANCEL_TAKING | cn | Cancel newest. Cancel new orders and keep old ones. |
CANCEL_BOTH | cb | Cancel both. Both old and new orders will be cancelled. |
Post Only
In Gate.IO Futures API Post Only orders are represented via Gate.IO Time In Force.
When Post Only flag is defined in an order request, it takes precedence over the specified Time In Force.
I.e. if Post Only flag is present - request's Time In Force is ignored and order will be placed as Post Only.
Symbology
Currency pairs in BASE_QUOTE format (underscore-separated), e.g. BTC_USDT, LTC_USDT.
Full list of supported symbols can be retrieved via public REST API:
usdt-settled: https://api.gateio.ws/api/v4/futures/usdt/contractsbtc-settled: https://api.gateio.ws/api/v4/futures/btc/contracts
Configuration
Connector settings
| Parameter | Default Value | Description |
|---|---|---|
| settleCurrency | usdt | Settle currency. Possible values: usdt, btc. |
| expireInterval | 10s | An interval after which a request is no longer valid. The exchange will reject a request if it receives the request after the expiration time. 0 value disables the check. |
| selfMatchPreventionInstruction | Optional self trade prevention action. Possible values: NONE, CANCEL_RESTING, CANCEL_TAKING, CANCEL_BOTH. | |
| useRPI | false | Flag to use RPI (Retail Price Improvement) as the Time In Force for Post Only orders. |
| gateiofutSyncSettings.ordersRequestPageSize | 100 | Limitation for the number of orders in one open or closed orders response. Maximum value is 1000. |
| gateiofutSyncSettings.tradesRequestPageSize | 100 | Limitation for the number of trades in one trades history response. Maximum value is 1000. |
Supported order attributes
| Key | Description |
|---|---|
| 18 | 18 (PostOnly) attribute relevant only for LIMIT orders with Good Till Cancel time in force. Switches between taker and maker order types. Possible values: 6. |
Config sample
include classpath("crypto-connectors.conf")
connectors {
GATEIOFUT: ${template.connector.crypto.gateiofut} {
settings {
restUrl = "https://api.gateio.ws"
websocketUrl = "wss://fx-ws.gateio.ws/v4/ws/usdt"
apiKeys: [
{
apiKey = "<API_KEY>"
apiSecret = "<API_SECRET>"
}
]
}
}
}