Skip to main content

Gate.IO Futures Trade Connector

Features

crypto-gateiofutConnector Key
Instruments
FUTURE
Request Types
SUBMITCANCELREPLACE
Order Types
LIMITMARKET
Time In Force
GTCIOCFOK
Order ID Mapper
SEQUENCE
Order Status Request
Cancel On Disconnect
Commission
Post Only
Fast Cancel
Fast Replace

Notes

Settle Currency and WebSocket URL settings

warning

Important: The connector supports trading in one settle currency per instance. The settleCurrency and websocketUrl settings must match:

Settle CurrencyWebSocket URL
usdtwss://fx-ws.gateio.ws/v4/ws/usdt
btcwss://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:

ConfigExchange valueDescription
NONEThis mode exempts the order from self-trade prevention.
CANCEL_RESTINGcoCancel oldest. Cancel old orders and keep new ones.
CANCEL_TAKINGcnCancel newest. Cancel new orders and keep old ones.
CANCEL_BOTHcbCancel 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:

Configuration

Connector settings

ParameterDefault ValueDescription
settleCurrencyusdtSettle currency. Possible values: usdt, btc.
expireInterval10sAn 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.
selfMatchPreventionInstructionOptional self trade prevention action. Possible values: NONE, CANCEL_RESTING, CANCEL_TAKING, CANCEL_BOTH.
useRPIfalseFlag to use RPI (Retail Price Improvement) as the Time In Force for Post Only orders.
gateiofutSyncSettings.ordersRequestPageSize100Limitation for the number of orders in one open or closed orders response. Maximum value is 1000.
gateiofutSyncSettings.tradesRequestPageSize100Limitation for the number of trades in one trades history response. Maximum value is 1000.

Supported order attributes

KeyDescription
1818 (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>"
}
]
}
}
}