All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| cancelFuturesOrder | DELETE /futures/{settle}/orders/{order_id} | Cancel a single order |
| cancelFuturesOrders | DELETE /futures/{settle}/orders | Cancel all `open` orders matched |
| cancelPriceTriggeredOrder | DELETE /futures/{settle}/price_orders/{order_id} | Cancel a single order |
| cancelPriceTriggeredOrderList | DELETE /futures/{settle}/price_orders | Cancel all open orders |
| createFuturesOrder | POST /futures/{settle}/orders | Create a futures order |
| createPriceTriggeredOrder | POST /futures/{settle}/price_orders | Create a price-triggered order |
| getFuturesContract | GET /futures/{settle}/contracts/{contract} | Get a single contract |
| getFuturesOrder | GET /futures/{settle}/orders/{order_id} | Get a single order |
| getMyTrades | GET /futures/{settle}/my_trades | List personal trading history |
| getPosition | GET /futures/{settle}/positions/{contract} | Get single position |
| getPriceTriggeredOrder | GET /futures/{settle}/price_orders/{order_id} | Get a single order |
| listFuturesAccountBook | GET /futures/{settle}/account_book | Query account book |
| listFuturesAccounts | GET /futures/{settle}/accounts | Query futures account |
| listFuturesCandlesticks | GET /futures/{settle}/candlesticks | Get futures candlesticks |
| listFuturesContracts | GET /futures/{settle}/contracts | List all futures contracts |
| listFuturesFundingRateHistory | GET /futures/{settle}/funding_rate | Funding rate history |
| listFuturesInsuranceLedger | GET /futures/{settle}/insurance | Futures insurance balance history |
| listFuturesOrderBook | GET /futures/{settle}/order_book | Futures order book |
| listFuturesOrders | GET /futures/{settle}/orders | List futures orders |
| listFuturesTickers | GET /futures/{settle}/tickers | List futures tickers |
| listFuturesTrades | GET /futures/{settle}/trades | Futures trading history |
| listLiquidates | GET /futures/{settle}/liquidates | List liquidation history |
| listPositionClose | GET /futures/{settle}/position_close | List position close history |
| listPositions | GET /futures/{settle}/positions | List all positions of a user |
| listPriceTriggeredOrders | GET /futures/{settle}/price_orders | List all auto orders |
| updatePositionLeverage | POST /futures/{settle}/positions/{contract}/leverage | Update position leverage |
| updatePositionMargin | POST /futures/{settle}/positions/{contract}/margin | Update position margin |
| updatePositionRiskLimit | POST /futures/{settle}/positions/{contract}/risk_limit | Update position risk limit |
FuturesOrder cancelFuturesOrder(settle, orderId)
Cancel a single order
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
String orderId = "12345"; // String | ID returned on order successfully being created
try {
FuturesOrder result = apiInstance.cancelFuturesOrder(settle, orderId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#cancelFuturesOrder");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| orderId | String | ID returned on order successfully being created |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
List<FuturesOrder> cancelFuturesOrders(settle, contract, side)
Cancel all `open` orders matched
Zero-fill order cannot be retrieved 60 seconds after cancellation
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract
String side = "ask"; // String | All bids or asks. Both included in not specified
try {
List<FuturesOrder> result = apiInstance.cancelFuturesOrders(settle, contract, side);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#cancelFuturesOrders");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract | |
| side | String | All bids or asks. Both included in not specified | [optional] [enum: ask, bid] |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
FuturesPriceTriggeredOrder cancelPriceTriggeredOrder(settle, orderId)
Cancel a single order
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
String orderId = "orderId_example"; // String | ID returned on order successfully being created
try {
FuturesPriceTriggeredOrder result = apiInstance.cancelPriceTriggeredOrder(settle, orderId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#cancelPriceTriggeredOrder");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| orderId | String | ID returned on order successfully being created |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
List<FuturesPriceTriggeredOrder> cancelPriceTriggeredOrderList(settle, contract)
Cancel all open orders
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract
try {
List<FuturesPriceTriggeredOrder> result = apiInstance.cancelPriceTriggeredOrderList(settle, contract);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#cancelPriceTriggeredOrderList");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract |
List<FuturesPriceTriggeredOrder>
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
FuturesOrder createFuturesOrder(settle, futuresOrder)
Create a futures order
Zero-fill order cannot be retrieved 60 seconds after cancellation
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
FuturesOrder futuresOrder = new FuturesOrder(); // FuturesOrder |
try {
FuturesOrder result = apiInstance.createFuturesOrder(settle, futuresOrder);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#createFuturesOrder");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| futuresOrder | FuturesOrder |
Authentication with API key and secret is required
- Content-Type: application/json
- Accept: application/json
TriggerOrderResponse createPriceTriggeredOrder(settle, futuresPriceTriggeredOrder)
Create a price-triggered order
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
FuturesPriceTriggeredOrder futuresPriceTriggeredOrder = new FuturesPriceTriggeredOrder(); // FuturesPriceTriggeredOrder |
try {
TriggerOrderResponse result = apiInstance.createPriceTriggeredOrder(settle, futuresPriceTriggeredOrder);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#createPriceTriggeredOrder");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| futuresPriceTriggeredOrder | FuturesPriceTriggeredOrder |
Authentication with API key and secret is required
- Content-Type: application/json
- Accept: application/json
Contract getFuturesContract(settle, contract)
Get a single contract
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
FuturesApi apiInstance = new FuturesApi();
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract
try {
Contract result = apiInstance.getFuturesContract(settle, contract);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#getFuturesContract");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract |
No authorization required
- Content-Type: Not defined
- Accept: application/json
FuturesOrder getFuturesOrder(settle, orderId)
Get a single order
Zero-fill order cannot be retrieved 60 seconds after cancellation
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
String orderId = "12345"; // String | ID returned on order successfully being created
try {
FuturesOrder result = apiInstance.getFuturesOrder(settle, orderId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#getFuturesOrder");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| orderId | String | ID returned on order successfully being created |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
List<MyFuturesTrade> getMyTrades(settle, contract, order, limit, lastId)
List personal trading history
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract, return related data only if specified
Integer order = 12345; // Integer | Futures order ID, return related data only if specified
Integer limit = 100; // Integer | Maximum number of record returned in one list
String lastId = "12345"; // String | Specify list staring point using the `id` of last record in previous list-query results
try {
List<MyFuturesTrade> result = apiInstance.getMyTrades(settle, contract, order, limit, lastId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#getMyTrades");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract, return related data only if specified | [optional] |
| order | Integer | Futures order ID, return related data only if specified | [optional] |
| limit | Integer | Maximum number of record returned in one list | [optional] [default to 100] |
| lastId | String | Specify list staring point using the `id` of last record in previous list-query results | [optional] |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
Position getPosition(settle, contract)
Get single position
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract
try {
Position result = apiInstance.getPosition(settle, contract);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#getPosition");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
FuturesPriceTriggeredOrder getPriceTriggeredOrder(settle, orderId)
Get a single order
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
String orderId = "orderId_example"; // String | ID returned on order successfully being created
try {
FuturesPriceTriggeredOrder result = apiInstance.getPriceTriggeredOrder(settle, orderId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#getPriceTriggeredOrder");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| orderId | String | ID returned on order successfully being created |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
List<FuturesAccountBook> listFuturesAccountBook(settle, limit, from, to, type)
Query account book
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
Integer limit = 100; // Integer | Maximum number of record returned in one list
Integer from = 1547706332; // Integer | Start timestamp
Integer to = 1547706332; // Integer | End timestamp
String type = "dnw"; // String | Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate
try {
List<FuturesAccountBook> result = apiInstance.listFuturesAccountBook(settle, limit, from, to, type);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesAccountBook");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| limit | Integer | Maximum number of record returned in one list | [optional] [default to 100] |
| from | Integer | Start timestamp | [optional] |
| to | Integer | End timestamp | [optional] |
| type | String | Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] [enum: dnw, pnl, fee, refr, fund, point_dnw, point_fee, point_refr] |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
FuturesAccount listFuturesAccounts(settle)
Query futures account
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
try {
FuturesAccount result = apiInstance.listFuturesAccounts(settle);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesAccounts");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
List<FuturesCandlestick> listFuturesCandlesticks(settle, contract, from, to, limit, interval)
Get futures candlesticks
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 io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
FuturesApi apiInstance = new FuturesApi();
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract
BigDecimal from = new BigDecimal(); // BigDecimal | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified
BigDecimal to = new BigDecimal(); // BigDecimal | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time
Integer limit = 100; // Integer | Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected.
String interval = "5m"; // String | Interval time between data points
try {
List<FuturesCandlestick> result = apiInstance.listFuturesCandlesticks(settle, contract, from, to, limit, interval);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesCandlesticks");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract | |
| from | BigDecimal | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] |
| to | BigDecimal | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional] |
| limit | Integer | Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] |
| interval | String | Interval time between data points | [optional] [default to 5m] [enum: 10s, 1m, 5m, 15m, 30m, 1h, 4h, 8h, 1d, 7d] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
List<Contract> listFuturesContracts(settle)
List all futures contracts
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
FuturesApi apiInstance = new FuturesApi();
String settle = "btc"; // String | Settle currency
try {
List<Contract> result = apiInstance.listFuturesContracts(settle);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesContracts");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
List<FundingRateRecord> listFuturesFundingRateHistory(settle, contract, limit)
Funding rate history
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
FuturesApi apiInstance = new FuturesApi();
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract
Integer limit = 100; // Integer | Maximum number of record returned in one list
try {
List<FundingRateRecord> result = apiInstance.listFuturesFundingRateHistory(settle, contract, limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesFundingRateHistory");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract | |
| limit | Integer | Maximum number of record returned in one list | [optional] [default to 100] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
List<InsuranceRecord> listFuturesInsuranceLedger(settle, limit)
Futures insurance balance history
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
FuturesApi apiInstance = new FuturesApi();
String settle = "btc"; // String | Settle currency
Integer limit = 100; // Integer | Maximum number of record returned in one list
try {
List<InsuranceRecord> result = apiInstance.listFuturesInsuranceLedger(settle, limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesInsuranceLedger");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| limit | Integer | Maximum number of record returned in one list | [optional] [default to 100] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
FuturesOrderBook listFuturesOrderBook(settle, contract, interval, limit)
Futures order book
Bids will be sorted by price from high to low, while asks sorted reversely
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
FuturesApi apiInstance = new FuturesApi();
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract
String interval = "0"; // String | Order depth. 0 means no aggregation is applied. default to 0
Integer limit = 10; // Integer | Maximum number of order depth data in asks or bids
try {
FuturesOrderBook result = apiInstance.listFuturesOrderBook(settle, contract, interval, limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesOrderBook");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract | |
| interval | String | Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to 0] [enum: 0, 0.1, 0.01] |
| limit | Integer | Maximum number of order depth data in asks or bids | [optional] [default to 10] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
List<FuturesOrder> listFuturesOrders(settle, contract, status, limit, lastId)
List futures orders
Zero-fill order cannot be retrieved 60 seconds after cancellation
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract
String status = "open"; // String | List orders based on status
Integer limit = 100; // Integer | Maximum number of record returned in one list
String lastId = "12345"; // String | Specify list staring point using the `id` of last record in previous list-query results
try {
List<FuturesOrder> result = apiInstance.listFuturesOrders(settle, contract, status, limit, lastId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesOrders");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract | |
| status | String | List orders based on status | [enum: open, finished] |
| limit | Integer | Maximum number of record returned in one list | [optional] [default to 100] |
| lastId | String | Specify list staring point using the `id` of last record in previous list-query results | [optional] |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
List<FuturesTicker> listFuturesTickers(settle, contract)
List futures tickers
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
FuturesApi apiInstance = new FuturesApi();
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract, return related data only if specified
try {
List<FuturesTicker> result = apiInstance.listFuturesTickers(settle, contract);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesTickers");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract, return related data only if specified | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
List<FuturesTrade> listFuturesTrades(settle, contract, limit, lastId, from, to)
Futures trading history
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
FuturesApi apiInstance = new FuturesApi();
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract
Integer limit = 100; // Integer | Maximum number of record returned in one list
String lastId = "12345"; // String | Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range
BigDecimal from = new BigDecimal(); // BigDecimal | 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.
BigDecimal to = new BigDecimal(); // BigDecimal | Specify end time in Unix seconds, default to current time
try {
List<FuturesTrade> result = apiInstance.listFuturesTrades(settle, contract, limit, lastId, from, to);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesTrades");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract | |
| limit | Integer | Maximum number of record returned in one list | [optional] [default to 100] |
| lastId | String | Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range | [optional] |
| from | BigDecimal | 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 | BigDecimal | Specify end time in Unix seconds, default to current time | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
List<FuturesLiquidate> listLiquidates(settle, contract, limit, at)
List liquidation history
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract, return related data only if specified
Integer limit = 100; // Integer | Maximum number of record returned in one list
Integer at = 0; // Integer | Specify a liquidation timestamp
try {
List<FuturesLiquidate> result = apiInstance.listLiquidates(settle, contract, limit, at);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listLiquidates");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract, return related data only if specified | [optional] |
| limit | Integer | Maximum number of record returned in one list | [optional] [default to 100] |
| at | Integer | Specify a liquidation timestamp | [optional] [default to 0] |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
List<PositionClose> listPositionClose(settle, contract, limit)
List position close history
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract, return related data only if specified
Integer limit = 100; // Integer | Maximum number of record returned in one list
try {
List<PositionClose> result = apiInstance.listPositionClose(settle, contract, limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listPositionClose");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract, return related data only if specified | [optional] |
| limit | Integer | Maximum number of record returned in one list | [optional] [default to 100] |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
List<Position> listPositions(settle)
List all positions of a user
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
try {
List<Position> result = apiInstance.listPositions(settle);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listPositions");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
List<FuturesPriceTriggeredOrder> listPriceTriggeredOrders(settle, status, contract, limit, offset)
List all auto orders
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
String status = "status_example"; // String | List orders based on status
String contract = "BTC_USD"; // String | Futures contract, return related data only if specified
Integer limit = 100; // Integer | Maximum number of record returned in one list
Integer offset = 0; // Integer | List offset, starting from 0
try {
List<FuturesPriceTriggeredOrder> result = apiInstance.listPriceTriggeredOrders(settle, status, contract, limit, offset);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listPriceTriggeredOrders");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| status | String | List orders based on status | [enum: open, finished] |
| contract | String | Futures contract, return related data only if specified | [optional] |
| limit | Integer | Maximum number of record returned in one list | [optional] [default to 100] |
| offset | Integer | List offset, starting from 0 | [optional] [default to 0] |
List<FuturesPriceTriggeredOrder>
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
Position updatePositionLeverage(settle, contract, leverage)
Update position leverage
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract
String leverage = "10"; // String | New position leverage
try {
Position result = apiInstance.updatePositionLeverage(settle, contract, leverage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#updatePositionLeverage");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract | |
| leverage | String | New position leverage |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
Position updatePositionMargin(settle, contract, change)
Update position margin
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract
String change = "0.01"; // String | Margin change. Use positive number to increase margin, negative number otherwise.
try {
Position result = apiInstance.updatePositionMargin(settle, contract, change);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#updatePositionMargin");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract | |
| change | String | Margin change. Use positive number to increase margin, negative number otherwise. |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
Position updatePositionRiskLimit(settle, contract, riskLimit)
Update position risk limit
import io.gate.gateapi.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
import java.io.File;
import java.util.*;
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
// uncomment the next line if testing the API with other host
// apiClient.setBasePath("https://some-other-host");
FuturesApi apiInstance = new FuturesApi(client);
String settle = "btc"; // String | Settle currency
String contract = "BTC_USD"; // String | Futures contract
String riskLimit = "10"; // String | New position risk limit
try {
Position result = apiInstance.updatePositionRiskLimit(settle, contract, riskLimit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#updatePositionRiskLimit");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [default to btc] [enum: btc, usdt] |
| contract | String | Futures contract | |
| riskLimit | String | New position risk limit |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json