Skip to main content

Get Max Contract Size

API Description

This interface allows querying the maximum available contract size (for both long and short positions) based on the specified instrument, leverage, and position mode. Optionally, users can specify the opening price.

Note: Max contract size data is only available via RESTful API.

Precautions

  1. This interface provides public market information and is not related to a user's account.

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/maxSize

Frequency Limit

The frequency limit for this interface is 8 requests/s 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
leveragetrueIntegerPosition leverage
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.
orderPricefalseBigDecimalOrder price specified by user
positionModeltrueIntegerPosition margin mode:
0: Isolated margin
1: Cross margin

Response Parameters

ParameterTypeDescription
maxBuyBigDecimalMaximum available contract size (buy)
maxSellBigDecimalMaximum available contract size (sell)

Request Example

The following Python code shows how to get the maximum available contract size of BTC.

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

params = {
"leverage" : 10,
"instrument" : "BTC",
"positionModel" : 0,
"orderPrice" : 87900
}

api_url = "/v1/perpum/orders/maxSize"
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:

{'code': 0, 'data': {'maxBuy': 36, 'maxSell': 36}, 'msg': ''}