For the complete documentation index, see llms.txt. This page is also available as Markdown.

Take-profit & stop-loss

Attach and manage TP/SL trigger orders.

Trigger orders close (part of) a position when the price crosses a level. Up to 5 TP + 5 SL per market + side.

At open time

Add takeProfit / stopLoss to the open-position request — they're appended as trigger orders.

On an existing position

One trigger:

curl -X POST $FLASH_API_URL/transaction-builder/place-trigger-order -d '{
  "marketSymbol": "SOL", "side": "LONG",
  "triggerPriceUi": "160.00", "sizeAmountUi": "0.5", "isStopLoss": false, "owner": "<WALLET>"
}'

isStopLoss: false = take-profit, true = stop-loss.

TP and SL atomically:

curl -X POST $FLASH_API_URL/transaction-builder/place-tp-sl -d '{
  "marketSymbol": "SOL", "side": "LONG",
  "takeProfitUi": "160.00", "stopLossUi": "140.00", "sizeAmountUi": "0.5", "owner": "<WALLET>"
}'

Edit / cancel

Check before you place

Preview the PnL of a trigger price (or solve for the price that hits a target PnL/ROI) with preview/tp-sl before committing.

→ Full fields: API reference › Trading › Trigger orders

Last updated

Was this helpful?