twapCancel
Cancels a running TWAP order before its duration ends. The action is signed by an approved agent.
twapCancelStop a running TWAP before its duration ends.Agent-signed
Perp instrument's external id — the same `a` the TWAP was placed with.
TWAP id, as a decimal string — the `twapId` returned by `twapOrder`.
Must be `twapCancel`.
"twapCancel"curl -X POST https://rpc.txflow-testnet.xyz/exchange \
-H "Content-Type: application/json" \
-H "x-api-version: 2026-08-16" \
-d '{
"action": {
"type": "twapCancel",
"a": 1,
"t": "8642097531"
},
"signature": {
"r": "0x<r>",
"s": "0x<s>",
"v": 27
},
"nonce": 1757992743994,
"vaultAddress": null,
"signatureChainId": null
}'`0` on success.
The action's internal name, which does not always match the request `type`.
"twapCancel"A rejected request returns `err` with a non-zero `code` and the reason in `message` (or `response`).
"ok"{
"status": "ok",
"code": 0,
"data": {
"type": "twapCancel",
"data": {
"status": "success"
}
}
}a is the instrument the TWAP was placed on, and t is the twapId returned by twapOrder. The running TWAPs and their ids are in twapStates.
Signing
Sign t as a string, exactly as sent, and keep the key order a, t. Send the envelope vaultAddress as null. See Signing.
Next steps
On success the response carries data.data.status: "success". The cancelled TWAP then appears in twapHistory and on userTwapHistory.