Perp Isolated

Place trade

POST/perp/isolated/tradePrivate

Place a new isolated trade on a perpetual market. Returns the trade: running for a market order, open for a limit order until it fills.

  • Limit order: type="limit" and price must be included
  • Market order: type="market" and price must be omitted
  • Quantity or margin: send quantity, or margin to size the trade from it. With margin, the quantity is rounded down to the market's quantity step and the trade locks the margin of that quantity at leverage, which can be less than margin
  • The margin, the maintenance margin and, for a market order, the opening fee are taken from your balance
  • A clientId already used fails with CONFLICT and no trade is placed
  • An unknown market, one you have no access to or one without isolated margin fails with NOT_FOUND; while isolated trading is disabled, with FORBIDDEN

Permissions: futures:isolated:write

Request Body

application/json
  1. body
leverage*number

Leverage of the trade

stoploss?

Stop loss, omit for none

takeprofit?number

Take profit price level

Range0 <= value
side*string

Trade side: buy (long) or sell (short)

Value in"buy""sell"
clientId?string

Optional custom data field (max 64 characters). Unique across all your isolated trades and markets, never reusable

Lengthlength <= 64
label?string

Optional free label (max 64 characters) to group or tag trades, e.g. by strategy. Not unique.

Length1 <= length <= 64
instrument*string

Instrument of the market

Value in"inverse_perp""quanto_perp"
pair*string

Pair of the market

type*"limit"

Limit order

Value in"limit"
price*number

Must be specified for limit trades

Range0 < value
quantity*number

Quantity of the trade

Range0 < value
margin?unknown

If using quantity, margin should not be specified

Response Body

OK

application/json
  1. response
id*string

Internal trade ID

Match^([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)$
Formatuuid
instrument*string

Instrument of the market

Value in"inverse_perp""quanto_perp"
pair*string

Pair of the market

type*"limit"

Open trades are always limit orders

Value in"limit"
side*string

Trade side

Value in"buy""sell"
openingFee*integer

Fee to be paid when opening the position

closingFee*integer

Fee for closing (0 until position is opened)

maintenanceMargin*integer

Maintenance margin (0 until position is opened)

quantity*number

Number of contracts to trade

entryNotionalUsd*number

Notional value at entry (in USD)

exitNotionalUsd*|

Notional value at exit (in USD), null until the trade is closed

margin*integer

Margin reserved for the order

leverage*number

Leverage multiplier for the position

price*number

Limit price at which to enter the position (in USD)

liquidation*number

Calculated liquidation price for the position (in USD)

stoploss*number

Stop loss price level (0 if not set, in USD)

takeprofit*number

Take profit price level (0 if not set, in USD)

stoplossTrailingDistance*number

Trailing stop distance as a fraction of price (0 if not trailing)

exitPrice*|

Exit price (0 until position is closed, in USD)

pl*integer

Profit and loss (0 until position is opened)

createdAt*string

Timestamp when the order was created

Formatdate-time
filledAt*null

Timestamp when filled (null while order is open)

closedAt*null

Timestamp when closed (null while order is open)

entryPrice*number

Intended entry price for the position (in USD)

entryMargin*integer

Initial margin reserved for the order

entryBtcPrice*number

Bitcoin price the sats amounts of the trade are valued at (in USD)

open*boolean

Whether the trade is open (waiting to be filled)

running*boolean

Whether the trade is running (false until filled)

canceled*boolean

Whether the trade was canceled

closed*boolean

Whether the trade is closed

sumFundingFees*integer

Funding fees (0 until position is opened)

sumQuantoAdjustmentFees*integer

Total quanto adjustment fees accumulated for the position

sumCashInPl*integer

Total amount cashed in from PL over the trade lifetime

sumCashInMargin*integer

Total amount cashed in from margin over the trade lifetime

clientId*|

Optional custom data field (max 64 characters)

label*|

Optional free label (max 64 characters) to group or tag trades, e.g. by strategy. Not unique.

Defaultnull
import { createHttpClient } from '@ln-markets/sdk/rest/v3'

const client = createHttpClient({
  key: 'your-key',
  secret: 'your-secret',
  passphrase: 'your-passphrase',
})

const result = await client.perp.isolated.newTrade({
  leverage: 10,
  side: 'buy',
  instrument: 'inverse_perp',
  pair: 'btc_usd',
  type: 'limit',
  price: 69420,
  quantity: 10
})
{
  "id": "d0b9f9a0-4f6e-4a5a-8b7a-7f0f5f9a8a1e",
  "instrument": "inverse_perp",
  "pair": "btc_usd",
  "type": "limit",
  "side": "buy",
  "openingFee": 10,
  "closingFee": 0,
  "maintenanceMargin": 0,
  "quantity": 100,
  "entryNotionalUsd": 100,
  "exitNotionalUsd": null,
  "margin": 1000,
  "leverage": 10,
  "price": 20000,
  "liquidation": 18000,
  "stoploss": 10,
  "takeprofit": 10,
  "stoplossTrailingDistance": 0,
  "exitPrice": 0,
  "pl": 0,
  "createdAt": "2025-09-01T15:04:21.129Z",
  "filledAt": null,
  "closedAt": null,
  "entryPrice": 20000,
  "entryMargin": 1000,
  "entryBtcPrice": 100000,
  "open": true,
  "running": false,
  "canceled": false,
  "closed": false,
  "sumFundingFees": 0,
  "sumQuantoAdjustmentFees": 0,
  "sumCashInPl": 0,
  "sumCashInMargin": 0,
  "clientId": "test-client-id-123",
  "label": "strategy-a"
}