---
title: "PATCH /v2/earn/config"
method: PATCH
path: "/v2/earn/config"
tags: ["Earn"]
---

# PATCH /v2/earn/config

`PATCH /v2/earn/config`

## Request body

- object
  - `autoSweepEnabled` boolean
  - `autoSweepMinAmount` string

## Response `200`

Earn config updated

- object
  - `success` boolean, required
  - `message` string, required
  - `responseObject` object
    - `status` 'NONE' | 'PENDING' | 'ACTIVE' | 'CLOSING' | 'FAILED', required
    - `depositId` string, nullable, required
    - `walletAddress` string, nullable, required
    - `autoSweepEnabled` boolean, required
    - `autoSweepMinAmount` string, required
    - `trustedTakerEnabled` boolean, required
    - `oracleSpreadBps` integer, nullable, required
    - `failureCode` 'AMOUNT_BELOW_MIN' | 'UNSUPPORTED_PROCESSOR' | 'ON_CHAIN_REVERT' | 'TX_TIMEOUT' | 'INTERNAL', nullable, required
    - `failureMessage` string, nullable, required
    - `maxIntentAmount` string, required
    - `minIntentAmount` string, required
    - `failureDetail` string, nullable, required
    - `depositStats` object, nullable, required
      - `pnlUsdCents` number, required
      - `pnlReturnBps` number, required
      - `aprBps` number, required
      - `idleBalance` string, required
      - `inFlightBalance` string, required
      - `totalInEscrow` string, required
      - `totalVolume` string, required
      - `fulfilledOrders` number, required
      - `successRateBps` number, required
      - `utilizationBps` number, required
      - `avgOrderSizeUsdc` string, nullable, required
      - `depositAgeDays` number, required
  - `statusCode` number, required
  - `errorCode` string

## Other responses

- `400` — Earn config update not applied
- `404` — Earn deposit not found
- `409` — Earn deposit update conflict
- `502` — Earn config update upstream failure

---

[API](https://skmtc.dev/peer/apis/swagger-api.md) · [All operations](https://skmtc.dev/peer/apis/swagger-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/peer/swagger-api/revisions/d5fcf4abb61a/schema)
