perp_modify
Modify an existing open Drift ORDER by order_id (non-custodial).
Adjusts trigger price (TP/SL). new_leverage / add_collateral require a separate collateral deposit/withdraw and are recorded for tracking. Returns an UNSIGNED base64 tx to sign + broadcast. Past the daily free tier an x402 payment_header is required.
jurisdiction: modify (changes leverage/
exposure) is geo-gated too -- see perp_open_long.
idempotency_key (optional): a client-generated UUID.
Retrying with the same key + same args replays the original result instead
of re-modifying the order.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"wallet_address": "<wallet_address>",
"order_id": "<order_id>"
},
"name": "perp_modify"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | No | ||
| new_sl | No | ||
| new_tp | No | ||
| order_id | Yes | ||
| caller_id | No | ||
| jurisdiction | No | ||
| new_leverage | No | ||
| pay_in_crank | No | ||
| add_collateral | No | ||
| payment_header | No | ||
| wallet_address | Yes | ||
| idempotency_key | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||