Skip to main content

Get Margin Mode

API Description

This interface allows querying the position margin mode (Isolated or Cross Margin) and the position layout (Merged or Split Positions), enabling users to manage their trading strategy effectively.

Note: Margin mode 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

None

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

Frequency Limit

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

This interface does not require any request paramaters.

Response parameters

ParameterMandatoryParameter TypeDescription
layouttrueStringPosition layout:
0: Merged positions (positions in same direction will be merged)
1: Split positions (positions in same direction will remain separate)
positionModeltrueIntegerPosition margin mode:
0: Isolated margin
1: Cross margin

Request Example

The following Python code shows how to check the position layout and position margin mode.

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

params = { }

api_url = "/v1/perpum/positions/type"

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': {'layout': 0, 'positionModel': 0}, 'msg': ''}