Skip to main content
PATCH
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.
Cancelling doesn’t change the maker’s token allowance, and the pair signature stays valid. If the maker no longer needs the allowance it granted to the Olympex order contract, lower it, or set it to 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: null returns 400 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_ERROR with 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 PATCH moves updatedAt, even one that changes nothing.

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

Strategy ID, as returned when it was created.

Body

application/json

Send only the fields you change. At least one field is required.

minPrice
number

New lower price bound, in units of tokenAddressTo per 1 tokenAddressFrom.

maxPrice
number

New upper price bound, in units of tokenAddressTo per 1 tokenAddressFrom.

status
enum<string>

Send cancelled to stop the strategy. Cancelling can't be undone. Other values are reserved for Olympex.

Available options:
pending,
active,
cancelled,
finished

Response

The updated strategy.

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

A DCA strategy. Olympex can add fields; ignore the ones you don't use.

meta
object
required