Skip to main content
DELETE
DELETE /limit-order/{id} cancels a pending order: its status becomes cancelled and deletedAt records the time of the call. The order isn’t removed: it stays readable with GET /limit-order/{id} and stays in GET /limit-order. Cancelling doesn’t change the maker’s token allowance, so lower it yourself if no other order needs it.

Cancel pending orders only

Read the order with GET /limit-order/{id} first, and cancel it only while its status is pending. At executing or submitted, Olympex is already executing the order. Olympex cancels only a pending order. On any other status, including an order you already cancelled, DELETE returns 409 CONFLICT and changes nothing. DELETE is still safe to repeat after a timeout: if the repeat returns 409, read the order with GET /limit-order/{id}, and if it’s cancelled, the first call went through.

Lower the allowance

Cancelling changes the order’s record, not the wallet. The pair signature stays valid after you cancel, and the same signature serves every limit order and DCA strategy for that maker and pair. The maker’s allowance to the Olympex order contract is the on-chain limit on what the contract can move, so lower it as soon as you cancel.
  • If no other open limit order or active DCA strategy sells the same token on the same chain, set the allowance to 0.
  • Otherwise, lower it to what those orders and strategies still need, as How much to approve explains.
  • Setting the allowance to 0 stops every limit order and DCA strategy that sells that token on that chain, not only this one.
With ethers v6, setting the maker’s WETH allowance on Polygon to 0 looks like this:
Some tokens, USDT for example, need the allowance set to 0 before a new non-zero value. To lower the allowance to another non-zero value, use setOrderAllowance from Set the allowance, which resets it to 0 first.

Authorizations

x-api-key-id
string
header
required

Your API key ID (UUID). See Sign requests.

x-value-info
string
header
required

Base64 of timestamp + "\n" + nonce + "\n" + bodyHash, where timestamp is Unix seconds, nonce is 24 new hexadecimal characters and bodyHash is the unpadded base64url SHA-256 of the canonical body.

x-passphrase
string
header
required

Your account passphrase. Treat it like the secret key.

x-signature
string
header
required

Lowercase hex HMAC-SHA256 (signature v2), keyed with your secret key string (UTF-8, not decoded), of seven lines joined with \n, with no trailing newline: OLPX-HMAC-SHA256-V2, timestamp, nonce, the uppercase method, path, canonicalQuery and bodyHash. path is the request path including /api/v1, without the query string, for example /api/v1/limit-order/<id>. canonicalQuery is the query parameters decoded (+ is a space), sorted by key and then by value, re-encoded per RFC 3986 and joined with &, or the empty string when there is no query. Headers signed for one request are rejected on any other. See Sign requests.

Path Parameters

id
string
required

Limit order ID, as returned when it was created.

Response

The cancelled order.

success
enum<boolean>
required
Available options:
true
data
object
required

A limit order. Olympex can add fields; ignore the ones you don't use.

meta
object
required