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 detail of lending market |
getMarginUniEstimateRate | GET /margin/uni/estimate_rate | Estimate interest Rate |
listUniLoans | GET /margin/uni/loans | List loans |
createUniLoan | POST /margin/uni/loans | Borrow or repay |
listUniLoanRecords | GET /margin/uni/loan_records | Get load records |
listUniLoanInterestRecords | GET /margin/uni/interest_records | List interest records |
getUniBorrowable | GET /margin/uni/borrowable | Get maximum borrowable |
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 | Successfully retrieved | - |
UniCurrencyPair getUniCurrencyPair(currencyPair)
Get detail of lending market
// 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 | Successfully retrieved | - |
Map<String, String> getMarginUniEstimateRate(currencies)
Estimate interest Rate
Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate.
// 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> | An array of up to 10 specifying the currency name
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> | An array of up to 10 specifying the currency name |
Map<String, String>
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
List<UniLoan> listUniLoans().currencyPair(currencyPair).currency(currency).page(page).limit(limit).execute();
List 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 | Retrieve data of the specified currency
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum response items. 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 | Retrieve data of the specified currency | [optional] |
page | Integer | Page number | [optional] [default to 1] |
limit | Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
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 | Operated successfully | - |
List<UniLoanRecord> listUniLoanRecords().type(type).currency(currency).currencyPair(currencyPair).page(page).limit(limit).execute();
Get load 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 | Retrieve data of the specified currency
String currencyPair = "BTC_USDT"; // String | Currency pair
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum response items. 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 | Retrieve data of the specified currency | [optional] |
currencyPair | String | Currency pair | [optional] |
page | Integer | Page number | [optional] [default to 1] |
limit | Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
List<UniLoanInterestRecord> listUniLoanInterestRecords().currencyPair(currencyPair).currency(currency).page(page).limit(limit).execute();
List interest 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 | Retrieve data of the specified currency
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100
try {
List<UniLoanInterestRecord> result = apiInstance.listUniLoanInterestRecords()
.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#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 | Retrieve data of the specified currency | [optional] |
page | Integer | Page number | [optional] [default to 1] |
limit | Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
MaxUniBorrowable getUniBorrowable(currency, currencyPair)
Get maximum borrowable
// 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 | Retrieve data of the specified currency
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 | Retrieve data of the specified currency | |
currencyPair | String | Currency pair |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |