Skip to main content

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

  1. 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

ParameterTypeDescription
availableMarginBigDecimalAvailable margin balance (including Mega Copon)
userIdLongContract account user ID
almightyGoldBigDecimalAvailable mega coupon balance
availableUsdtBigDecimalAvailable USDT balance
alMarginBigDecimalHolding assets (for filled orders)
alFreezeBigDecimalFrozen assets (for unfilled orders)
timeLongTimestamp 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': ''}