Overview
Deletes a pre-deposit strategy; closes a funded strategy that needs no
on-chain withdrawal (the fallback: "delete" target of
POST .../calldata/withdraw). SignedRequest, action strategy.delete,
empty signed payload ({}); the id rides in the path and the proof's
- path: entry binds it.
Endpoint
DELETE https://earn-api.quicknode.dev/functions/v1/api/v1/strategies/{id}
Authorization
Include the published apikey header and a valid Sign-In with Ethereum (SIWE) proof in the request body. The SIWE message binds the wallet to this action, payload, and request path.
Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | Yes | Strategy UUID. |
Request body
A pre-deposit delete is usually just the siwe block (empty signed payload {}). A post-deposit close MAY carry final-value fields (all part of the signed payload): a legacy envelope (txHash, finalValueUsdc) or a per-chain map that must cover every active-position chain.
| Field | Type | Required | Description |
|---|---|---|---|
| siwe | object | Yes | A Sign-In-With-Ethereum proof binding the wallet to (action, payload, issuedAt, expirationTime). |
| siwe.message | string | Yes | SIWE message for action `strategy.delete`, including the payload hash and strategy path resource. |
| siwe.signature | string | Yes | Wallet signature over `siwe.message`. |
| txHash | string | No | Close tx hash (legacy envelope). |
| finalValueUsdc | number | No | On-chain final value in decimal dollars (legacy envelope), covering the whole close. Withdrawal amounts already recorded from on-chain close events always take precedence: only the excess of this value above the recorded event total is counted (floored at zero) and stands in for the legs those events do not cover, so the recorded events win over a stale or lower total. |
| perChain | object | No | Per-chain close data keyed by chain id (string). |
| perChain.<chainId>.txHash | string | No | Close transaction hash for the chain. |
| perChain.<chainId>.finalValueUsdc | number | No | Final chain value in decimal US dollars. |
| perChain.<chainId>.feeUsdc | number | No | Chain close fee in decimal US dollars. |
Example request
curl --request DELETE \
--url 'https://earn-api.quicknode.dev/functions/v1/api/v1/strategies/<STRATEGY_ID>' \
--header 'Accept: application/json' \
--header 'apikey: <EARN_PUBLIC_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"siwe": {
"message": "<SIWE_MESSAGE>",
"signature": "<SIGNATURE>"
}
}'
Response
| Field | Type | Required | Description |
|---|---|---|---|
| success | boolean | Yes | Always true on a 2xx. |
| action | string (deleted | closed) | Yes | `deleted` for a pre-deposit hard delete; `closed` for a post-deposit DB close. |
Example response
{
"success": true,
"action": "deleted"
}
HTTP responses
| Status | Description |
|---|---|
| 200 | Deletion or close result. |
| 400 | Malformed request/SIWE, OR active positions remain on chains not covered by a per-chain close (`invalid_request`). |
| 401 | SIWE verification failed. `code` is one of: `siwe_domain` (message domain not allowlisted), `siwe_action` (statement/action mismatch), `siwe_stale` (expired or validity window out of bounds), `siwe_payload` (payload hash or resource mismatch — canonicalization drift, a re-serialized body, or a `- path:` entry that does not match the request path), `siwe_chain` (bad chain id), `siwe_recover` (signature does not match the claimed address), `siwe_replay` (nonce already used — sign a fresh request). |
| 404 | Resource not found. |
| 429 | Rate limit exceeded. `Retry-After` (seconds) tells you when to retry. Reads, feedback, and push writes are keyed per IP; create/update/delete are keyed per wallet+IP; deposit/withdraw/claim calldata is keyed per strategy+IP. |
| 500 | Internal server error. |
| 503 | Signature verification could not reach the chain to validate a contract (ERC-1271) wallet. Transient — retry. Only occurs for smart-wallet signers. |
This page is based on operation deleteStrategy in the Earn OpenAPI 3.1 specification.