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
- 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
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
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| leverage | true | Integer | Position leverage |
| instrument | true | String | The 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. |
| orderPrice | false | BigDecimal | Order price specified by user |
| positionModel | true | Integer | Position margin mode: 0: Isolated margin 1: Cross margin |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| maxBuy | BigDecimal | Maximum available contract size (buy) |
| maxSell | BigDecimal | Maximum 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': ''}