replace_order
Atomically cancels an existing order and places a new one, ensuring the new order is created only if cancellation succeeds.
Instructions
Atomically cancel an existing order and create a new one. If cancel fails, the new order is not placed.
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": {
"order_id_to_cancel": "<order_id_to_cancel>",
"instrument_name": "<instrument_name>",
"direction": "<direction>",
"amount": "<amount>",
"limit_price": "<limit_price>"
},
"name": "replace_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | New order amount | |
| max_fee | No | Maximum fee | 100 |
| direction | Yes | Order direction | |
| order_type | No | limit | |
| limit_price | Yes | New limit price | |
| reduce_only | No | ||
| time_in_force | No | gtc | |
| instrument_name | Yes | Instrument name | |
| order_id_to_cancel | Yes | Order ID to cancel | |
| expected_filled_amount | No |