All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| listDeliveryContracts | GET /delivery/{settle}/contracts | Query all futures contracts |
| getDeliveryContract | GET /delivery/{settle}/contracts/{contract} | Query single contract information |
| listDeliveryOrderBook | GET /delivery/{settle}/order_book | Query futures market depth information |
| listDeliveryTrades | GET /delivery/{settle}/trades | Futures market transaction records |
| listDeliveryCandlesticks | GET /delivery/{settle}/candlesticks | Futures market K-line chart |
| listDeliveryTickers | GET /delivery/{settle}/tickers | Get all futures trading statistics |
| listDeliveryInsuranceLedger | GET /delivery/{settle}/insurance | Futures market insurance fund history |
| listDeliveryAccounts | GET /delivery/{settle}/accounts | Get futures account |
| listDeliveryAccountBook | GET /delivery/{settle}/account_book | Query futures account change history |
| listDeliveryPositions | GET /delivery/{settle}/positions | Get user position list |
| getDeliveryPosition | GET /delivery/{settle}/positions/{contract} | Get single position information |
| updateDeliveryPositionMargin | POST /delivery/{settle}/positions/{contract}/margin | Update position margin |
| updateDeliveryPositionLeverage | POST /delivery/{settle}/positions/{contract}/leverage | Update position leverage |
| updateDeliveryPositionRiskLimit | POST /delivery/{settle}/positions/{contract}/risk_limit | Update position risk limit |
| listDeliveryOrders | GET /delivery/{settle}/orders | Query futures order list |
| createDeliveryOrder | POST /delivery/{settle}/orders | Place futures order |
| cancelDeliveryOrders | DELETE /delivery/{settle}/orders | Cancel all orders with 'open' status |
| getDeliveryOrder | GET /delivery/{settle}/orders/{order_id} | Query single order details |
| cancelDeliveryOrder | DELETE /delivery/{settle}/orders/{order_id} | Cancel single order |
| getMyDeliveryTrades | GET /delivery/{settle}/my_trades | Query personal trading records |
| listDeliveryPositionClose | GET /delivery/{settle}/position_close | Query position close history |
| listDeliveryLiquidates | GET /delivery/{settle}/liquidates | Query liquidation history |
| listDeliverySettlements | GET /delivery/{settle}/settlements | Query settlement records |
| listDeliveryRiskLimitTiers | GET /delivery/{settle}/risk_limit_tiers | Query risk limit tiers |
| listPriceTriggeredDeliveryOrders | GET /delivery/{settle}/price_orders | Query auto order list |
| createPriceTriggeredDeliveryOrder | POST /delivery/{settle}/price_orders | Create price-triggered order |
| cancelPriceTriggeredDeliveryOrderList | DELETE /delivery/{settle}/price_orders | Cancel all auto orders |
| getPriceTriggeredDeliveryOrder | GET /delivery/{settle}/price_orders/{order_id} | Query single auto order details |
| cancelPriceTriggeredDeliveryOrder | DELETE /delivery/{settle}/price_orders/{order_id} | Cancel single auto order |
List<DeliveryContract> listDeliveryContracts(settle)
Query all futures contracts
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencytry {
List<DeliveryContract> result = apiInstance.listDeliveryContracts(settle);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#listDeliveryContracts");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
DeliveryContract getDeliveryContract(settle, contract)
Query single contract information
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT_20200814"; // String | Futures contracttry {
DeliveryContractresult = apiInstance.getDeliveryContract(settle, contract);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#getDeliveryContract");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Contract information | - |
DeliveryOrderBook listDeliveryOrderBook(settle, contract).interval(interval).limit(limit).withId(withId).execute();
Query futures market depth information
Bids will be sorted by price from high to low, while asks sorted reversely
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT_20200814"; // String | Futures contractStringinterval = "0"; // String | Price precision for merged depth. 0 means no merging. If not specified, defaults to 0Integerlimit = 10; // Integer | Number of depth levelsBooleanwithId = false; // Boolean | Whether to return depth update ID. This ID increments by 1 each time the depth changestry {
DeliveryOrderBookresult = apiInstance.listDeliveryOrderBook(settle, contract)
.interval(interval)
.limit(limit)
.withId(withId)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#listDeliveryOrderBook");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract | |
| interval | String | Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 | [optional] [default to 0] [enum: 0, 0.1, 0.01] |
| limit | Integer | Number of depth levels | [optional] [default to 10] |
| withId | Boolean | Whether to return depth update ID. This ID increments by 1 each time the depth changes | [optional] [default to false] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Depth query successful | - |
List<DeliveryTrade> listDeliveryTrades(settle, contract).limit(limit).lastId(lastId).from(from).to(to).execute();
Futures market transaction records
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT_20200814"; // String | Futures contractIntegerlimit = 100; // Integer | Maximum number of records returned in a single listStringlastId = "12345"; // String | Use the ID of the last record in the previous list as the starting point for the next list.This field is no longer supported. For new requests, please use the fromand tofields to specify the time rangLongfrom = 1546905600L; // Long | Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. Longto = 1546935600L; // Long | Specify end time in Unix seconds, default to current time.try {
List<DeliveryTrade> result = apiInstance.listDeliveryTrades(settle, contract)
.limit(limit)
.lastId(lastId)
.from(from)
.to(to)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#listDeliveryTrades");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract | |
| limit | Integer | Maximum number of records returned in a single list | [optional] [default to 100] |
| lastId | String | Use the ID of the last record in the previous list as the starting point for the next list.This field is no longer supported. For new requests, please use the fromand tofields to specify the time rang | [optional] |
| from | Long | Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. | [optional] |
| to | Long | Specify end time in Unix seconds, default to current time. | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
List<DeliveryCandlestick> listDeliveryCandlesticks(settle, contract).from(from).to(to).limit(limit).interval(interval).execute();
Futures market K-line chart
Return specified contract candlesticks. If prefix `contract` with `mark_`, the contract's mark price candlesticks are returned; if prefix with `index_`, index price candlesticks will be returned. Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying `from`, `to` and `interval`
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT_20200814"; // String | Futures contractLongfrom = 1546905600L; // Long | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specifiedLongto = 1546935600L; // Long | Specify the end time of the K-line chart, defaults to current time if not specified, note that the time format is Unix timestamp with second precisionIntegerlimit = 100; // Integer | Maximum number of recent data points to return. `limit` conflicts with `from` and `to`. If either `from` or `to` is specified, request will be rejected.Stringinterval = "5m"; // String | Time interval between data points, note that 1w represents a natural week, 7d time is aligned with Unix initial timetry {
List<DeliveryCandlestick> result = apiInstance.listDeliveryCandlesticks(settle, contract)
.from(from)
.to(to)
.limit(limit)
.interval(interval)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#listDeliveryCandlesticks");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract | |
| from | Long | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] |
| to | Long | Specify the end time of the K-line chart, defaults to current time if not specified, note that the time format is Unix timestamp with second precision | [optional] |
| limit | Integer | Maximum number of recent data points to return. `limit` conflicts with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] |
| interval | String | Time interval between data points, note that 1w represents a natural week, 7d time is aligned with Unix initial time | [optional] [default to 5m] [enum: 10s, 30s, 1m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 7d, 1w, 30d] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
List<DeliveryTicker> listDeliveryTickers(settle).contract(contract).execute();
Get all futures trading statistics
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT_20200814"; // String | Futures contracttry {
List<DeliveryTicker> result = apiInstance.listDeliveryTickers(settle)
.contract(contract)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#listDeliveryTickers");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
List<InsuranceRecord> listDeliveryInsuranceLedger(settle).limit(limit).execute();
Futures market insurance fund history
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyIntegerlimit = 100; // Integer | Maximum number of records returned in a single listtry {
List<InsuranceRecord> result = apiInstance.listDeliveryInsuranceLedger(settle)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#listDeliveryInsuranceLedger");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| limit | Integer | Maximum number of records returned in a single list | [optional] [default to 100] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
DeliveryAccount listDeliveryAccounts(settle)
Get futures account
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencytry {
DeliveryAccountresult = apiInstance.listDeliveryAccounts(settle);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#listDeliveryAccounts");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
List<DeliveryAccountBook> listDeliveryAccountBook(settle).limit(limit).from(from).to(to).type(type).execute();
Query futures account change history
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyIntegerlimit = 100; // Integer | Maximum number of records returned in a single listLongfrom = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)Longto = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestampStringtype = "dnw"; // String | Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebatestry {
List<DeliveryAccountBook> result = apiInstance.listDeliveryAccountBook(settle)
.limit(limit)
.from(from)
.to(to)
.type(type)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#listDeliveryAccountBook");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| limit | Integer | Maximum number of records returned in a single list | [optional] [default to 100] |
| from | Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] |
| to | Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] |
| type | String | Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates | [optional] [enum: dnw, pnl, fee, refr, fund, point_dnw, point_fee, point_refr] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
List<DeliveryPosition> listDeliveryPositions(settle)
Get user position list
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencytry {
List<DeliveryPosition> result = apiInstance.listDeliveryPositions(settle);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#listDeliveryPositions");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
DeliveryPosition getDeliveryPosition(settle, contract)
Get single position information
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT_20200814"; // String | Futures contracttry {
DeliveryPositionresult = apiInstance.getDeliveryPosition(settle, contract);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#getDeliveryPosition");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Position information | - |
DeliveryPosition updateDeliveryPositionMargin(settle, contract, change)
Update position margin
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT_20200814"; // String | Futures contractStringchange = "0.01"; // String | Margin change amount, positive number increases, negative number decreasestry {
DeliveryPositionresult = apiInstance.updateDeliveryPositionMargin(settle, contract, change);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#updateDeliveryPositionMargin");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract | |
| change | String | Margin change amount, positive number increases, negative number decreases |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Position information | - |
DeliveryPosition updateDeliveryPositionLeverage(settle, contract, leverage)
Update position leverage
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT_20200814"; // String | Futures contractStringleverage = "10"; // String | New position leveragetry {
DeliveryPositionresult = apiInstance.updateDeliveryPositionLeverage(settle, contract, leverage);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#updateDeliveryPositionLeverage");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract | |
| leverage | String | New position leverage |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Position information | - |
DeliveryPosition updateDeliveryPositionRiskLimit(settle, contract, riskLimit)
Update position risk limit
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT_20200814"; // String | Futures contractStringriskLimit = "10"; // String | New position risk limittry {
DeliveryPositionresult = apiInstance.updateDeliveryPositionRiskLimit(settle, contract, riskLimit);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#updateDeliveryPositionRiskLimit");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract | |
| riskLimit | String | New position risk limit |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Position information | - |
List<DeliveryOrder> listDeliveryOrders(settle, status).contract(contract).limit(limit).offset(offset).lastId(lastId).countTotal(countTotal).execute();
Query futures order list
Zero-fill orders cannot be retrieved 10 minutes after order cancellation
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringstatus = "open"; // String | Query order list based on statusStringcontract = "BTC_USDT_20200814"; // String | Futures contractIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0StringlastId = "12345"; // String | Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be usedIntegercountTotal = 0; // Integer | Whether to return total number matched, defaults to 0 (no return)try {
List<DeliveryOrder> result = apiInstance.listDeliveryOrders(settle, status)
.contract(contract)
.limit(limit)
.offset(offset)
.lastId(lastId)
.countTotal(countTotal)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#listDeliveryOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| status | String | Query order list based on status | [enum: open, finished] |
| contract | String | Futures contract | [optional] |
| limit | Integer | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | Integer | List offset, starting from 0 | [optional] [default to 0] |
| lastId | String | Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used | [optional] |
| countTotal | Integer | Whether to return total number matched, defaults to 0 (no return) | [optional] [default to 0] [enum: 0, 1] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination * X-Pagination-Offset - Offset specified for pagination * X-Pagination-Total - Total number matched, only returned if `count_total` is set to 1 |
DeliveryOrder createDeliveryOrder(settle, deliveryOrder)
Place futures order
Zero-fill orders cannot be retrieved 10 minutes after order cancellation
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyDeliveryOrderdeliveryOrder = newDeliveryOrder(); // DeliveryOrder | try {
DeliveryOrderresult = apiInstance.createDeliveryOrder(settle, deliveryOrder);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#createDeliveryOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| deliveryOrder | DeliveryOrder |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Order details | - |
List<DeliveryOrder> cancelDeliveryOrders(settle, contract, side)
Cancel all orders with 'open' status
Zero-fill orders cannot be retrieved 10 minutes after order cancellation
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT_20200814"; // String | Futures contractStringside = "ask"; // String | Specify all bids or all asks, both included if not specifiedtry {
List<DeliveryOrder> result = apiInstance.cancelDeliveryOrders(settle, contract, side);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#cancelDeliveryOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract | |
| side | String | Specify all bids or all asks, both included if not specified | [optional] [enum: ask, bid] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Batch cancellation successful | - |
DeliveryOrder getDeliveryOrder(settle, orderId)
Query single order details
Zero-fill orders cannot be retrieved 10 minutes after order cancellation
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringorderId = "12345"; // String | ID returned when order is successfully createdtry {
DeliveryOrderresult = apiInstance.getDeliveryOrder(settle, orderId);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#getDeliveryOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| orderId | String | ID returned when order is successfully created |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Order details | - |
DeliveryOrder cancelDeliveryOrder(settle, orderId)
Cancel single order
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringorderId = "12345"; // String | ID returned when order is successfully createdtry {
DeliveryOrderresult = apiInstance.cancelDeliveryOrder(settle, orderId);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#cancelDeliveryOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| orderId | String | ID returned when order is successfully created |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Order details | - |
List<DeliveryMyTrade> getMyDeliveryTrades(settle).contract(contract).order(order).limit(limit).offset(offset).lastId(lastId).countTotal(countTotal).execute();
Query personal trading records
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT_20200814"; // String | Futures contractLongorder = 12345L; // Long | Futures order ID, return related data only if specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0StringlastId = "12345"; // String | Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be usedIntegercountTotal = 0; // Integer | Whether to return total number matched, defaults to 0 (no return)try {
List<DeliveryMyTrade> result = apiInstance.getMyDeliveryTrades(settle)
.contract(contract)
.order(order)
.limit(limit)
.offset(offset)
.lastId(lastId)
.countTotal(countTotal)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#getMyDeliveryTrades");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract | [optional] |
| order | Long | Futures order ID, return related data only if specified | [optional] |
| limit | Integer | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | Integer | List offset, starting from 0 | [optional] [default to 0] |
| lastId | String | Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used | [optional] |
| countTotal | Integer | Whether to return total number matched, defaults to 0 (no return) | [optional] [default to 0] [enum: 0, 1] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination * X-Pagination-Offset - Offset specified for pagination * X-Pagination-Total - Total number matched, only returned if `count_total` is set to 1 |
List<DeliveryPositionClose> listDeliveryPositionClose(settle).contract(contract).limit(limit).execute();
Query position close history
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT_20200814"; // String | Futures contractIntegerlimit = 100; // Integer | Maximum number of records returned in a single listtry {
List<DeliveryPositionClose> result = apiInstance.listDeliveryPositionClose(settle)
.contract(contract)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#listDeliveryPositionClose");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract | [optional] |
| limit | Integer | Maximum number of records returned in a single list | [optional] [default to 100] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
List<DeliveryLiquidate> listDeliveryLiquidates(settle).contract(contract).limit(limit).at(at).execute();
Query liquidation history
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT_20200814"; // String | Futures contractIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegerat = 0; // Integer | Specify liquidation timestamptry {
List<DeliveryLiquidate> result = apiInstance.listDeliveryLiquidates(settle)
.contract(contract)
.limit(limit)
.at(at)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#listDeliveryLiquidates");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract | [optional] |
| limit | Integer | Maximum number of records returned in a single list | [optional] [default to 100] |
| at | Integer | Specify liquidation timestamp | [optional] [default to 0] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
List<DeliverySettlement> listDeliverySettlements(settle).contract(contract).limit(limit).at(at).execute();
Query settlement records
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT_20200814"; // String | Futures contractIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegerat = 0; // Integer | Specify settlement timestamptry {
List<DeliverySettlement> result = apiInstance.listDeliverySettlements(settle)
.contract(contract)
.limit(limit)
.at(at)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#listDeliverySettlements");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract | [optional] |
| limit | Integer | Maximum number of records returned in a single list | [optional] [default to 100] |
| at | Integer | Specify settlement timestamp | [optional] [default to 0] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
List<DeliveryLimitRiskTiers> listDeliveryRiskLimitTiers(settle).contract(contract).limit(limit).offset(offset).execute();
Query risk limit tiers
When the 'contract' parameter is not passed, the default is to query the risk limits for the top 100 markets. 'Limit' and 'offset' correspond to pagination queries at the market level, not to the length of the returned array. This only takes effect when the contract parameter is empty.
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT_20200814"; // String | Futures contractIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<DeliveryLimitRiskTiers> result = apiInstance.listDeliveryRiskLimitTiers(settle)
.contract(contract)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#listDeliveryRiskLimitTiers");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract | [optional] |
| limit | Integer | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | Integer | List offset, starting from 0 | [optional] [default to 0] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
List<FuturesPriceTriggeredOrder> listPriceTriggeredDeliveryOrders(settle, status).contract(contract).limit(limit).offset(offset).execute();
Query auto order list
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringstatus = "status_example"; // String | Query order list based on statusStringcontract = "BTC_USDT"; // String | Futures contract, return related data only if specifiedIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegeroffset = 0; // Integer | List offset, starting from 0try {
List<FuturesPriceTriggeredOrder> result = apiInstance.listPriceTriggeredDeliveryOrders(settle, status)
.contract(contract)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#listPriceTriggeredDeliveryOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| status | String | Query order list based on status | [enum: open, finished] |
| contract | String | Futures contract, return related data only if specified | [optional] |
| limit | Integer | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | Integer | List offset, starting from 0 | [optional] [default to 0] |
List<FuturesPriceTriggeredOrder>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
TriggerOrderResponse createPriceTriggeredDeliveryOrder(settle, futuresPriceTriggeredOrder)
Create price-triggered order
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyFuturesPriceTriggeredOrderfuturesPriceTriggeredOrder = newFuturesPriceTriggeredOrder(); // FuturesPriceTriggeredOrder | try {
TriggerOrderResponseresult = apiInstance.createPriceTriggeredDeliveryOrder(settle, futuresPriceTriggeredOrder);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#createPriceTriggeredDeliveryOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| futuresPriceTriggeredOrder | FuturesPriceTriggeredOrder |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Order created successfully | - |
List<FuturesPriceTriggeredOrder> cancelPriceTriggeredDeliveryOrderList(settle, contract)
Cancel all auto orders
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringcontract = "BTC_USDT"; // String | Futures contracttry {
List<FuturesPriceTriggeredOrder> result = apiInstance.cancelPriceTriggeredDeliveryOrderList(settle, contract);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#cancelPriceTriggeredDeliveryOrderList");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract |
List<FuturesPriceTriggeredOrder>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Batch cancel request is received and processed. Success is determined based on the order list | - |
FuturesPriceTriggeredOrder getPriceTriggeredDeliveryOrder(settle, orderId)
Query single auto order details
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringorderId = "orderId_example"; // String | ID returned when order is successfully createdtry {
FuturesPriceTriggeredOrderresult = apiInstance.getPriceTriggeredDeliveryOrder(settle, orderId);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#getPriceTriggeredDeliveryOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| orderId | String | ID returned when order is successfully created |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Auto order details | - |
FuturesPriceTriggeredOrder cancelPriceTriggeredDeliveryOrder(settle, orderId)
Cancel single auto order
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.DeliveryApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApiapiInstance = newDeliveryApi(defaultClient);
Stringsettle = "usdt"; // String | Settle currencyStringorderId = "orderId_example"; // String | ID returned when order is successfully createdtry {
FuturesPriceTriggeredOrderresult = apiInstance.cancelPriceTriggeredDeliveryOrder(settle, orderId);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling DeliveryApi#cancelPriceTriggeredDeliveryOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| orderId | String | ID returned when order is successfully created |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Auto order details | - |