All URIs are relative to https://api.gateio.ws/api/v4
Method | HTTP request | Description |
---|---|---|
listCollateralLoanOrders | GET /loan/collateral/orders | List Orders |
createCollateralLoan | POST /loan/collateral/orders | Place order |
getCollateralLoanOrderDetail | GET /loan/collateral/orders/{order_id} | Get a single order |
repayCollateralLoan | POST /loan/collateral/repay | Repayment |
listRepayRecords | GET /loan/collateral/repay_records | Repayment history |
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 the total borrowing and collateral amount for the user |
getUserLtvInfo | GET /loan/collateral/ltv | Query user's collateralization ratio |
listCollateralCurrencies | GET /loan/collateral/currencies | Query supported borrowing and collateral currencies |
List<CollateralOrder> listCollateralLoanOrders().page(page).limit(limit).collateralCurrency(collateralCurrency).borrowCurrency(borrowCurrency).execute();
List Orders
// 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 to be returned in a single list
String collateralCurrency = "BTC"; // String | Collateral
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 to be returned in a single list | [optional] [default to 100] |
collateralCurrency | String | Collateral | [optional] |
borrowCurrency | String | Borrowed currency | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
OrderResp createCollateralLoan(createCollateralOrder)
Place 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 | Success | - |
CollateralOrder getCollateralLoanOrderDetail(orderId)
Get a single 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);
Long orderId = 100001L; // Long | Order ID returned on successful order creation
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 on successful order creation |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
RepayResp repayCollateralLoan(repayLoan)
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 | Operated successfully | - |
List<RepayRecord> listRepayRecords(source).borrowCurrency(borrowCurrency).collateralCurrency(collateralCurrency).page(page).limit(limit).from(from).to(to).execute();
Repayment history
// 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
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
Long from = 1609459200L; // Long | Start timestamp of the query
Long to = 1609459200L; // Long | Time range ending, default to current time
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 | [optional] |
page | Integer | Page number | [optional] [default to 1] |
limit | Integer | Maximum number of records to be returned in a single list | [optional] [default to 100] |
from | Long | Start timestamp of the query | [optional] |
to | Long | Time range ending, default to current time | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
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 to be returned in a single list
Long from = 1609459200L; // Long | Start timestamp of the query
Long to = 1609459200L; // Long | Time range ending, default to current time
String borrowCurrency = "USDT"; // String | Borrowed currency
String collateralCurrency = "BTC"; // String | Collateral
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 to be returned in a single list | [optional] [default to 100] |
from | Long | Start timestamp of the query | [optional] |
to | Long | Time range ending, default to current time | [optional] |
borrowCurrency | String | Borrowed currency | [optional] |
collateralCurrency | String | Collateral | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
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 | Operated successfully | - |
UserTotalAmount getUserTotalAmount()
Query the total borrowing and collateral amount for the user
// 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 | Successfully retrieved | - |
UserLtvInfo getUserLtvInfo(collateralCurrency, borrowCurrency)
Query user's collateralization ratio
// 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
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 | |
borrowCurrency | String | Borrowed currency |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
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 | The parameter loan_currency is used to specify the borrowing currency. If loan_currency is not provided, the API will return all supported borrowing currencies. If loan_currency is provided, the API will return an array of collateral currencies supported for the specified 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 | The parameter loan_currency is used to specify the borrowing currency. If loan_currency is not provided, the API will return all supported borrowing currencies. If loan_currency is provided, the API will return an array of collateral currencies supported for the specified borrowing currency. | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |