All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| listUniCurrencyPairs | GET /margin/uni/currency_pairs | List lending markets |
| getUniCurrencyPair | GET /margin/uni/currency_pairs/{currency_pair} | Get lending market details |
| getMarginUniEstimateRate | GET /margin/uni/estimate_rate | Estimate interest rate for isolated margin currencies |
| listUniLoans | GET /margin/uni/loans | Query loans |
| createUniLoan | POST /margin/uni/loans | Borrow or repay |
| listUniLoanRecords | GET /margin/uni/loan_records | Query loan records |
| listUniLoanInterestRecords | GET /margin/uni/interest_records | Query interest deduction records |
| getUniBorrowable | GET /margin/uni/borrowable | Query maximum borrowable amount by currency |
List<UniCurrencyPair> listUniCurrencyPairs()
List lending markets
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.MarginUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
MarginUniApi apiInstance = new MarginUniApi(defaultClient);
try {
List<UniCurrencyPair> result = apiInstance.listUniCurrencyPairs();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling MarginUniApi#listUniCurrencyPairs");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}This endpoint does not need any parameter.
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
UniCurrencyPair getUniCurrencyPair(currencyPair)
Get lending market details
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.MarginUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
MarginUniApi apiInstance = new MarginUniApi(defaultClient);
String currencyPair = "AE_USDT"; // String | Currency pair
try {
UniCurrencyPair result = apiInstance.getUniCurrencyPair(currencyPair);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling MarginUniApi#getUniCurrencyPair");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| currencyPair | String | Currency pair |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
Map<String, String> getMarginUniEstimateRate(currencies)
Estimate interest rate for isolated margin currencies
Interest rates change hourly based on lending depth, so completely accurate rates cannot be provided.
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.MarginUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginUniApi apiInstance = new MarginUniApi(defaultClient);
List<String> currencies = Arrays.asList(); // List<String> | Array of currency names to query, maximum 10
try {
Map<String, String> result = apiInstance.getMarginUniEstimateRate(currencies);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling MarginUniApi#getMarginUniEstimateRate");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| currencies | List<String> | Array of currency names to query, maximum 10 |
Map<String, String>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
List<UniLoan> listUniLoans().currencyPair(currencyPair).currency(currency).page(page).limit(limit).execute();
Query loans
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.MarginUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginUniApi apiInstance = new MarginUniApi(defaultClient);
String currencyPair = "BTC_USDT"; // String | Currency pair
String currency = "BTC"; // String | Query by specified currency name
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
try {
List<UniLoan> result = apiInstance.listUniLoans()
.currencyPair(currencyPair)
.currency(currency)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling MarginUniApi#listUniLoans");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| currencyPair | String | Currency pair | [optional] |
| currency | String | Query by specified currency name | [optional] |
| page | Integer | Page number | [optional] [default to 1] |
| limit | Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
createUniLoan(createUniLoan)
Borrow or repay
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.MarginUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginUniApi apiInstance = new MarginUniApi(defaultClient);
CreateUniLoan createUniLoan = new CreateUniLoan(); // CreateUniLoan |
try {
apiInstance.createUniLoan(createUniLoan);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling MarginUniApi#createUniLoan");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| createUniLoan | CreateUniLoan |
null (empty response body)
- Content-Type: application/json
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Operation successful | - |
List<UniLoanRecord> listUniLoanRecords().type(type).currency(currency).currencyPair(currencyPair).page(page).limit(limit).execute();
Query loan records
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.MarginUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginUniApi apiInstance = new MarginUniApi(defaultClient);
String type = "type_example"; // String | Type: `borrow` - borrow, `repay` - repay
String currency = "BTC"; // String | Query by specified currency name
String currencyPair = "BTC_USDT"; // String | Currency pair
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
try {
List<UniLoanRecord> result = apiInstance.listUniLoanRecords()
.type(type)
.currency(currency)
.currencyPair(currencyPair)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling MarginUniApi#listUniLoanRecords");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| type | String | Type: `borrow` - borrow, `repay` - repay | [optional] [enum: borrow, repay] |
| currency | String | Query by specified currency name | [optional] |
| currencyPair | String | Currency pair | [optional] |
| page | Integer | Page number | [optional] [default to 1] |
| limit | Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
List<UniLoanInterestRecord> listUniLoanInterestRecords().currencyPair(currencyPair).currency(currency).page(page).limit(limit).from(from).to(to).execute();
Query interest deduction records
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.MarginUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginUniApi apiInstance = new MarginUniApi(defaultClient);
String currencyPair = "BTC_USDT"; // String | Currency pair
String currency = "BTC"; // String | Query by specified currency name
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum number of records returned in a single list
Long from = 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)
Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
try {
List<UniLoanInterestRecord> result = apiInstance.listUniLoanInterestRecords()
.currencyPair(currencyPair)
.currency(currency)
.page(page)
.limit(limit)
.from(from)
.to(to)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling MarginUniApi#listUniLoanInterestRecords");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| currencyPair | String | Currency pair | [optional] |
| currency | String | Query by specified currency name | [optional] |
| page | Integer | Page number | [optional] [default to 1] |
| 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] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
MaxUniBorrowable getUniBorrowable(currency, currencyPair)
Query maximum borrowable amount by currency
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.MarginUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginUniApi apiInstance = new MarginUniApi(defaultClient);
String currency = "BTC"; // String | Query by specified currency name
String currencyPair = "BTC_USDT"; // String | Currency pair
try {
MaxUniBorrowable result = apiInstance.getUniBorrowable(currency, currencyPair);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling MarginUniApi#getUniBorrowable");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| currency | String | Query by specified currency name | |
| currencyPair | String | Currency pair |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |