All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| cancelFuturesOrder | DELETE /futures/orders/{order_id} | Cancel a single order |
| cancelFuturesOrders | DELETE /futures/orders | Cancel all `open` orders matched |
| cancelPriceTriggeredOrder | DELETE /futures/price_orders/{order_id} | Cancel a single order |
| cancelPriceTriggeredOrderList | DELETE /futures/price_orders | Cancel all open orders |
| createFuturesOrder | POST /futures/orders | Create a futures order |
| createPriceTriggeredOrder | POST /futures/price_orders | Create a price-triggered order |
| getFuturesContract | GET /futures/contracts/{contract} | Get a single contract |
| getFuturesOrder | GET /futures/orders/{order_id} | Get a single order |
| getMyTrades | GET /futures/my_trades | List personal trading history |
| getPosition | GET /futures/positions/{contract} | Get single position |
| getPriceTriggeredOrder | GET /futures/price_orders/{order_id} | Get a single order |
| listFuturesAccountBook | GET /futures/account_book | Query account book |
| listFuturesAccounts | GET /futures/accounts | Query futures account |
| listFuturesCandlesticks | GET /futures/candlesticks | Get futures candlesticks |
| listFuturesContracts | GET /futures/contracts | List all futures contracts |
| listFuturesFundingRateHistory | GET /futures/funding_rate | Funding rate history |
| listFuturesInsuranceLedger | GET /futures/insurance | Futures insurance balance history |
| listFuturesOrderBook | GET /futures/order_book | Futures order book |
| listFuturesOrders | GET /futures/orders | List futures orders |
| listFuturesTickers | GET /futures/tickers | List futures tickers |
| listFuturesTrades | GET /futures/trades | Futures trading history |
| listLiquidates | GET /futures/liquidates | List liquidation history |
| listPositionClose | GET /futures/position_close | List position close history |
| listPositions | GET /futures/positions | List all positions of a user |
| listPriceTriggeredOrders | GET /futures/price_orders | List all auto orders |
| updatePositionLeverage | POST /futures/positions/{contract}/leverage | Update position leverage |
| updatePositionMargin | POST /futures/positions/{contract}/margin | Update position margin |
| updatePositionRiskLimit | POST /futures/positions/{contract}/risk_limit | Update position risk limit |
FuturesOrder cancelFuturesOrder(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 orderId = "12345"; // String | ID returned on order successfully being created
try {
FuturesOrder result = apiInstance.cancelFuturesOrder(orderId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#cancelFuturesOrder");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| 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(contract, side)
Cancel all `open` orders matched
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 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(contract, side);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#cancelFuturesOrders");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| 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(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 orderId = "orderId_example"; // String | ID returned on order successfully being created
try {
FuturesPriceTriggeredOrder result = apiInstance.cancelPriceTriggeredOrder(orderId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#cancelPriceTriggeredOrder");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| 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(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 contract = "BTC_USD"; // String | Futures contract
try {
List<FuturesPriceTriggeredOrder> result = apiInstance.cancelPriceTriggeredOrderList(contract);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#cancelPriceTriggeredOrderList");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| contract | String | Futures contract |
List<FuturesPriceTriggeredOrder>
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
FuturesOrder createFuturesOrder(futuresOrder)
Create a futures 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);
FuturesOrder futuresOrder = new FuturesOrder(); // FuturesOrder |
try {
FuturesOrder result = apiInstance.createFuturesOrder(futuresOrder);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#createFuturesOrder");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| futuresOrder | FuturesOrder |
Authentication with API key and secret is required
- Content-Type: application/json
- Accept: application/json
TriggerOrderResponse createPriceTriggeredOrder(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);
FuturesPriceTriggeredOrder futuresPriceTriggeredOrder = new FuturesPriceTriggeredOrder(); // FuturesPriceTriggeredOrder |
try {
TriggerOrderResponse result = apiInstance.createPriceTriggeredOrder(futuresPriceTriggeredOrder);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#createPriceTriggeredOrder");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| futuresPriceTriggeredOrder | FuturesPriceTriggeredOrder |
Authentication with API key and secret is required
- Content-Type: application/json
- Accept: application/json
Contract getFuturesContract(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 contract = "BTC_USD"; // String | Futures contract
try {
Contract result = apiInstance.getFuturesContract(contract);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#getFuturesContract");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| contract | String | Futures contract |
No authorization required
- Content-Type: Not defined
- Accept: application/json
FuturesOrder getFuturesOrder(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 orderId = "12345"; // String | ID returned on order successfully being created
try {
FuturesOrder result = apiInstance.getFuturesOrder(orderId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#getFuturesOrder");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| 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(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 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 last record of `id` in previous list-query results
try {
List<MyFuturesTrade> result = apiInstance.getMyTrades(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 |
|---|---|---|---|
| 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 last record of `id` in previous list-query results | [optional] |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
Position getPosition(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 contract = "BTC_USD"; // String | Futures contract
try {
Position result = apiInstance.getPosition(contract);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#getPosition");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| contract | String | Futures contract |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
FuturesPriceTriggeredOrder getPriceTriggeredOrder(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 orderId = "orderId_example"; // String | ID returned on order successfully being created
try {
FuturesPriceTriggeredOrder result = apiInstance.getPriceTriggeredOrder(orderId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#getPriceTriggeredOrder");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| 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(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);
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(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 |
|---|---|---|---|
| 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()
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);
try {
FuturesAccount result = apiInstance.listFuturesAccounts();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesAccounts");
e.printStackTrace();
}This endpoint does not need any parameter.
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
List<FuturesCandlestick> listFuturesCandlesticks(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 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(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 |
|---|---|---|---|
| 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()
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();
try {
List<Contract> result = apiInstance.listFuturesContracts();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesContracts");
e.printStackTrace();
}This endpoint does not need any parameter.
No authorization required
- Content-Type: Not defined
- Accept: application/json
List<FundingRateRecord> listFuturesFundingRateHistory(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 contract = "BTC_USD"; // String | Futures contract
Integer limit = 100; // Integer | Maximum number of record returned in one list
try {
List<FundingRateRecord> result = apiInstance.listFuturesFundingRateHistory(contract, limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesFundingRateHistory");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| 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(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();
Integer limit = 100; // Integer | Maximum number of record returned in one list
try {
List<InsuranceRecord> result = apiInstance.listFuturesInsuranceLedger(limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesInsuranceLedger");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| 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(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 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(contract, interval, limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesOrderBook");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| 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(contract, status, limit, lastId)
List futures 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 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 last record of `id` in previous list-query results
try {
List<FuturesOrder> result = apiInstance.listFuturesOrders(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 |
|---|---|---|---|
| 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 last record of `id` in previous list-query results | [optional] |
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
List<FuturesTicker> listFuturesTickers(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 contract = "BTC_USD"; // String | Futures contract, return related data only if specified
try {
List<FuturesTicker> result = apiInstance.listFuturesTickers(contract);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesTickers");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| contract | String | Futures contract, return related data only if specified | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
List<FuturesTrade> listFuturesTrades(contract, limit, lastId)
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 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 last record of `id` in previous list-query results
try {
List<FuturesTrade> result = apiInstance.listFuturesTrades(contract, limit, lastId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listFuturesTrades");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| 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 last record of `id` in previous list-query results | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
List<FuturesLiquidate> listLiquidates(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 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(contract, limit, at);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listLiquidates");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| 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(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 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(contract, limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listPositionClose");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| 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()
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);
try {
List<Position> result = apiInstance.listPositions();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#listPositions");
e.printStackTrace();
}This endpoint does not need any parameter.
Authentication with API key and secret is required
- Content-Type: Not defined
- Accept: application/json
List<FuturesPriceTriggeredOrder> listPriceTriggeredOrders(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 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(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 |
|---|---|---|---|
| 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(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 contract = "BTC_USD"; // String | Futures contract
String leverage = "10"; // String | New position leverage
try {
Position result = apiInstance.updatePositionLeverage(contract, leverage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#updatePositionLeverage");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| 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(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 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(contract, change);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#updatePositionMargin");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| 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(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 contract = "BTC_USD"; // String | Futures contract
String riskLimit = "10"; // String | New position risk limit
try {
Position result = apiInstance.updatePositionRiskLimit(contract, riskLimit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FuturesApi#updatePositionRiskLimit");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| 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