# Move the limit price of a pending order to 4300 USDC per WETH.
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
ORDER_ID='afc47108-d059-473c-b2e1-5f2ca7951466' # from POST /limit-order
METHOD=PATCH
ENDPOINT="/limit-order/$ORDER_ID"
QUERY=''
BODY='{"price":"4300","priceTrigger":"4300"}'
TS="${OLYMPEX_TIMESTAMP:-$(date +%s)}"
NONCE="${OLYMPEX_NONCE:-$(openssl rand -hex 12)}"
BODY_HASH="$(printf '%s' "$BODY" | openssl dgst -sha256 -binary | openssl base64 -A | tr '+/' '-_' | tr -d '=')"
VALUE_INFO="$(printf '%s\n%s\n%s' "$TS" "$NONCE" "$BODY_HASH")"
MESSAGE="$(printf 'OLPX-HMAC-SHA256-V2\n%s\n%s\n%s\n%s\n%s\n%s' "$TS" "$NONCE" "$METHOD" "/api/v1$ENDPOINT" "$QUERY" "$BODY_HASH")"
curl -sS -X "$METHOD" "https://api-rest.olympex.io/api/v1$ENDPOINT${QUERY:+?$QUERY}" \
-H "content-type: application/json" \
-H "x-api-key-id: $OLYMPEX_API_KEY_ID" \
-H "x-value-info: $(printf '%s' "$VALUE_INFO" | openssl base64 -A)" \
-H "x-passphrase: $OLYMPEX_PASSPHRASE" \
-H "x-signature: $(printf '%s' "$MESSAGE" | openssl dgst -sha256 -hmac "$OLYMPEX_SECRET_KEY" -binary | od -An -v -tx1 | tr -d ' \n')" \
--data-raw "$BODY"
import { olympexRequest } from "./sign-request.ts"; // /authentication/sign-requests
type LimitOrder = { id: string; status: string; price: number; priceTrigger: number };
const orderId = "afc47108-d059-473c-b2e1-5f2ca7951466"; // from POST /limit-order
const current = await olympexRequest<LimitOrder>("GET", `/limit-order/${orderId}`);
if (current.status !== "pending") throw new Error(`The order is ${current.status}; only pending orders can change`);
const updated = await olympexRequest<LimitOrder>("PATCH", `/limit-order/${orderId}`, {
priceTrigger: "4300", // USDC per 1 WETH
price: "4300", // the same value as priceTrigger
});
console.log(updated.priceTrigger); // 4300, as a number
from sign_request import olympex_request # /authentication/sign-requests
order_id = "afc47108-d059-473c-b2e1-5f2ca7951466" # from POST /limit-order
current = olympex_request("GET", f"/limit-order/{order_id}")
if current["status"] != "pending":
raise RuntimeError(f'The order is {current["status"]}; only pending orders can change')
updated = olympex_request("PATCH", f"/limit-order/{order_id}", {
"priceTrigger": "4300", # USDC per 1 WETH
"price": "4300", # the same value as priceTrigger
})
print(updated["priceTrigger"]) # 4300, as a number
{
"success": true,
"data": {
"id": "afc47108-d059-473c-b2e1-5f2ca7951466",
"accountTo": "0x1E67cb01969D79B2B895179e4A07D24a839dBb52",
"chainId": 137,
"gasPrice": "35",
"inTokenAddress": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
"outTokenAddress": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
"slippage": "1",
"tokenASymbol": "ETH",
"tokenBSymbol": "USDC",
"amount": 0.5,
"price": 4300,
"priceTrigger": 4300,
"expired": "1791302400000",
"txHash": "",
"status": "pending",
"reasonFail": [],
"attemptNumber": 0,
"allowance": "",
"estimateGas": "",
"effectivePriceGas": "",
"createdAt": "2026-09-29T16:01:22.237Z",
"updatedAt": "2026-09-29T16:01:23.231Z",
"deletedAt": ""
},
"meta": {
"requestId": "EeARAhqxIAMEJEA=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": [
{
"field": "",
"message": "At least one field is required"
}
]
},
"meta": {
"requestId": "EdjeqhHTIAMEb-w=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Limit order not found",
"details": []
},
"meta": {
"requestId": "EdjeXjypoAMEbrQ=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "CONFLICT",
"message": "Limit order can only be modified while pending (current status: cancelled)",
"details": []
},
"meta": {
"requestId": "E7ejBgHzIAMEZlA=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
Update a limit order
Change the limit price, amount, expiry, slippage or gas price of a pending limit order.
# Move the limit price of a pending order to 4300 USDC per WETH.
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
ORDER_ID='afc47108-d059-473c-b2e1-5f2ca7951466' # from POST /limit-order
METHOD=PATCH
ENDPOINT="/limit-order/$ORDER_ID"
QUERY=''
BODY='{"price":"4300","priceTrigger":"4300"}'
TS="${OLYMPEX_TIMESTAMP:-$(date +%s)}"
NONCE="${OLYMPEX_NONCE:-$(openssl rand -hex 12)}"
BODY_HASH="$(printf '%s' "$BODY" | openssl dgst -sha256 -binary | openssl base64 -A | tr '+/' '-_' | tr -d '=')"
VALUE_INFO="$(printf '%s\n%s\n%s' "$TS" "$NONCE" "$BODY_HASH")"
MESSAGE="$(printf 'OLPX-HMAC-SHA256-V2\n%s\n%s\n%s\n%s\n%s\n%s' "$TS" "$NONCE" "$METHOD" "/api/v1$ENDPOINT" "$QUERY" "$BODY_HASH")"
curl -sS -X "$METHOD" "https://api-rest.olympex.io/api/v1$ENDPOINT${QUERY:+?$QUERY}" \
-H "content-type: application/json" \
-H "x-api-key-id: $OLYMPEX_API_KEY_ID" \
-H "x-value-info: $(printf '%s' "$VALUE_INFO" | openssl base64 -A)" \
-H "x-passphrase: $OLYMPEX_PASSPHRASE" \
-H "x-signature: $(printf '%s' "$MESSAGE" | openssl dgst -sha256 -hmac "$OLYMPEX_SECRET_KEY" -binary | od -An -v -tx1 | tr -d ' \n')" \
--data-raw "$BODY"
import { olympexRequest } from "./sign-request.ts"; // /authentication/sign-requests
type LimitOrder = { id: string; status: string; price: number; priceTrigger: number };
const orderId = "afc47108-d059-473c-b2e1-5f2ca7951466"; // from POST /limit-order
const current = await olympexRequest<LimitOrder>("GET", `/limit-order/${orderId}`);
if (current.status !== "pending") throw new Error(`The order is ${current.status}; only pending orders can change`);
const updated = await olympexRequest<LimitOrder>("PATCH", `/limit-order/${orderId}`, {
priceTrigger: "4300", // USDC per 1 WETH
price: "4300", // the same value as priceTrigger
});
console.log(updated.priceTrigger); // 4300, as a number
from sign_request import olympex_request # /authentication/sign-requests
order_id = "afc47108-d059-473c-b2e1-5f2ca7951466" # from POST /limit-order
current = olympex_request("GET", f"/limit-order/{order_id}")
if current["status"] != "pending":
raise RuntimeError(f'The order is {current["status"]}; only pending orders can change')
updated = olympex_request("PATCH", f"/limit-order/{order_id}", {
"priceTrigger": "4300", # USDC per 1 WETH
"price": "4300", # the same value as priceTrigger
})
print(updated["priceTrigger"]) # 4300, as a number
{
"success": true,
"data": {
"id": "afc47108-d059-473c-b2e1-5f2ca7951466",
"accountTo": "0x1E67cb01969D79B2B895179e4A07D24a839dBb52",
"chainId": 137,
"gasPrice": "35",
"inTokenAddress": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
"outTokenAddress": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
"slippage": "1",
"tokenASymbol": "ETH",
"tokenBSymbol": "USDC",
"amount": 0.5,
"price": 4300,
"priceTrigger": 4300,
"expired": "1791302400000",
"txHash": "",
"status": "pending",
"reasonFail": [],
"attemptNumber": 0,
"allowance": "",
"estimateGas": "",
"effectivePriceGas": "",
"createdAt": "2026-09-29T16:01:22.237Z",
"updatedAt": "2026-09-29T16:01:23.231Z",
"deletedAt": ""
},
"meta": {
"requestId": "EeARAhqxIAMEJEA=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": [
{
"field": "",
"message": "At least one field is required"
}
]
},
"meta": {
"requestId": "EdjeqhHTIAMEb-w=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Limit order not found",
"details": []
},
"meta": {
"requestId": "EdjeXjypoAMEbrQ=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "CONFLICT",
"message": "Limit order can only be modified while pending (current status: cancelled)",
"details": []
},
"meta": {
"requestId": "E7ejBgHzIAMEZlA=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
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
| Field | Send |
|---|---|
priceTrigger, price | The new limit price, in units of outTokenAddress per 1 inTokenAddress, as a decimal string. Send both, with the same value. A PATCH with only priceTrigger leaves price unchanged. |
amount | The new amount of inTokenAddress to sell, as a human-readable decimal string. Keep the allowance in step. |
expired | The new expiry: a Unix timestamp in milliseconds, as a 13-digit string, in the future and at most 365 days ahead. Any other value returns 400 VALIDATION_ERROR. |
slippage | The new maximum slippage, in percent, as a string. "1" is 1%. |
gasPrice | The chain’s current gas price in gwei, as a decimal string. Olympex stores it with the order. It isn’t a cap: neither the API nor the order contract enforces it, and the gas cost the maker reimburses is the execution transaction’s gas used times its actual gas price, converted to inTokenAddress. |
status, txHash and reasonFail, return 400 VALIDATION_ERROR. Responses return amount, price and priceTrigger as JSON numbers.
Update pending orders only
Read the order withGET /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 coveramount 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.
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.# Move the limit price of a pending order to 4300 USDC per WETH.
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
ORDER_ID='afc47108-d059-473c-b2e1-5f2ca7951466' # from POST /limit-order
METHOD=PATCH
ENDPOINT="/limit-order/$ORDER_ID"
QUERY=''
BODY='{"price":"4300","priceTrigger":"4300"}'
TS="${OLYMPEX_TIMESTAMP:-$(date +%s)}"
NONCE="${OLYMPEX_NONCE:-$(openssl rand -hex 12)}"
BODY_HASH="$(printf '%s' "$BODY" | openssl dgst -sha256 -binary | openssl base64 -A | tr '+/' '-_' | tr -d '=')"
VALUE_INFO="$(printf '%s\n%s\n%s' "$TS" "$NONCE" "$BODY_HASH")"
MESSAGE="$(printf 'OLPX-HMAC-SHA256-V2\n%s\n%s\n%s\n%s\n%s\n%s' "$TS" "$NONCE" "$METHOD" "/api/v1$ENDPOINT" "$QUERY" "$BODY_HASH")"
curl -sS -X "$METHOD" "https://api-rest.olympex.io/api/v1$ENDPOINT${QUERY:+?$QUERY}" \
-H "content-type: application/json" \
-H "x-api-key-id: $OLYMPEX_API_KEY_ID" \
-H "x-value-info: $(printf '%s' "$VALUE_INFO" | openssl base64 -A)" \
-H "x-passphrase: $OLYMPEX_PASSPHRASE" \
-H "x-signature: $(printf '%s' "$MESSAGE" | openssl dgst -sha256 -hmac "$OLYMPEX_SECRET_KEY" -binary | od -An -v -tx1 | tr -d ' \n')" \
--data-raw "$BODY"
import { olympexRequest } from "./sign-request.ts"; // /authentication/sign-requests
type LimitOrder = { id: string; status: string; price: number; priceTrigger: number };
const orderId = "afc47108-d059-473c-b2e1-5f2ca7951466"; // from POST /limit-order
const current = await olympexRequest<LimitOrder>("GET", `/limit-order/${orderId}`);
if (current.status !== "pending") throw new Error(`The order is ${current.status}; only pending orders can change`);
const updated = await olympexRequest<LimitOrder>("PATCH", `/limit-order/${orderId}`, {
priceTrigger: "4300", // USDC per 1 WETH
price: "4300", // the same value as priceTrigger
});
console.log(updated.priceTrigger); // 4300, as a number
from sign_request import olympex_request # /authentication/sign-requests
order_id = "afc47108-d059-473c-b2e1-5f2ca7951466" # from POST /limit-order
current = olympex_request("GET", f"/limit-order/{order_id}")
if current["status"] != "pending":
raise RuntimeError(f'The order is {current["status"]}; only pending orders can change')
updated = olympex_request("PATCH", f"/limit-order/{order_id}", {
"priceTrigger": "4300", # USDC per 1 WETH
"price": "4300", # the same value as priceTrigger
})
print(updated["priceTrigger"]) # 4300, as a number
{
"success": true,
"data": {
"id": "afc47108-d059-473c-b2e1-5f2ca7951466",
"accountTo": "0x1E67cb01969D79B2B895179e4A07D24a839dBb52",
"chainId": 137,
"gasPrice": "35",
"inTokenAddress": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
"outTokenAddress": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
"slippage": "1",
"tokenASymbol": "ETH",
"tokenBSymbol": "USDC",
"amount": 0.5,
"price": 4300,
"priceTrigger": 4300,
"expired": "1791302400000",
"txHash": "",
"status": "pending",
"reasonFail": [],
"attemptNumber": 0,
"allowance": "",
"estimateGas": "",
"effectivePriceGas": "",
"createdAt": "2026-09-29T16:01:22.237Z",
"updatedAt": "2026-09-29T16:01:23.231Z",
"deletedAt": ""
},
"meta": {
"requestId": "EeARAhqxIAMEJEA=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": [
{
"field": "",
"message": "At least one field is required"
}
]
},
"meta": {
"requestId": "EdjeqhHTIAMEb-w=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Limit order not found",
"details": []
},
"meta": {
"requestId": "EdjeXjypoAMEbrQ=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "CONFLICT",
"message": "Limit order can only be modified while pending (current status: cancelled)",
"details": []
},
"meta": {
"requestId": "E7ejBgHzIAMEZlA=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
Authorizations
Your API key ID (UUID). See Sign requests.
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.
Your account passphrase. Treat it like the secret key.
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
Limit order ID, as returned when it was created.
Body
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}.
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.
1New maximum slippage, in percent, as a decimal string.
1New amount of inTokenAddress to sell, human-readable. Keep your token allowance in step with it.
New copy of the limit price. Send the same value as priceTrigger: a PATCH with only priceTrigger leaves price unchanged.
New limit price: units of outTokenAddress per 1 inTokenAddress.
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.
Was this page helpful?
