Add Or Reduce Margin
Manually add or reduce margin for isolated margin position
Normal account covers: USDT perpetual / Inverse contract
HTTP Request
POST /cloud/trade/v3/position/add-margin
Request Parameters
| Parameter | Required | Type | Comments |
|---|---|---|---|
| category | true | string | Product type
|
| symbol | true | string | Symbol name |
| margin | true | string | Add or reduce. To add, then 10; To reduce, then -10. Support up to 4 decimal |
| positionIdx | false | integer | Used to identify positions in different position modes. For hedge mode position, this param is required
|
Response Parameters
| Parameter | Type | Comments |
|---|---|---|
| category | string | Product type |
| symbol | string | Symbol name |
| positionIdx | integer | Position idx, used to identify positions in different position modes
|
| riskId | integer | Risk limit ID |
| riskLimitValue | string | Risk limit value |
| size | string | Position size |
| avgPrice | string | Average entry price |
| liqPrice | string | Liquidation price |
| bustPrice | string | Bankruptcy price |
| markPrice | string | Last mark price |
| positionValue | string | Position value |
| leverage | string | Position leverage |
| autoAddMargin | integer | Whether to add margin automatically. 0: false, 1: true |
| positionStatus | String | Position status. Normal, Liq, Adl |
| positionIM | string | Initial margin |
| positionMM | string | Maintenance margin |
| takeProfit | string | Take profit price |
| stopLoss | string | Stop loss price |
| trailingStop | string | Trailing stop (The distance from market price) |
| unrealisedPnl | string | Unrealised PnL |
| cumRealisedPnl | string | Cumulative realised pnl |
| createdTime | string | Position created timestamp (ms) |
| updatedTime | string | Position updated timestamp (ms) |
Request Example
POST /cloud/trade/v3/position/add-margin HTTP/1.1
Host: openapi-testnet.zoomex.com
X-BAPI-SIGN: XXXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1684234363665
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json
Content-Length: 97
{
"category": "inverse",
"symbol": "ETHUSD",
"margin": "0.01",
"positionIdx": 0
}
Response Example
{
"retCode": 0,
"retMsg": "OK",
"result": {
"category": "inverse",
"symbol": "ETHUSD",
"positionIdx": 0,
"riskId": 11,
"riskLimitValue": "500",
"size": "200",
"positionValue": "0.11033265",
"avgPrice": "1812.70004844",
"liqPrice": "1550.80",
"bustPrice": "1544.20",
"markPrice": "1812.90",
"leverage": "12",
"autoAddMargin": 0,
"positionStatus": "Normal",
"positionIM": "0.01926611",
"positionMM": "0",
"unrealisedPnl": "0.00001217",
"cumRealisedPnl": "-0.04618929",
"stopLoss": "0.00",
"takeProfit": "0.00",
"trailingStop": "0.00",
"createdTime": "1672737740039",
"updatedTime": "1684234363788"
},
"retExtInfo": {},
"time": 1684234363789
}