Get Futures Account Assets
API Description
This interface allows users to query futures account asset information, including available margin, USDT balance, and frozen assets etc.
Note: Futures account assets data is available via both Resful and Websocket APIs. This page describes the RESTful API. For information on the Websocket API, please click here
Precautions
- The response parameters "availableMargin" may be misleading in the case of filled orders, as it includes "alMargin" (margin currently allocated for filled orders), rather than only the freely available margin. For further clarification, please refer to the official website.
Authentication
This is a private interface and requires authentication. For details on using the RESTful API, refer to Introduction > Authentication & Code Snippet > Futures > RESTful Private Interface.
Request Method
GET
Endpoint
/v1/perpum/account/getUserAssets
Frequency Limit
The frequency limit for this interface is 5 requests/2s per user ID and IP. In addition to this per-interface limit, a global rate limit is also enforced.
For detailed information on Global rate limits and API Rate Limiting Policy, please refer to the "Frequency Limit" section at click here
Request Parameters
This interface does not require any request paramaters.
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| availableMargin | BigDecimal | Available margin balance (including Mega Copon) |
| userId | Long | Contract account user ID |
| almightyGold | BigDecimal | Available mega coupon balance |
| availableUsdt | BigDecimal | Available USDT balance |
| alMargin | BigDecimal | Holding assets (for filled orders) |
| alFreeze | BigDecimal | Frozen assets (for unfilled orders) |
| time | Long | Timestamp when the response data was retrieved. |
Request Example
The following Python code shows how to get a user‘s futures account asset information.
Note: For a complete code example, please refer to Introduction > Authentication & Code Snippet > Futures > RESTful Private Interface.
params = { }
api_url = "/v1/perpum/account/getUserAssets"
method = "GET"
response_code, response_data = FuturesRestfulPrivate(params, api_url, method, sec_key, api_key) # the function FuturesRestfulPrivate() is defined in section (Introduction > Authentication & Code Snippet > Futures > RESTful Private Interface)
Note: For a complete Java code example, please refer to Introduction > Authentication & Code Snippet > Futures > RRESTful Private Interface.
Response Example
The following is an example response returned by the above Python request:
{'code': 0,
'data': {'alFreeze': 0,
'alMargin': 0.14311,
'almightyGold': 4.64407693,
'availableMargin': 499.71964459000003,
'availableUsdt': 495.07556766,
'time': 1742374984772,
'userId': 1162061},
'msg': ''}