> ## Documentation Index
> Fetch the complete documentation index at: https://docs.olympex.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a DCA strategy

> Cancel a DCA strategy, or change its price bounds.

`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](/api-reference/dca/create-dca-strategy).

Signed endpoint. Send `Content-Type: application/json`, the canonical JSON body, and the four headers `x-api-key-id`, `x-value-info`, `x-passphrase` and `x-signature` described in [Sign requests](/authentication/sign-requests). To cancel, the body is `{"status":"cancelled"}`; cancelling can't be undone and stops new orders. The strategy's existing orders are read-only: lower the maker's allowance to stop them. `minPrice` and `maxPrice` are JSON numbers in units of `tokenAddressTo` per 1 `tokenAddressFrom`. The body needs at least one field, and an unknown field returns `400 VALIDATION_ERROR`. Returns `200` with the updated strategy. `404 NOT_FOUND` "DCA strategy not found" means the ID doesn't exist or belongs to another API key.

## 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](/api-reference/dca/list-dca-strategy-orders) to see where they stand, and lower the maker's allowance.

Other `status` values are reserved for Olympex.

<Warning>
  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](/concepts/order-authorization).
</Warning>

## 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](/authentication/sign-requests#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.

<RequestExample>
  ```bash cURL theme={null}
  # 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"
  ```

  ```ts TypeScript theme={null}
  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"
  ```

  ```python Python theme={null}
  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"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "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"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "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"
    }
  }
  ```

  ```json 404 theme={null}
  {
    "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"
    }
  }
  ```

  ```json 403 Gateway theme={null}
  {
    "message": "Forbidden"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml api-reference/openapi.json PATCH /dca-order/strategies/{id}
openapi: 3.0.3
info:
  title: Olympex REST API
  version: 1.0.0
  description: >-
    Aggregated swap quotes and transactions, limit orders and DCA strategies on
    EVM chains, plus the chain and token catalog. Every response uses the same
    envelope, except the API gateway's own responses (`{"message": …}`): `401`
    or `403` when the signed headers are missing or rejected, `429` when it
    throttles requests, and `500` or `503` when it can't get a response from
    Olympex in time. Chain IDs are integers on every endpoint. Signed endpoints
    require four signed headers; see [Sign
    requests](https://docs.olympex.io/authentication/sign-requests).
  termsOfService: https://docs.olympex.io/legal/terms
  contact:
    name: Olympex partnerships
    email: partners@olympex.io
    url: https://docs.olympex.io
servers:
  - url: https://api-rest.olympex.io/api/v1
    description: Olympex REST API v1
security: []
tags:
  - name: Accounts
    description: Create API credentials.
  - name: Quotes
    description: Aggregated single-chain and cross-chain quotes.
  - name: Swap
    description: Unsigned transaction calldata for a quoted route.
  - name: TxStatus
    description: Track a cross-chain transfer after you broadcast it.
  - name: Transactions
    description: On-chain status of a transaction you broadcast.
  - name: Chains and tokens
    description: Enabled chains and the tokens listed on each.
  - name: Limit orders
    description: Orders that Olympex executes when the market reaches your price.
  - name: DCA
    description: Strategies that buy a token in equal orders over time.
  - name: Docs
    description: Machine-readable API description.
paths:
  /dca-order/strategies/{id}:
    patch:
      tags:
        - DCA
      summary: Update a DCA strategy
      description: >-
        Cancels a strategy, or changes its price bounds. Send only the fields
        you change. Cancelling stops future orders and can't be undone; it
        doesn't reduce your token allowance.
      operationId: updateDcaStrategy
      parameters:
        - name: id
          in: path
          required: true
          description: Strategy ID, as returned when it was created.
          schema:
            type: string
          example: 320263ca-2f38-4349-b641-a23aed2ff847
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DcaStrategyUpdateRequest'
      responses:
        '200':
          description: The updated strategy.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DcaStrategySuccessResponse'
              example:
                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
        '400':
          description: >-
            The body failed validation. An empty body or an unknown field is
            rejected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                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
        '401':
          description: >-
            A signing header is missing. The gateway answers with
            `{"message":"Unauthorized"}` before your request reaches Olympex;
            the handler answers with the `UNAUTHORIZED` envelope when the
            authorizer context is missing.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/GatewayError'
                  - $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Unauthorized
        '403':
          description: >-
            Authentication failed: unknown key, wrong passphrase, invalid
            signature, timestamp outside the ±300 s window, reused nonce, or
            inactive account (gateway `{"message":"Forbidden"}`). The handler
            answers with the `FORBIDDEN` envelope when the body does not match
            the signed `bodyHash`.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/GatewayError'
                  - $ref: '#/components/schemas/ErrorResponse'
              examples:
                gateway:
                  summary: Signature rejected by the gateway
                  value:
                    message: Forbidden
                bodyHash:
                  summary: Body does not match the signed hash
                  value:
                    success: false
                    error:
                      code: FORBIDDEN
                      message: Invalid body hash
                      details: []
                    meta:
                      requestId: ENXGDhsXIAMEMEw=
                      version: v1
                      accountType: integrator
                      apiKeyId: 00000000-0000-4000-8000-000000000000
        '404':
          description: >-
            No DCA strategy with this ID belongs to your API key (`NOT_FOUND`).
            IDs of other API keys return the same error. An unknown path or
            method also returns `NOT_FOUND`, with a message that names the
            method and path.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  summary: Unknown DCA strategy
                  value:
                    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
                unknownRoute:
                  summary: Unknown path or method
                  value:
                    success: false
                    error:
                      code: NOT_FOUND
                      message: No route for GET /api/v1/quote
                      details: []
                    meta:
                      requestId: E7edogG4IAMEPYA=
                      version: v1
        '500':
          description: >-
            Olympex could not complete the request (`INTERNAL_ERROR`), or the
            gateway could not get a response (`{"message":"Internal Server
            Error"}`), which also happens on the first request after a quiet
            period. Retry with backoff.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - $ref: '#/components/schemas/GatewayError'
              example:
                success: false
                error:
                  code: INTERNAL_ERROR
                  message: Unexpected internal error
                  details: []
                meta:
                  requestId: EdkgFgDwoAMEZsA=
                  version: v1
                  accountType: integrator
                  apiKeyId: 00000000-0000-4000-8000-000000000000
        '503':
          description: >-
            The gateway could not get a response in time (the integration
            timeout is about 30 seconds) or the service is briefly unavailable.
            Returned by the gateway. Retry with backoff.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              example:
                message: Service Unavailable
      security:
        - ApiKeyId: []
          ValueInfo: []
          Passphrase: []
          Signature: []
components:
  schemas:
    DcaStrategyUpdateRequest:
      type: object
      properties:
        accountTo:
          type: string
          minLength: 1
          description: >-
            Changing it on a running strategy isn't supported. Cancel the
            strategy and create a new one instead.
          readOnly: true
        chainIdFrom:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          maximum: 9007199254740991
          readOnly: true
          description: >-
            Changing it on a running strategy isn't supported. Cancel the
            strategy and create a new one instead.
        chainIdTo:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          maximum: 9007199254740991
          readOnly: true
          description: >-
            Changing it on a running strategy isn't supported. Cancel the
            strategy and create a new one instead.
        tokenAddressFrom:
          type: string
          minLength: 1
          description: >-
            Changing it on a running strategy isn't supported. Cancel the
            strategy and create a new one instead.
          readOnly: true
        tokenAddressTo:
          type: string
          minLength: 1
          description: >-
            Changing it on a running strategy isn't supported. Cancel the
            strategy and create a new one instead.
          readOnly: true
        tokenSymbolFrom:
          type: string
          minLength: 1
          description: >-
            Changing it on a running strategy isn't supported. Cancel the
            strategy and create a new one instead.
          readOnly: true
        tokenSymbolTo:
          type: string
          minLength: 1
          description: >-
            Changing it on a running strategy isn't supported. Cancel the
            strategy and create a new one instead.
          readOnly: true
        pair:
          type: string
          minLength: 1
          description: >-
            Changing it on a running strategy isn't supported. Cancel the
            strategy and create a new one instead.
          readOnly: true
        totalAmount:
          type: number
          minimum: 0
          exclusiveMinimum: true
          readOnly: true
          description: >-
            Changing it on a running strategy isn't supported. Cancel the
            strategy and create a new one instead.
        frequency:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          maximum: 9007199254740991
          readOnly: true
          description: >-
            Changing it on a running strategy isn't supported. Cancel the
            strategy and create a new one instead.
        iterations:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          maximum: 9007199254740991
          readOnly: true
          description: >-
            Changing it on a running strategy isn't supported. Cancel the
            strategy and create a new one instead.
        slippage:
          type: number
          minimum: 0
          exclusiveMinimum: true
          readOnly: true
          description: >-
            Changing it on a running strategy isn't supported. Cancel the
            strategy and create a new one instead.
        minPrice:
          type: number
          description: >-
            New lower price bound, in units of `tokenAddressTo` per 1
            `tokenAddressFrom`.
        maxPrice:
          type: number
          description: >-
            New upper price bound, in units of `tokenAddressTo` per 1
            `tokenAddressFrom`.
        status:
          type: string
          enum:
            - pending
            - active
            - cancelled
            - finished
          description: >-
            Send `cancelled` to stop the strategy. Cancelling can't be undone.
            Other values are reserved for Olympex.
        signature:
          type: string
          minLength: 1
          description: >-
            Changing it on a running strategy isn't supported. Cancel the
            strategy and create a new one instead.
          readOnly: true
      additionalProperties: false
      description: Send only the fields you change. At least one field is required.
      example:
        status: cancelled
    DcaStrategySuccessResponse:
      type: object
      required:
        - success
        - data
        - meta
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/DcaStrategy'
        meta:
          $ref: '#/components/schemas/Meta'
    ErrorResponse:
      type: object
      required:
        - success
        - error
        - meta
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          $ref: '#/components/schemas/ErrorBody'
        meta:
          $ref: '#/components/schemas/Meta'
    GatewayError:
      type: object
      required:
        - message
      description: >-
        Returned by the API gateway itself: `401` or `403` when the signed
        headers are missing or rejected, `429` when it throttles requests, and
        `500` or `503` when it can't get a response from Olympex in time. It has
        no `success`, `error` or `meta`.
      properties:
        message:
          type: string
          example: Forbidden
    DcaStrategy:
      type: object
      description: A DCA strategy. Olympex can add fields; ignore the ones you don't use.
      required:
        - id
        - accountTo
        - chainIdFrom
        - chainIdTo
        - tokenAddressFrom
        - tokenAddressTo
        - tokenSymbolFrom
        - tokenSymbolTo
        - totalAmount
        - frequency
        - iterations
        - slippage
        - status
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
          description: Strategy ID.
        accountTo:
          type: string
          description: Maker wallet, as sent.
        chainIdFrom:
          type: integer
          description: Chain ID.
        chainIdTo:
          type: integer
          description: Chain ID. Equal to `chainIdFrom`.
        tokenAddressFrom:
          type: string
          description: Token sold, as sent.
        tokenAddressTo:
          type: string
          description: Token bought, as sent.
        tokenSymbolFrom:
          type: string
          description: Symbol of the token sold.
        tokenSymbolTo:
          type: string
          description: Symbol of the token bought.
        totalAmount:
          type: number
          description: Total amount of the token sold across all orders, human-readable.
        frequency:
          type: integer
          description: Seconds between orders.
        iterations:
          type: integer
          description: Number of orders.
        slippage:
          type: number
          description: Maximum slippage per order, in percent. `0` when it wasn't sent.
        minPrice:
          type: number
          description: Lower price bound. Absent when not set.
        maxPrice:
          type: number
          description: Upper price bound. Absent when not set.
        status:
          type: string
          enum:
            - pending
            - active
            - cancelled
            - finished
          description: >-
            `active`: running. `cancelled`: stopped by you. `finished`: every
            order ran. `pending` is reserved. Treat any other value as not
            final.
        createdAt:
          type: string
          format: date-time
          description: When the strategy was created (ISO 8601, UTC).
        updatedAt:
          type: string
          format: date-time
          description: When the strategy last changed (ISO 8601, UTC).
        deletedAt:
          type: string
          format: date-time
          description: Absent unless the strategy was deleted by Olympex.
    Meta:
      type: object
      required:
        - requestId
        - version
      properties:
        requestId:
          type: string
          description: Unique ID for this request. Include it when you contact support.
        version:
          type: string
          default: v1
          description: API version that served the request.
        accountType:
          type: string
          description: >-
            Account type resolved by the signature check, for example
            `integrator`. Present when the request was authenticated; absent on
            the `404` for an unknown path or method.
        apiKeyId:
          type: string
          format: uuid
          description: >-
            The API key ID that signed the request. Present when the request was
            authenticated; absent on the `404` for an unknown path or method.
    ErrorBody:
      type: object
      required:
        - code
        - message
        - details
      properties:
        code:
          type: string
          description: >-
            Machine-readable error code. `VALIDATION_ERROR` (400),
            `UNAUTHORIZED` (401), `FORBIDDEN` (403), `NOT_FOUND` (404, also for
            an unknown path or method), `CONFLICT` (409), `NO_ROUTE` (422), and
            for 500: `QUOTE_ERROR`, `CROSS_CHAIN_QUOTE_ERROR`, `SWAP_ERROR`,
            `CROSS_CHAIN_SWAP_ERROR`, `SUPPORT_CHAIN_ERROR`,
            `ENABLED_CHAINS_ERROR`, `TOKEN_LIST_ERROR`, `TX_STATUS_ERROR`,
            `INTERNAL_ERROR`. Olympex can add codes: handle an unknown code by
            its HTTP status.
        message:
          type: string
          description: Human-readable summary. Don't parse it.
        details:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
    ErrorDetail:
      type: object
      additionalProperties: true
      description: >-
        Validation errors carry `field` and `message`; other errors carry
        `message` only.
      properties:
        field:
          type: string
          description: >-
            Dot path of the invalid field, for example `params.chainId`. Empty
            for the top level.
        message:
          type: string
  securitySchemes:
    ApiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: >-
        Your API key ID (UUID). See [Sign
        requests](https://docs.olympex.io/authentication/sign-requests).
    ValueInfo:
      type: apiKey
      in: header
      name: x-value-info
      description: >-
        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.
    Passphrase:
      type: apiKey
      in: header
      name: x-passphrase
      description: Your account passphrase. Treat it like the secret key.
    Signature:
      type: apiKey
      in: header
      name: x-signature
      description: >-
        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](https://docs.olympex.io/authentication/sign-requests).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.