Get Position Margin Rate
API Description
This interface allows querying the margin rate applied to a position (filled order) by specifying the Position ID.
Note: Position margin rate data is only available via RESTful API.
Precautions
- The request parameter "positionId" is required when querying the margin rate for isolated margin positions. For cross margin positions, this parameter should be omitted.
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/positions/marginRate
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
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| positionId | False | Long | Position ID Note: This parameter is required when querying margin rate for isolated positions. For cross margin positions, this parameter should be omitted. |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| data | BigDecimal | Position margin rate |
Request Example
The following Python code shows how to get the position margin rate of an isolated margined position.
Note: For a complete code example, please refer to Introduction > Authentication & Code Snippet > Futures > RESTful Private Interface.
params = {
"positionId" : 2435521222631980800
}
api_url = "/v1/perpum/positions/marginRate"
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': {'value': 277.88745437}, 'msg': ''}