Place trade
/perp/isolated/tradePrivatePlace 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"andpricemust be included - Market order:
type="market"andpricemust be omitted - Quantity or margin: send
quantity, ormarginto size the trade from it. Withmargin, the quantity is rounded down to the market's quantity step and the trade locks the margin of that quantity atleverage, which can be less thanmargin - The margin, the maintenance margin and, for a market order, the opening fee are taken from your balance
- A
clientIdalready used fails withCONFLICTand 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, withFORBIDDEN
Permissions: futures:isolated:write
application/json- body
leverage*numberLeverage of the trade
stoploss?Stop loss, omit for none
takeprofit?numberTake profit price level
0 <= valueside*stringTrade side: buy (long) or sell (short)
"buy""sell"clientId?stringOptional custom data field (max 64 characters). Unique across all your isolated trades and markets, never reusable
length <= 64label?stringOptional free label (max 64 characters) to group or tag trades, e.g. by strategy. Not unique.
1 <= length <= 64instrument*stringInstrument of the market
"inverse_perp""quanto_perp"pair*stringPair of the market
type*"limit"Limit order
"limit"price*numberMust be specified for limit trades
0 < valuequantity*numberQuantity of the trade
0 < valuemargin?unknownIf using quantity, margin should not be specified
OK
application/json- response
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)$uuidinstrument*stringInstrument of the market
"inverse_perp""quanto_perp"pair*stringPair of the market
type*"limit"Open trades are always limit orders
"limit"side*stringTrade side
"buy""sell"openingFee*integerFee to be paid when opening the position
closingFee*integerFee for closing (0 until position is opened)
maintenanceMargin*integerMaintenance margin (0 until position is opened)
quantity*numberNumber of contracts to trade
entryNotionalUsd*numberNotional value at entry (in USD)
exitNotionalUsd*|Notional value at exit (in USD), null until the trade is closed
margin*integerMargin reserved for the order
leverage*numberLeverage multiplier for the position
price*numberLimit price at which to enter the position (in USD)
liquidation*numberCalculated liquidation price for the position (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*|Exit price (0 until position is closed, in USD)
pl*integerProfit and loss (0 until position is opened)
createdAt*stringTimestamp when the order was created
date-timefilledAt*nullTimestamp when filled (null while order is open)
closedAt*nullTimestamp when closed (null while order is open)
entryPrice*numberIntended entry price for the position (in USD)
entryMargin*integerInitial margin reserved for the order
entryBtcPrice*numberBitcoin price the sats amounts of the trade are valued at (in USD)
open*booleanWhether the trade is open (waiting to be filled)
running*booleanWhether the trade is running (false until filled)
canceled*booleanWhether the trade was canceled
closed*booleanWhether the trade is closed
sumFundingFees*integerFunding fees (0 until position is opened)
sumQuantoAdjustmentFees*integerTotal quanto adjustment 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)
label*|Optional free label (max 64 characters) to group or tag trades, e.g. by strategy. Not unique.
nullimport { 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"
}Get trade GET
Get one of your trades in any state, of any perpetual market, by its id or its clientId (pass exactly one). A running trade pl is the unrealized P&L…
Get open trades GET
Get your open trades (limit orders not filled yet), newest first: of every perpetual market, or of one market when instrument and pair are both passed.