setMarginShareType to switch between them. The mode you choose affects every market deployer in your account, so ensure you have no open positions or active orders before switching — the exchange will reject the request otherwise.
- UNIFIED (0) — the default mode. Each market deployer maintains its own isolated margin pool. A loss in one MD cannot draw down margin from another.
- PORTFOLIO (1) — opt-in portfolio margin mode. Contracts that belong to the same share group draw from a single shared margin pool, enabling cross-margining. This can significantly reduce your overall margin requirements when you hold offsetting positions.
Endpoint
Request
The example below switches your account to PORTFOLIO mode. To revert to UNIFIED, setmarginShareType to 0.
Action parameters
The margin mode to apply to your account:
0— UNIFIED: each market deployer has its own isolated margin pool (default).1— PORTFOLIO: contracts within a share group share one margin pool.
0 or 1 is rejected.Response
On success, the exchange returns a governance acknowledgement. TheentityId is always 0 and serves only as a confirmation token.
int32
Always
0 on a successful setMarginShareType call. No further data is returned.Errors
If the request cannot be fulfilled, the exchange still returns HTTP 200 withstatus: "ok" — the rejection is reported inside response.data, where a server-assigned integer errorCode and a human-readable errorMessage are populated while the numeric data fields are set to 0. Common causes include:
- Open positions exist — all positions must be closed before switching modes.
- Active orders exist — all orders must be cancelled before switching modes.
- Invalid
marginShareTypevalue — only0and1are valid.
After switching to PORTFOLIO mode, use
transferMdToShareGroup or lockIntoShareGroup to fund your share groups before placing orders.