Gate.IO Spot Trade Connector
Features
crypto-gateioConnector KeyNotes
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 type | 6061 attribute | Description |
|---|---|---|
| SPOT | spot | Spot trading |
| MARGIN | margin | Isolated margin trading |
| CROSS_MARGIN | cross_margin | Cross margin trading |
| UNIFIED | unified | Unified account trading |
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:
- Spot: https://api.gateio.ws/api/v4/spot/currency_pairs
- Margin and Cross Margin: https://api.gateio.ws/api/v4/margin/currency_pairs
Configuration
Connector settings
| Parameter | Default Value | Description |
|---|---|---|
| accountType | SPOT | Default value for the Account Type. Possible values: SPOT, MARGIN, CROSS_MARGIN, UNIFIED. |
| autoBorrow | false | Default value for AutoBorrow order setting. Possible values: true, false. |
| autoRepay | false | Default value for AutoRepay order setting. Possible values: true, false. |
| useRPI | false | Flag to use RPI (Retail Price Improvement) as the Time In Force for Post Only orders. |
| gateioSyncSettings.ordersRequestPageSize | 100 | Limitation for the number of orders in one open or closed orders response. Maximum value is 1000. |
| gateioSyncSettings.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. |
| 6001 | 6001 (AutoBorrow) attribute relevant only for MARGIN, CROSS_MARGIN and UNIFIED trading. Possible values: true, false. |
| 6002 | 6002 (AutoRepay) attribute relevant only for CROSS_MARGIN and UNIFIED trading. Possible values: true, false. |
| 6061 | The 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>"
}
]
}
}
}