Skip to main content

Gate.IO Spot Trade Connector

Features

crypto-gateioConnector Key
Instruments
FX
Request Types
SUBMITCANCEL
Order Types
LIMIT
Time In Force
GTCIOC
Order ID Mapper
SEQUENCE
Order Status Request
Cancel On Disconnect
Commission
Post Only
Fast Cancel
Fast Replace

Notes

Rate Limits

Rate limits are applied per IP: 300 read operations per second.

Account Type

Margin, cross-margin, spot and unified trading can be switched in settings.

Default account type is set via the accountType configuration property. It can be overridden per order using the 6061 (AccountType) attribute.

Account type6061 attributeDescription
SPOTspotSpot trading
MARGINmarginIsolated margin trading
CROSS_MARGINcross_marginCross margin trading
UNIFIEDunifiedUnified account trading
warning

Important: All open orders must be closed before changing accountType in the connector configuration. Otherwise, those orders will be lost.

Order Status

Order status can be queried by the custom order ID provided with the new order request. Operations based on custom order ID are only accepted within 30 minutes of order creation. After that, lost orders without an external order ID cannot be recovered.

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.

Post Only

In Gate.IO Spot 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.

Commissions

Two commission types are available: Standard and GT. The connector reports one type per trade. If both fees are present, only the GT fee is reported.

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
accountTypeSPOTDefault value for the Account Type. Possible values: SPOT, MARGIN, CROSS_MARGIN, UNIFIED.
autoBorrowfalseDefault value for AutoBorrow order setting. Possible values: true, false.
autoRepayfalseDefault value for AutoRepay order setting. Possible values: true, false.
useRPIfalseFlag to use RPI (Retail Price Improvement) as the Time In Force for Post Only orders.
gateioSyncSettings.ordersRequestPageSize100Limitation for the number of orders in one open or closed orders response. Maximum value is 1000.
gateioSyncSettings.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.
60016001 (AutoBorrow) attribute relevant only for MARGIN, CROSS_MARGIN and UNIFIED trading. Possible values: true, false.
60026002 (AutoRepay) attribute relevant only for CROSS_MARGIN and UNIFIED trading. Possible values: true, false.
6061The Account Type can be configured with 6061 (AccountType) attribute. Default value can be specified with the accountType configuration property. Possible values: spot, margin, cross_margin, unified. See Account Type section for detailed explanation.

Config sample

include classpath("crypto-connectors.conf")

connectors {
GATEIO: ${template.connector.crypto.gateio} {
settings {
restUrl = "https://api.gateio.ws"
websocketUrl = "wss://api.gateio.ws/ws/v4/"

accountType = SPOT # SPOT - spot trading, MARGIN - isolated margin trading, CROSS_MARGIN - cross margin trading, UNIFIED - unified account trading

apiKeys: [
{
apiKey = "<API_KEY>"
apiSecret = "<API_SECRET>"
}
]
}
}
}