Skip to main content

Get Max Users's Contract Size

API Description

This interface allows users to retrieve the maximum available contract size for filled orders in their futures account. The user must specify the instrument, and the response will include the maximum contract size for both long and short positions.

Note: Max users's contract size is only available via RESTful API.

Precautions

  1. This interface does not support specifying a list of instruments.

  2. If there are no filled orders for the specified instrument, the following response will be returned:

    {'code': 0, 'msg': ''}

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/orders/availSize

Frequency Limit

The frequency limit for this interface is 10 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

ParameterMandatoryTypeDescription
instrumenttrueStringThe base currency of the instrument. (e.g., BTC or btc). This parameter is case-insensitive.
Note: For instruments that start with numbers (e.g., 1000PEPE), both uppercase and lowercase formats are valid.

Response Parameters

ParameterTypeDescription
availBuyBigDecimalMaximum number of contracts the user can close in the long direction.
availSellBigDecimalMaximum number of contracts the user can close in the short direction.

Request Example

The following Python code shows how to retrieve the maximum available contract size of "BTC" for a users's futures account.

Note: For a complete code example, please refer to Introduction > Authentication & Code Snippet > Futures > RESTful Private Interface.

params = {
"instrument" : "BTC",
}
api_url = "/v1/perpum/orders/availSize"
method = "GET"
response_code, response_data = FuturesRestfulPrivate(params, api_url, method, sec_key, api_key) # 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 > RESTful Private Interface.

Response Example

The following is an example response returned by the above Python request, showing that one contract is available (in short direction) in the users's account.

{'code': 0, 'data': {'availBuy': 0, 'availSell': 1}, 'msg': ''}