set_perp_tpsl
Set, amend or cancel a take profit / stop loss on an ALREADY-OPEN perp position (non-custodial).
place_perp_order can attach TP/SL only inline on the order that OPENS a position; this adds one to a position that is already open. Currently supported on Jupiter Perps (position_id = the position pubkey, as returned by perp_positions_all); other venues are refused.
At least one of take_profit_price / stop_loss_price is required. size_pct in (0, 100] is how much of the position the trigger closes. Both are passed through exactly as given -- Crank never chooses or adjusts a trigger price or size. Returns an UNSIGNED transaction to sign; Crank never signs.
jurisdiction: geo-gated like every perps write,
including the AU block -- see place_perp_order.
idempotency_key (optional): see cancel_perp_order -- reuse the same key
across the build call and its signed_transaction completion call.
signed_transaction / verify (two-phase execution): see
place_perp_order. A TP/SL moves no position when set, so confirming the
signature landed IS the verification.
venue_action (optional, completion leg only): pass back the build
leg's extra['venue_action'] (Jupiter's create-tpsl / update-tpsl, or
None when the caller can broadcast itself) so the signed bytes are relayed
through the venue's own execute endpoint when the build needs it.
AMEND / CANCEL a resting trigger: read its request_id
off perp_positions_all (positions[].tpsl_triggers[].request_id), then call
this tool with request_id and either trigger_price (amend -- moves
the trigger to that price) or cancel=True (cancel it). position_id and
take_profit_price/stop_loss_price are not used in those modes, and mixing
them with request_id is refused. Same gates (including the AU block), same
two-phase flow -- pass the same request_id / cancel on the completion call.
Permission mode: an on-chain ACTION, not a configuration write -- it is ladder-gated like every value-bearing tool, so observe denies it (PERMISSION_MODE_BLOCKED) and propose defers it.
simulate (optional): true = rehearse this call. The full
gate stack (capability, kill switch, session signer, wallet policy,
permission mode, soft launch, venue / compliance / token checks, fee quote)
is evaluated read-only and returned as verdicts + would_execute,
with a paper fill where one applies. Nothing is built, signed, broadcast or
charged. Omitted = your wallet's default_simulate setting; false = execute.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | No | ||
| venue | No | ||
| cancel | No | ||
| verify | No | ||
| simulate | No | ||
| size_pct | No | ||
| caller_id | No | ||
| request_id | No | ||
| position_id | No | ||
| jurisdiction | No | ||
| venue_action | No | ||
| trigger_price | No | ||
| wallet_address | Yes | ||
| idempotency_key | No | ||
| stop_loss_price | No | ||
| take_profit_price | No | ||
| acknowledge_tier_b | No | ||
| signed_transaction | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||