Add margin to trade
Deprecated
/futures/isolated/trade/add-marginPrivateDeprecated: use POST /perp/isolated/trade/add-margin instead. Move amount sats from your balance to the margin of a running trade. This lowers the trade leverage and moves its liquidation price away, decreasing risk. Returns the updated trade.
Permissions: futures:isolated:write
application/json- body
id*stringTrade ID
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$uuidamount*integerAmount of margin to add
0 < valueOK
application/json- response
A running trade
id*stringInternal trade ID
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$uuidtype*stringTrade type
"market""limit"side*stringTrade side
"buy""sell"openingFee*integerFee paid when opening the position
closingFee*integerFee for closing the position (0 while running)
maintenanceMargin*integerMinimum margin required to keep the position open
quantity*numberNumber of contracts in the trade
margin*integerCurrent margin for the position
leverage*numberLeverage multiplier applied to the position
price*numberBitcoin price when the trade was filled (in USD)
liquidation*numberPrice at which the position will be liquidated (in USD)
stoploss*numberStop loss price level (0 if not set, in USD)
takeprofit*numberTake profit price level (0 if not set, in USD)
stoplossTrailingDistance*numberTrailing stop distance as a fraction of price (0 if not trailing)
exitPrice*|Bitcoin price when exiting the position (0 while running, in USD)
pl*integerUnrealized profit and loss of the running position, valued at the Mark price
createdAt*stringTimestamp when the trade was created
date-timefilledAt*stringTimestamp when the trade was filled in the market
date-timeclosedAt*nullTimestamp when the trade was closed (null while running)
entryPrice*numberBitcoin price when entering the position (in USD)
entryMargin*integerInitial margin when entering the position
open*booleanWhether the trade is open (not yet filled)
running*booleanWhether the trade is running (filled but not closed)
canceled*booleanWhether the trade was canceled before being filled
closed*booleanWhether the trade is closed (position exited)
sumFundingFees*integerTotal funding fees accumulated for the position
sumCashInPl*integerTotal amount cashed in from PL over the trade lifetime
sumCashInMargin*integerTotal amount cashed in from margin over the trade lifetime
clientId*|Optional custom data field (max 64 characters)
import { createHttpClient } from '@ln-markets/sdk/rest/v3'
const client = createHttpClient({
key: 'your-key',
secret: 'your-secret',
passphrase: 'your-passphrase',
})
const result = await client.futures.isolated.addMargin({
id: 'd0b9f9a0-4f6e-4a5a-8b7a-7f0f5f9a8a1e',
amount: 1000
}){
"id": "d0b9f9a0-4f6e-4a5a-8b7a-7f0f5f9a8a1e",
"type": "market",
"side": "buy",
"openingFee": 10,
"closingFee": 0,
"maintenanceMargin": 1000,
"quantity": 100,
"margin": 1000,
"leverage": 10,
"price": 20000,
"liquidation": 18000,
"stoploss": 10,
"takeprofit": 10,
"stoplossTrailingDistance": 0,
"exitPrice": 0,
"pl": 2,
"createdAt": "2025-09-01T15:04:21.129Z",
"filledAt": "2025-09-01T15:04:21.129Z",
"closedAt": null,
"entryPrice": 20000,
"entryMargin": 1000,
"open": false,
"running": true,
"canceled": false,
"closed": false,
"sumFundingFees": 10,
"sumCashInPl": 0,
"sumCashInMargin": 0,
"clientId": "test-client-id-123"
}Get leaderboard GET
Deprecated: /futures is being replaced by the /perp API; this route has no /perp equivalent yet. Get the top 10 users by P&L over the last day, 7 days, 30…
Cancel all trades POST
Deprecated: use POST /perp/isolated/trades/cancel-all instead. Cancel all your open BTC/USD trades. Returns the canceled trades.