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 (int? page = null, int? limit = null, string collateralCurrency = null, string borrowCurrency = null)
List Orders
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class ListCollateralLoanOrdersExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new CollateralLoanApi(config);
var page = 1; // int? | Page number (optional) (default to 1)
var limit = 100; // int? | Maximum number of records to be returned in a single list (optional) (default to 100)
var collateralCurrency = "BTC"; // string | Collateral (optional)
var borrowCurrency = "USDT"; // string | Borrowed currency (optional)
try
{
// List Orders
List<CollateralOrder> result = apiInstance.ListCollateralLoanOrders(page, limit, collateralCurrency, borrowCurrency);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling CollateralLoanApi.ListCollateralLoanOrders: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
page | int? | Page number | [optional] [default to 1] |
limit | int? | 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 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OrderResp CreateCollateralLoan (CreateCollateralOrder createCollateralOrder)
Place order
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class CreateCollateralLoanExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new CollateralLoanApi(config);
var createCollateralOrder = new CreateCollateralOrder(); // CreateCollateralOrder |
try
{
// Place order
OrderResp result = apiInstance.CreateCollateralLoan(createCollateralOrder);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling CollateralLoanApi.CreateCollateralLoan: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
createCollateralOrder | CreateCollateralOrder |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CollateralOrder GetCollateralLoanOrderDetail (long orderId)
Get a single order
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class GetCollateralLoanOrderDetailExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new CollateralLoanApi(config);
var orderId = 100001; // long | Order ID returned on successful order creation
try
{
// Get a single order
CollateralOrder result = apiInstance.GetCollateralLoanOrderDetail(orderId);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling CollateralLoanApi.GetCollateralLoanOrderDetail: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
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 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RepayResp RepayCollateralLoan (RepayLoan repayLoan)
Repayment
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class RepayCollateralLoanExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new CollateralLoanApi(config);
var repayLoan = new RepayLoan(); // RepayLoan |
try
{
// Repayment
RepayResp result = apiInstance.RepayCollateralLoan(repayLoan);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling CollateralLoanApi.RepayCollateralLoan: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
repayLoan | RepayLoan |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Operated successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<RepayRecord> ListRepayRecords (string source, string borrowCurrency = null, string collateralCurrency = null, int? page = null, int? limit = null, long? from = null, long? to = null)
Repayment history
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class ListRepayRecordsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new CollateralLoanApi(config);
var source = "repay"; // string | Operation type: repay - Regular repayment, liquidate - Liquidation
var borrowCurrency = "USDT"; // string | Borrowed currency (optional)
var collateralCurrency = "BTC"; // string | Collateral (optional)
var page = 1; // int? | Page number (optional) (default to 1)
var limit = 100; // int? | Maximum number of records to be returned in a single list (optional) (default to 100)
var from = 1609459200; // long? | Start timestamp of the query (optional)
var to = 1609459200; // long? | Time range ending, default to current time (optional)
try
{
// Repayment history
List<RepayRecord> result = apiInstance.ListRepayRecords(source, borrowCurrency, collateralCurrency, page, limit, from, to);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling CollateralLoanApi.ListRepayRecords: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
source | string | Operation type: repay - Regular repayment, liquidate - Liquidation | |
borrowCurrency | string | Borrowed currency | [optional] |
collateralCurrency | string | Collateral | [optional] |
page | int? | Page number | [optional] [default to 1] |
limit | int? | 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 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<CollateralRecord> ListCollateralRecords (int? page = null, int? limit = null, long? from = null, long? to = null, string borrowCurrency = null, string collateralCurrency = null)
Query collateral adjustment records
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class ListCollateralRecordsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new CollateralLoanApi(config);
var page = 1; // int? | Page number (optional) (default to 1)
var limit = 100; // int? | Maximum number of records to be returned in a single list (optional) (default to 100)
var from = 1609459200; // long? | Start timestamp of the query (optional)
var to = 1609459200; // long? | Time range ending, default to current time (optional)
var borrowCurrency = "USDT"; // string | Borrowed currency (optional)
var collateralCurrency = "BTC"; // string | Collateral (optional)
try
{
// Query collateral adjustment records
List<CollateralRecord> result = apiInstance.ListCollateralRecords(page, limit, from, to, borrowCurrency, collateralCurrency);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling CollateralLoanApi.ListCollateralRecords: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
page | int? | Page number | [optional] [default to 1] |
limit | int? | 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 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void OperateCollateral (CollateralAlign collateralAlign)
Increase or redeem collateral
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class OperateCollateralExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new CollateralLoanApi(config);
var collateralAlign = new CollateralAlign(); // CollateralAlign |
try
{
// Increase or redeem collateral
apiInstance.OperateCollateral(collateralAlign);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling CollateralLoanApi.OperateCollateral: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
collateralAlign | CollateralAlign |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | Operated successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserTotalAmount GetUserTotalAmount ()
Query the total borrowing and collateral amount for the user
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class GetUserTotalAmountExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new CollateralLoanApi(config);
try
{
// Query the total borrowing and collateral amount for the user
UserTotalAmount result = apiInstance.GetUserTotalAmount();
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling CollateralLoanApi.GetUserTotalAmount: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserLtvInfo GetUserLtvInfo (string collateralCurrency, string borrowCurrency)
Query user's collateralization ratio
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class GetUserLtvInfoExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new CollateralLoanApi(config);
var collateralCurrency = "BTC"; // string | Collateral
var borrowCurrency = "USDT"; // string | Borrowed currency
try
{
// Query user's collateralization ratio
UserLtvInfo result = apiInstance.GetUserLtvInfo(collateralCurrency, borrowCurrency);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling CollateralLoanApi.GetUserLtvInfo: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
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 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<CollateralLoanCurrency> ListCollateralCurrencies (string loanCurrency = null)
Query supported borrowing and collateral currencies
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class ListCollateralCurrenciesExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
var apiInstance = new CollateralLoanApi(config);
var 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. (optional)
try
{
// Query supported borrowing and collateral currencies
List<CollateralLoanCurrency> result = apiInstance.ListCollateralCurrencies(loanCurrency);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling CollateralLoanApi.ListCollateralCurrencies: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
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 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]