Amend Trade
PATCH /api/v1/trades/{tradeID}Scope: trades:write
Modify an active, paused, or pending trade. At least one field is required.
Request
{
"target_size": "3.0",
"target_spread": "0.5",
"max_slippage": "0.01",
"size_type": "base",
"spread_type": "absolute"
}| Field | Type | Description |
|---|---|---|
target_size | string | New target size — must be ≥ current filled_size |
target_spread | string | New target spread |
max_slippage | string | New hedge price tolerance per retry step (a fraction, 0 to 0.05; 0 means the 1% default). Same rules as on create. Applies to the live trade's next hedge retry. |
size_type | string | base or notional |
spread_type | string | absolute, percentage, bps, or ticks — can only be amended together with target_spread (400 otherwise) |
worst_spread | string | New aggressive-mode floor in the units of spread_type (empty = peg to the touch). Only meaningful when the trade runs quote_mode: "aggressive" |
Accepted fields are the contract
Exactly these six keys are accepted: target_size, target_spread,
max_slippage, size_type, spread_type, worst_spread. Any other key is
ignored and reported in the response's warnings[]
("unknown request fields ignored: …"). Send X-Spreadr-Strict: 1 to get a
400 with "code": "unknown_fields" and a fields list instead, before
anything is validated or persisted. Key matching is case-insensitive.
Response
200 OK
{
"status": "amendment_sent",
"trade_id": "00000000-0000-0000-0000-000000000000"
}Both the 200 and the 202 may also carry warnings (array of strings)
listing unknown request fields that were ignored; the 202 additionally has
the singular warning shown above.
The amendment is applied on the next quote cycle — no need to cancel and
recreate. If the amendment was saved but couldn't be delivered to the
running trade immediately, you'll get 202 Accepted with
"status": "amendment_persisted" and a warning; it's applied as soon as
possible.
Behavior notes
- Increasing
target_size— execution continues toward the new target. - Decreasing
target_sizebelowfilled_size— rejected with400. Cancel and start a new smaller trade instead. - Decreasing
target_sizeto exactlyfilled_size— stops further filling: the open maker order is canceled on the next quote cycle. The trade stays in its current status; cancel it when you're done with it. - Tightening
target_spread— strategy will wait for the spread to recover before posting new makers. No existing fills are unwound. - Loosening
target_spread— strategy may immediately post and fill, depending on current spread.
Amendments are blocked during system maintenance. Cancels are still
allowed during maintenance — so if you need out, use DELETE instead.
Example
curl -X PATCH https://api.spreadr.xyz/api/v1/trades/{tradeID} \
-H "X-API-Key: sprdr_..." \
-H "Content-Type: application/json" \
-d '{"target_size": "3.0"}'