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 detail of lending market |
get_margin_uni_estimate_rate | GET /margin/uni/estimate_rate | Estimate interest Rate |
list_uni_loans | GET /margin/uni/loans | List loans |
create_uni_loan | POST /margin/uni/loans | Borrow or repay |
list_uni_loan_records | GET /margin/uni/loan_records | Get load records |
list_uni_loan_interest_records | GET /margin/uni/interest_records | List interest records |
get_uni_borrowable | GET /margin/uni/borrowable | Get maximum borrowable |
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 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UniCurrencyPair get_uni_currency_pair(currency_pair)
Get detail of lending market
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 detail of lending market
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 | Successfully retrieved | - |
[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
Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate.
- 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] | An array of up to 10 specifying the currency name
try:
# Estimate interest Rate
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] | An array of up to 10 specifying the currency name |
dict(str, str)
- 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[UniLoan] list_uni_loans(currency_pair=currency_pair, currency=currency, page=page, limit=limit)
List 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 | Retrieve data of the specified currency (optional)
page = 1 # int | Page number (optional) (default to 1)
limit = 100 # int | Maximum response items. Default: 100, minimum: 1, Maximum: 100 (optional) (default to 100)
try:
# List 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 | Retrieve data of the specified currency | [optional] |
page | int | Page number | [optional] [default to 1] |
limit | int | Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] |
- 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]
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 | Operated successfully | - |
[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)
Get load 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 | Retrieve data of the specified currency (optional)
currency_pair = 'BTC_USDT' # str | Currency pair (optional)
page = 1 # int | Page number (optional) (default to 1)
limit = 100 # int | Maximum response items. Default: 100, minimum: 1, Maximum: 100 (optional) (default to 100)
try:
# Get load 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 | Retrieve data of the specified currency | [optional] |
currency_pair | str | Currency pair | [optional] |
page | int | Page number | [optional] [default to 1] |
limit | int | Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] |
- 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[UniLoanInterestRecord] list_uni_loan_interest_records(currency_pair=currency_pair, currency=currency, page=page, limit=limit, _from=_from, to=to)
List interest 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 | Retrieve data of the specified currency (optional)
page = 1 # int | Page number (optional) (default to 1)
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
_from = 1547706332 # int | Start timestamp (optional)
to = 1547706332 # int | End timestamp (optional)
try:
# List interest 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 | Retrieve data of the specified currency | [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 | int | Start timestamp | [optional] |
to | int | End timestamp | [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]
MaxUniBorrowable get_uni_borrowable(currency, currency_pair)
Get maximum borrowable
- 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 | Retrieve data of the specified currency
currency_pair = 'BTC_USDT' # str | Currency pair
try:
# Get maximum borrowable
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 | Retrieve data of the specified currency | |
currency_pair | str | Currency pair |
- 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]