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 |
\GateApi\Model\UniCurrencyPair[] listUniCurrencyPairs()
List lending markets
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new GateApi\Api\MarginUniApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
try {
$result = $apiInstance->listUniCurrencyPairs();
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling MarginUniApi->listUniCurrencyPairs: ', $e->getMessage(), PHP_EOL;
}
?>This endpoint does not need any parameter.
\GateApi\Model\UniCurrencyPair[]
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\UniCurrencyPair getUniCurrencyPair($currency_pair)
Get lending market details
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new GateApi\Api\MarginUniApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$currency_pair = 'AE_USDT'; // string | Currency pair
try {
$result = $apiInstance->getUniCurrencyPair($currency_pair);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling MarginUniApi->getUniCurrencyPair: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| currency_pair | string | Currency pair |
\GateApi\Model\UniCurrencyPair
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
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.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\MarginUniApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$currencies = array('[\"BTC\",\"GT\"]'); // string[] | Array of currency names to query, maximum 10
try {
$result = $apiInstance->getMarginUniEstimateRate($currencies);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling MarginUniApi->getMarginUniEstimateRate: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| currencies | string[] | Array of currency names to query, maximum 10 |
map[string,string]
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\UniLoan[] listUniLoans($currency_pair, $currency, $page, $limit)
Query loans
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\MarginUniApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair
$associate_array['currency'] = 'BTC'; // string | Query by specified currency name
$associate_array['page'] = 1; // int | Page number
$associate_array['limit'] = 100; // int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
try {
$result = $apiInstance->listUniLoans($associate_array);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling MarginUniApi->listUniLoans: ', $e->getMessage(), PHP_EOL;
}
?>Note: the input parameter is an associative array with the keys listed as the parameter name below.
| Name | Type | Description | Notes |
|---|---|---|---|
| currency_pair | string | Currency pair | [optional] |
| currency | string | Query by specified currency name | [optional] |
| page | int | Page number | [optional] [default to 1] |
| limit | int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createUniLoan($create_uni_loan)
Borrow or repay
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\MarginUniApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$create_uni_loan = new \GateApi\Model\CreateUniLoan(); // \GateApi\Model\CreateUniLoan |
try {
$apiInstance->createUniLoan($create_uni_loan);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling MarginUniApi->createUniLoan: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| create_uni_loan | \GateApi\Model\CreateUniLoan |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\UniLoanRecord[] listUniLoanRecords($type, $currency, $currency_pair, $page, $limit)
Query loan records
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\MarginUniApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$associate_array['type'] = 'type_example'; // string | Type: `borrow` - borrow, `repay` - repay
$associate_array['currency'] = 'BTC'; // string | Query by specified currency name
$associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair
$associate_array['page'] = 1; // int | Page number
$associate_array['limit'] = 100; // int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
try {
$result = $apiInstance->listUniLoanRecords($associate_array);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling MarginUniApi->listUniLoanRecords: ', $e->getMessage(), PHP_EOL;
}
?>Note: the input parameter is an associative array with the keys listed as the parameter name below.
| Name | Type | Description | Notes |
|---|---|---|---|
| type | string | Type: `borrow` - borrow, `repay` - repay | [optional] |
| currency | string | Query by specified currency name | [optional] |
| currency_pair | string | Currency pair | [optional] |
| page | int | Page number | [optional] [default to 1] |
| limit | int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] |
\GateApi\Model\UniLoanRecord[]
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\UniLoanInterestRecord[] listUniLoanInterestRecords($currency_pair, $currency, $page, $limit, $from, $to)
Query interest deduction records
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\MarginUniApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair
$associate_array['currency'] = 'BTC'; // string | Query by specified currency name
$associate_array['page'] = 1; // int | Page number
$associate_array['limit'] = 100; // int | Maximum number of records returned in a single list
$associate_array['from'] = 1547706332; // int | 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)
$associate_array['to'] = 1547706332; // int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
try {
$result = $apiInstance->listUniLoanInterestRecords($associate_array);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling MarginUniApi->listUniLoanInterestRecords: ', $e->getMessage(), PHP_EOL;
}
?>Note: the input parameter is an associative array with the keys listed as the parameter name below.
| Name | Type | Description | Notes |
|---|---|---|---|
| currency_pair | string | Currency pair | [optional] |
| currency | string | Query by specified currency name | [optional] |
| page | int | Page number | [optional] [default to 1] |
| limit | int | Maximum number of records returned in a single list | [optional] [default to 100] |
| from | int | 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 | int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] |
\GateApi\Model\UniLoanInterestRecord[]
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\MaxUniBorrowable getUniBorrowable($currency, $currency_pair)
Query maximum borrowable amount by currency
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\MarginUniApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$currency = 'BTC'; // string | Query by specified currency name
$currency_pair = 'BTC_USDT'; // string | Currency pair
try {
$result = $apiInstance->getUniBorrowable($currency, $currency_pair);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling MarginUniApi->getUniBorrowable: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| currency | string | Query by specified currency name | |
| currency_pair | string | Currency pair |
\GateApi\Model\MaxUniBorrowable
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]