capabilities.work

Add a Take-Profit to a Position

A 3-step recipe with Backpack. We can help you get access.

Recipe · 3 steps

Add a Take-Profit to a Position

Place a reduce-only take-profit order against an open futures position.

  1. Read the account's open positions to confirm there is a position on the target symbol to protect.
  2. Read the current mark price for the symbol so the take-profit target can be sanity-checked against the mark.
  3. Submit a reduce-only limit order on the closing side at the take-profit price so the position closes when price reaches the target.
What you'll need to have ready
  • symbol: The futures market symbol (e.g. SOL_USDC_PERP).
  • closeSide: The side that reduces the position (Ask to close a long, Bid to close a short).
  • takeProfitPrice: The limit price at which to take profit, as a decimal string.
  • quantity: The quantity of the position to close, as a decimal string.
  • apiKey: Base64 encoded ED25519 verifying key for the X-API-KEY header.
  • signature: Base64 encoded ED25519 signature for the X-SIGNATURE header.
  • timestamp: Unix time in milliseconds for the X-TIMESTAMP header.
  • window: Request validity window in milliseconds for the X-WINDOW header (default 5000).
For your developer

Arazzo workflow backpack:position-take-profit, 3 operations: get_positions → get_mark_prices → execute_order. Specs on APIs.io.