Skip to main content

Endpoint

POST /exchange

Request Body

ParameterTypeDescription
action*objectSee below
action.type*stringMust be "twapCancel"
action.twapOrderId*stringTWAP order id to cancel
nonce*numberReplay-protection nonce
expiresAfternumberOptional expiration timestamp in ms
signature*objectEIP-712 signature

Response

{
  "status": "ok",
  "response": {
    "type": "twapCancel",
    "data": {
      "status": "canceled",
      "twapOrderId": "0x1a2b3c..."
    }
  }
}

Response Fields

FieldTypeDescription
response.data.status"canceled" | "failed"canceled means the cancel request was committed
response.data.twapOrderIdstring | undefinedTWAP id associated with the cancel result
response.data.errorstring | undefinedFailure reason when the cancel request is rejected after parsing

Example Request

curl -X POST https://api.notional.xyz/exchange \
  -H "Content-Type: application/json" \
  -d '{
    "action": {
      "type": "twapCancel",
      "twapOrderId": "0x1a2b3c4d5e6f7890..."
    },
    "nonce": 1701234567890,
    "signature": {
      "r": "0x1234...",
      "s": "0x5678...",
      "v": 27
    }
  }'

Notes

  • Only TWAPs in pending or active status are cancelable. - Ownership is enforced: the authenticated signer must resolve to the TWAP owner. - A successful cancel returns status: "canceled" immediately; subsequent reads show the TWAP as terminal with canceledAt populated.