Skip to main content
PATCH
PATCH /limit-order/{id} changes the limit price, amount, expiry, slippage or gas price of a pending order and returns the updated order. Send only the fields you change. The maker doesn’t sign again: the pair signature covers the maker and the two tokens, not these fields.

Fields you can change

To change the tokens, the chain or the maker, cancel the order and create a new one. Fields that Olympex sets, such as status, txHash and reasonFail, return 400 VALIDATION_ERROR. Responses return amount, price and priceTrigger as JSON numbers.

Update pending orders only

Read the order with GET /limit-order/{id} first, and update it only while its status is pending. At executing or submitted, Olympex is already executing the order. Olympex applies the update only while the order is pending. Otherwise, including when execution starts between your read and the update, the call returns 409 CONFLICT and changes nothing: read the order again. PATCH is safe to repeat: after a timeout, sign the same body again and resend it.

Keep the allowance in step with the amount

The maker’s allowance to the Olympex order contract must cover amount plus the execution gas cost in inTokenAddress, summed over every open limit order and active DCA strategy that sells the same token on the same chain. How much to approve shows how to estimate the gas cost and add up the total.
Raise the allowance before you raise amount: Olympex can’t execute an order that the allowance doesn’t cover. When you lower amount, lower the allowance too, to what your open orders still need.

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.

Body

application/json

Send only the fields you change, and only while the order is pending: otherwise the call returns 409. At least one field is required. Fields Olympex sets, such as status, txHash and reasonFail, return 400 VALIDATION_ERROR. To cancel, use DELETE /limit-order/{id}.

gasPrice
string

New gas price, in gwei, as a decimal string. Olympex stores it with the order, but execution uses the chain's gas price at that moment, so it isn't a cap.

Minimum string length: 1
slippage
string

New maximum slippage, in percent, as a decimal string.

Minimum string length: 1
amount

New amount of inTokenAddress to sell, human-readable. Keep your token allowance in step with it.

price

New copy of the limit price. Send the same value as priceTrigger: a PATCH with only priceTrigger leaves price unchanged.

priceTrigger

New limit price: units of outTokenAddress per 1 inTokenAddress.

expired
string

New expiry, with the same rules as on create: a 13-digit Unix timestamp in milliseconds, in the future and at most 365 days ahead. Any other value returns 400 VALIDATION_ERROR.

Response

The updated 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