All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| listCollateralLoanOrders | GET /loan/collateral/orders | Query collateral loan order list |
| createCollateralLoan | POST /loan/collateral/orders | Place collateral loan order |
| getCollateralLoanOrderDetail | GET /loan/collateral/orders/{order_id} | Query single order details |
| repayCollateralLoan | POST /loan/collateral/repay | Collateral loan repayment |
| listRepayRecords | GET /loan/collateral/repay_records | Query collateral loan repayment records |
| listCollateralRecords | GET /loan/collateral/collaterals | Query collateral adjustment records |
| operateCollateral | POST /loan/collateral/collaterals | Increase or redeem collateral |
| getUserTotalAmount | GET /loan/collateral/total_amount | Query user's total borrowing and collateral amount |
| getUserLtvInfo | GET /loan/collateral/ltv | Query user's collateralization ratio and remaining borrowable currencies |
| listCollateralCurrencies | GET /loan/collateral/currencies | Query supported borrowing and collateral currencies |
List<CollateralOrder> listCollateralLoanOrders().page(page).limit(limit).collateralCurrency(collateralCurrency).borrowCurrency(borrowCurrency).execute();
Query collateral loan order list
// 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.CollateralLoanApi;
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");
CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum number of records returned in a single list
String collateralCurrency = "BTC"; // String | Collateral currency
String borrowCurrency = "USDT"; // String | Borrowed currency
try {
List<CollateralOrder> result = apiInstance.listCollateralLoanOrders()
.page(page)
.limit(limit)
.collateralCurrency(collateralCurrency)
.borrowCurrency(borrowCurrency)
.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 CollateralLoanApi#listCollateralLoanOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| page | Integer | Page number | [optional] [default to 1] |
| limit | Integer | Maximum number of records returned in a single list | [optional] [default to 100] |
| collateralCurrency | String | Collateral currency | [optional] |
| borrowCurrency | String | Borrowed currency | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
OrderResp createCollateralLoan(createCollateralOrder)
Place collateral loan order
// 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.CollateralLoanApi;
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");
CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
CreateCollateralOrder createCollateralOrder = new CreateCollateralOrder(); // CreateCollateralOrder |
try {
OrderResp result = apiInstance.createCollateralLoan(createCollateralOrder);
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 CollateralLoanApi#createCollateralLoan");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| createCollateralOrder | CreateCollateralOrder |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Order placed successfully | - |
CollateralOrder getCollateralLoanOrderDetail(orderId)
Query single order 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.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.CollateralLoanApi;
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");
CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
Long orderId = 100001L; // Long | Order ID returned when order is successfully created
try {
CollateralOrder result = apiInstance.getCollateralLoanOrderDetail(orderId);
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 CollateralLoanApi#getCollateralLoanOrderDetail");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| orderId | Long | Order ID returned when order is successfully created |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Order details queried successfully | - |
RepayResp repayCollateralLoan(repayLoan)
Collateral loan repayment
// 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.CollateralLoanApi;
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");
CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
RepayLoan repayLoan = new RepayLoan(); // RepayLoan |
try {
RepayResp result = apiInstance.repayCollateralLoan(repayLoan);
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 CollateralLoanApi#repayCollateralLoan");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| repayLoan | RepayLoan |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Operation successful | - |
List<RepayRecord> listRepayRecords(source).borrowCurrency(borrowCurrency).collateralCurrency(collateralCurrency).page(page).limit(limit).from(from).to(to).execute();
Query collateral loan repayment 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.CollateralLoanApi;
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");
CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
String source = "repay"; // String | Operation type: repay - Regular repayment, liquidate - Liquidation
String borrowCurrency = "USDT"; // String | Borrowed currency
String collateralCurrency = "BTC"; // String | Collateral currency
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum number of records returned in a single list
Long from = 1609459200L; // Long | Start timestamp for the query
Long to = 1609459200L; // Long | End timestamp for the query, defaults to current time if not specified
try {
List<RepayRecord> result = apiInstance.listRepayRecords(source)
.borrowCurrency(borrowCurrency)
.collateralCurrency(collateralCurrency)
.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 CollateralLoanApi#listRepayRecords");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| source | String | Operation type: repay - Regular repayment, liquidate - Liquidation | |
| borrowCurrency | String | Borrowed currency | [optional] |
| collateralCurrency | String | Collateral currency | [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 for the query | [optional] |
| to | Long | End timestamp for the query, defaults to current time if not specified | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
List<CollateralRecord> listCollateralRecords().page(page).limit(limit).from(from).to(to).borrowCurrency(borrowCurrency).collateralCurrency(collateralCurrency).execute();
Query collateral adjustment 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.CollateralLoanApi;
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");
CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum number of records returned in a single list
Long from = 1609459200L; // Long | Start timestamp for the query
Long to = 1609459200L; // Long | End timestamp for the query, defaults to current time if not specified
String borrowCurrency = "USDT"; // String | Borrowed currency
String collateralCurrency = "BTC"; // String | Collateral currency
try {
List<CollateralRecord> result = apiInstance.listCollateralRecords()
.page(page)
.limit(limit)
.from(from)
.to(to)
.borrowCurrency(borrowCurrency)
.collateralCurrency(collateralCurrency)
.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 CollateralLoanApi#listCollateralRecords");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| 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 for the query | [optional] |
| to | Long | End timestamp for the query, defaults to current time if not specified | [optional] |
| borrowCurrency | String | Borrowed currency | [optional] |
| collateralCurrency | String | Collateral currency | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
operateCollateral(collateralAlign)
Increase or redeem collateral
// 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.CollateralLoanApi;
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");
CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
CollateralAlign collateralAlign = new CollateralAlign(); // CollateralAlign |
try {
apiInstance.operateCollateral(collateralAlign);
} 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 CollateralLoanApi#operateCollateral");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| collateralAlign | CollateralAlign |
null (empty response body)
- Content-Type: application/json
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Operation successful | - |
UserTotalAmount getUserTotalAmount()
Query user's total borrowing and collateral amount
// 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.CollateralLoanApi;
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");
CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
try {
UserTotalAmount result = apiInstance.getUserTotalAmount();
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 CollateralLoanApi#getUserTotalAmount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
UserLtvInfo getUserLtvInfo(collateralCurrency, borrowCurrency)
Query user's collateralization ratio and remaining borrowable currencies
// 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.CollateralLoanApi;
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");
CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
String collateralCurrency = "BTC"; // String | Collateral currency
String borrowCurrency = "USDT"; // String | Borrowed currency
try {
UserLtvInfo result = apiInstance.getUserLtvInfo(collateralCurrency, borrowCurrency);
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 CollateralLoanApi#getUserLtvInfo");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| collateralCurrency | String | Collateral currency | |
| borrowCurrency | String | Borrowed currency |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
List<CollateralLoanCurrency> listCollateralCurrencies().loanCurrency(loanCurrency).execute();
Query supported borrowing and collateral currencies
// 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.CollateralLoanApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
String loanCurrency = "BTC"; // String | Parameter loan_currency. If omitted, returns all supported borrowing currencies; if provided, returns the array of collateral currencies supported for that borrowing currency
try {
List<CollateralLoanCurrency> result = apiInstance.listCollateralCurrencies()
.loanCurrency(loanCurrency)
.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 CollateralLoanApi#listCollateralCurrencies");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| loanCurrency | String | Parameter loan_currency. If omitted, returns all supported borrowing currencies; if provided, returns the array of collateral currencies supported for that borrowing currency | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |