Skip to main content

Add Margin

info
  • Need authentication. Up to 5 requests per second per UID. Requires Earn permission on the API key.
  • Adds additional margin (in quoteCoin) to a leveraged position to reduce liquidation risk.
  • Orders are processed asynchronously. A successful response means the order was accepted. Use Get Order Info to track order status.
  • orderLinkId provides idempotency — submitting the same orderLinkId within 30 minutes returns the same orderId without creating a duplicate order.
  • Only one pending order is allowed per position at a time.

HTTP Request

POST/v5/earn/liquidity-mining/add-margin

Request Parameters

ParameterRequiredTypeComments
productIdtruestringProduct ID
orderLinkIdtruestringUser-customised order ID (max 36 characters). Used for idempotency
positionIdtruestringPosition ID to add margin to. Obtain from Get Position Info
amounttruestringAmount of quoteCoin to add as margin (e.g. USDT)
quoteAccountTypetruestringSource account for the margin: FUND, UNIFIED

Response Parameters

ParameterTypeComments
orderIdstringSystem-generated order ID
orderLinkIdstringUser-customised order ID

Request Example

POST /v5/earn/liquidity-mining/add-margin HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1741651200000
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json

{
"productId": "5",
"orderLinkId": "lm-add-m-01",
"positionId": "1498",
"amount": "1000",
"quoteAccountType": "FUND"
}

Response Example

{
"retCode": 0,
"retMsg": "",
"result": {
"orderId": "91720e72-86f8-4ee7-a22c-47f01a9a14e9",
"orderLinkId": "lm-add-m-01"
},
"retExtInfo": {},
"time": 1775124668762
}