All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| list_uni_currency_pairs | GET /margin/uni/currency_pairs | List lending markets |
| get_uni_currency_pair | GET /margin/uni/currency_pairs/{currency_pair} | Get lending market details |
| get_margin_uni_estimate_rate | GET /margin/uni/estimate_rate | Estimate interest rate for isolated margin currencies |
| list_uni_loans | GET /margin/uni/loans | Query loans |
| create_uni_loan | POST /margin/uni/loans | Borrow or repay |
| list_uni_loan_records | GET /margin/uni/loan_records | Query loan records |
| list_uni_loan_interest_records | GET /margin/uni/interest_records | Query interest deduction records |
| get_uni_borrowable | GET /margin/uni/borrowable | Query maximum borrowable amount by currency |
list[UniCurrencyPair] list_uni_currency_pairs()
List lending markets
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.MarginUniApi(api_client)
try:
# List lending markets
api_response = api_instance.list_uni_currency_pairs()
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginUniApi->list_uni_currency_pairs: %s\n" % e)This endpoint does not need any parameter.
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UniCurrencyPair get_uni_currency_pair(currency_pair)
Get lending market details
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.MarginUniApi(api_client)
currency_pair = 'AE_USDT' # str | Currency pair
try:
# Get lending market details
api_response = api_instance.get_uni_currency_pair(currency_pair)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginUniApi->get_uni_currency_pair: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| currency_pair | str | Currency pair |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
dict(str, str) get_margin_uni_estimate_rate(currencies)
Estimate interest rate for isolated margin currencies
Interest rates change hourly based on lending depth, so completely accurate rates cannot be provided.
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.MarginUniApi(api_client)
currencies = ['[\"BTC\",\"GT\"]'] # list[str] | Array of currency names to query, maximum 10
try:
# Estimate interest rate for isolated margin currencies
api_response = api_instance.get_margin_uni_estimate_rate(currencies)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginUniApi->get_margin_uni_estimate_rate: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| currencies | list[str] | Array of currency names to query, maximum 10 |
dict(str, str)
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[UniLoan] list_uni_loans(currency_pair=currency_pair, currency=currency, page=page, limit=limit)
Query loans
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.MarginUniApi(api_client)
currency_pair = 'BTC_USDT' # str | Currency pair (optional)
currency = 'BTC' # str | Query by specified currency name (optional)
page = 1 # int | Page number (optional) (default to 1)
limit = 100 # int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100)
try:
# Query loans
api_response = api_instance.list_uni_loans(currency_pair=currency_pair, currency=currency, page=page, limit=limit)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginUniApi->list_uni_loans: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| currency_pair | str | Currency pair | [optional] |
| currency | str | 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
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
create_uni_loan(create_uni_loan)
Borrow or repay
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.MarginUniApi(api_client)
create_uni_loan = gate_api.CreateUniLoan() # CreateUniLoan |
try:
# Borrow or repay
api_instance.create_uni_loan(create_uni_loan)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginUniApi->create_uni_loan: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| create_uni_loan | CreateUniLoan |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Operation successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[UniLoanRecord] list_uni_loan_records(type=type, currency=currency, currency_pair=currency_pair, page=page, limit=limit)
Query loan records
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.MarginUniApi(api_client)
type = 'type_example' # str | Type: `borrow` - borrow, `repay` - repay (optional)
currency = 'BTC' # str | Query by specified currency name (optional)
currency_pair = 'BTC_USDT' # str | Currency pair (optional)
page = 1 # int | Page number (optional) (default to 1)
limit = 100 # int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100)
try:
# Query loan records
api_response = api_instance.list_uni_loan_records(type=type, currency=currency, currency_pair=currency_pair, page=page, limit=limit)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginUniApi->list_uni_loan_records: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| type | str | Type: `borrow` - borrow, `repay` - repay | [optional] |
| currency | str | Query by specified currency name | [optional] |
| currency_pair | str | 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] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[UniLoanInterestRecord] list_uni_loan_interest_records(currency_pair=currency_pair, currency=currency, page=page, limit=limit, _from=_from, to=to)
Query interest deduction records
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.MarginUniApi(api_client)
currency_pair = 'BTC_USDT' # str | Currency pair (optional)
currency = 'BTC' # str | Query by specified currency name (optional)
page = 1 # int | Page number (optional) (default to 1)
limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100)
_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) (optional)
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 (optional)
try:
# Query interest deduction records
api_response = api_instance.list_uni_loan_interest_records(currency_pair=currency_pair, currency=currency, page=page, limit=limit, _from=_from, to=to)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginUniApi->list_uni_loan_interest_records: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| currency_pair | str | Currency pair | [optional] |
| currency | str | 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] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MaxUniBorrowable get_uni_borrowable(currency, currency_pair)
Query maximum borrowable amount by currency
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.MarginUniApi(api_client)
currency = 'BTC' # str | Query by specified currency name
currency_pair = 'BTC_USDT' # str | Currency pair
try:
# Query maximum borrowable amount by currency
api_response = api_instance.get_uni_borrowable(currency, currency_pair)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginUniApi->get_uni_borrowable: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| currency | str | Query by specified currency name | |
| currency_pair | str | Currency pair |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]