# Cancel a DCA strategy. Cancelling can't be undone.
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
STRATEGY_ID='320263ca-2f38-4349-b641-a23aed2ff847'
METHOD=PATCH
ENDPOINT="/dca-order/strategies/$STRATEGY_ID"
QUERY=''
BODY='{"status":"cancelled"}'
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
const strategyId = "320263ca-2f38-4349-b641-a23aed2ff847";
const strategy = await olympexRequest<{ status: string }>("PATCH", `/dca-order/strategies/${strategyId}`, {
status: "cancelled",
});
console.log(strategy.status); // "cancelled"
from sign_request import olympex_request # /authentication/sign-requests
strategy_id = "320263ca-2f38-4349-b641-a23aed2ff847"
strategy = olympex_request("PATCH", f"/dca-order/strategies/{strategy_id}", {"status": "cancelled"})
print(strategy["status"]) # "cancelled"
{
"success": true,
"data": {
"id": "320263ca-2f38-4349-b641-a23aed2ff847",
"accountTo": "0x1E67cb01969D79B2B895179e4A07D24a839dBb52",
"chainIdFrom": 137,
"chainIdTo": 137,
"tokenAddressFrom": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
"tokenAddressTo": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
"tokenSymbolFrom": "USDC",
"tokenSymbolTo": "WETH",
"totalAmount": 100,
"frequency": 86400,
"iterations": 10,
"slippage": 1,
"status": "cancelled",
"createdAt": "2026-09-29T13:48:57.833Z",
"updatedAt": "2026-09-29T13:49:01.330Z"
},
"meta": {
"requestId": "Eds4FhltIAMEP6A=",
"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": "EdmGogSCIAMEJ4Q=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "DCA strategy not found",
"details": []
},
"meta": {
"requestId": "EdjfDjXBIAMEVsA=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
Update a DCA strategy
Cancel a DCA strategy, or change its price bounds.
# Cancel a DCA strategy. Cancelling can't be undone.
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
STRATEGY_ID='320263ca-2f38-4349-b641-a23aed2ff847'
METHOD=PATCH
ENDPOINT="/dca-order/strategies/$STRATEGY_ID"
QUERY=''
BODY='{"status":"cancelled"}'
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
const strategyId = "320263ca-2f38-4349-b641-a23aed2ff847";
const strategy = await olympexRequest<{ status: string }>("PATCH", `/dca-order/strategies/${strategyId}`, {
status: "cancelled",
});
console.log(strategy.status); // "cancelled"
from sign_request import olympex_request # /authentication/sign-requests
strategy_id = "320263ca-2f38-4349-b641-a23aed2ff847"
strategy = olympex_request("PATCH", f"/dca-order/strategies/{strategy_id}", {"status": "cancelled"})
print(strategy["status"]) # "cancelled"
{
"success": true,
"data": {
"id": "320263ca-2f38-4349-b641-a23aed2ff847",
"accountTo": "0x1E67cb01969D79B2B895179e4A07D24a839dBb52",
"chainIdFrom": 137,
"chainIdTo": 137,
"tokenAddressFrom": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
"tokenAddressTo": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
"tokenSymbolFrom": "USDC",
"tokenSymbolTo": "WETH",
"totalAmount": 100,
"frequency": 86400,
"iterations": 10,
"slippage": 1,
"status": "cancelled",
"createdAt": "2026-09-29T13:48:57.833Z",
"updatedAt": "2026-09-29T13:49:01.330Z"
},
"meta": {
"requestId": "Eds4FhltIAMEP6A=",
"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": "EdmGogSCIAMEJ4Q=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "DCA strategy not found",
"details": []
},
"meta": {
"requestId": "EdjfDjXBIAMEVsA=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
PATCH /dca-order/strategies/{id} cancels a strategy or changes its price bounds. Send only the fields you change: status, minPrice or maxPrice. To change anything else, such as the tokens, the budget or the schedule, cancel the strategy and create a new one.
Cancel a strategy
Send{"status":"cancelled"}. Cancelling can’t be undone, and it stops new orders. The orders Olympex already created are read-only: list them to see where they stand, and lower the maker’s allowance.
Other status values are reserved for Olympex.
0 to stop everything for that token. See Order signatures and allowances.Change the price bounds
minPrice and maxPrice are JSON numbers in units of tokenAddressTo per 1 tokenAddressFrom. Olympex executes an order only while the price is within the bounds you set. For a strategy that buys WETH with USDC, a bound is WETH per 1 USDC: with WETH at 4,000 USDC, the price is 0.00025.
- You can’t remove a bound once it’s set:
nullreturns400 VALIDATION_ERROR. To drop the bounds, cancel the strategy and create a new one. - Bounds are often fractional. The reference signers format them the way JavaScript does, so they sign correctly in TypeScript, Python and the API console. See Portability rules.
Validation
- An empty body returns
400 VALIDATION_ERRORwith the detail “At least one field is required”. - Changing any other field on a running strategy isn’t supported. Other fields in the schema are set by Olympex; don’t send them.
- Sending the same request again is safe: it writes the same values. Every successful
PATCHmovesupdatedAt, even one that changes nothing.
# Cancel a DCA strategy. Cancelling can't be undone.
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
STRATEGY_ID='320263ca-2f38-4349-b641-a23aed2ff847'
METHOD=PATCH
ENDPOINT="/dca-order/strategies/$STRATEGY_ID"
QUERY=''
BODY='{"status":"cancelled"}'
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
const strategyId = "320263ca-2f38-4349-b641-a23aed2ff847";
const strategy = await olympexRequest<{ status: string }>("PATCH", `/dca-order/strategies/${strategyId}`, {
status: "cancelled",
});
console.log(strategy.status); // "cancelled"
from sign_request import olympex_request # /authentication/sign-requests
strategy_id = "320263ca-2f38-4349-b641-a23aed2ff847"
strategy = olympex_request("PATCH", f"/dca-order/strategies/{strategy_id}", {"status": "cancelled"})
print(strategy["status"]) # "cancelled"
{
"success": true,
"data": {
"id": "320263ca-2f38-4349-b641-a23aed2ff847",
"accountTo": "0x1E67cb01969D79B2B895179e4A07D24a839dBb52",
"chainIdFrom": 137,
"chainIdTo": 137,
"tokenAddressFrom": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
"tokenAddressTo": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
"tokenSymbolFrom": "USDC",
"tokenSymbolTo": "WETH",
"totalAmount": 100,
"frequency": 86400,
"iterations": 10,
"slippage": 1,
"status": "cancelled",
"createdAt": "2026-09-29T13:48:57.833Z",
"updatedAt": "2026-09-29T13:49:01.330Z"
},
"meta": {
"requestId": "Eds4FhltIAMEP6A=",
"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": "EdmGogSCIAMEJ4Q=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "DCA strategy not found",
"details": []
},
"meta": {
"requestId": "EdjfDjXBIAMEVsA=",
"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
Strategy ID, as returned when it was created.
Body
Send only the fields you change. At least one field is required.
New lower price bound, in units of tokenAddressTo per 1 tokenAddressFrom.
New upper price bound, in units of tokenAddressTo per 1 tokenAddressFrom.
Send cancelled to stop the strategy. Cancelling can't be undone. Other values are reserved for Olympex.
pending, active, cancelled, finished Was this page helpful?
