PATCH /v1/auto-sell-tasks/{id}
修改自动卖出项
使用 application/merge-patch+json 与当前项合并后完整校验;数组整体替换,null 移除字段。rule.sell 子字段与已存的公开卖出参数合并,省略或移除整个 rule.sell 保留原参数。id、chain 和 rule.enabled 不可修改。除单独改名外,需暂停且链 sync_state 为 off 或 active。携带当前 If-Match,版本冲突返回 409。修改只影响之后的买入;已有买入的开发者卖出和迁移卖出保留买入时规则。需要 copytrade:write。
所需 Scope:copytrade:write 路径参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | ✓ | Globally unique auto sell item ID. |
请求头
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
If-Match | string | ✓ | Current quoted chain version from ETag. All items on the chain share this version; re-read after a conflict. |
请求体 application/merge-patch+json
自由格式的 JSON Merge Patch 文档——合并语义见「幂等与并发控制」。字段与下方返回的资源形状一致。
响应
200 — Committed
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
data | object | ✓ | Response payload. |
data.id | string | ✓ | Auto sell item ID. |
data.chain | string | ✓ | Chain of the item. |
data.name | string | ✓ | Auto sell task name. |
data.status | enum ("active" | "paused" | "deleted") | ✓ | Requested item state. deleted appears only in the DELETE response. |
data.version | number | null | ✓ | Version shared by all items on this chain; also returned as the ETag when present. |
data.sync_state | string | ✓ | Chain-level synchronization: off (no enabled items), syncing, active (acknowledged), or publish_failed (saved; awaiting retry). |
data.covers_new_wallets | boolean | ✓ | Whether this is the chain default covering future wallets. |
data.wallets | array<string> | ✓ | Stored exclusions for a default item, otherwise selected wallet addresses. |
data.covered_wallets | array<string> | ✓ | Currently covered active wallet addresses, resolved from the domain wallet ownership projection. Specific items take precedence over the default. |
data.rule | object | ✓ | Rule for future buys; existing protection orders are unchanged by edits, pause or deletion. |
data.rule.enabled | boolean | ✓ | Whether new qualifying buys receive protection orders. |
data.rule.min_sell_usd | string | Minimum automatic sell amount in USD for buys protected by this rule. | |
data.rule.retain_bps | number | Retained share in basis points, frozen for each buy covered by this rule. | |
data.rule.scope | string | ✓ | Buy coverage: apm_manual or wallet_all; neither includes task buys. |
data.rule.exits | object | ✓ | Stored price/time, dev sell and migration sell exits in the shared executor snake_case format, without input range validation. Event exits retain the rule in force when each buy happened; migration sell requires a launch-curve buy and dev sell cannot be cancelled per order. |
data.rule.sell | object | ✓ | Stored sell trade parameters for this item. |
data.rule.sell.slippage_pct | string | ✓ | Stored sell-side max slippage. "1" = 1%. |
data.rule.sell.gas | object | ✓ | Stored sell-side gas settings. |
data.rule.sell.gas.priority_fee | string | Priority fee as a decimal string: SOL on Solana, Gwei on EVM chains. BSC defaults to the tip lane on at 0.05 gwei with a 0.0005 BNB landing fee. Solana defaults to 0.002 SOL for buys and 0.001 SOL for sells, each with a 0.001 SOL landing fee (totals of 0.003 and 0.002 SOL, as for new tasks in the web app), so a task created without gas returns its sell side under sell. In gas and sell.gas, creating a task with priority_fee and no effective high_tip.enabled turns the tip lane off. In gas, sell.gas and follow_sell.gas, priority_fee also sets high_tip.priority_fee unless the request gives its own, so it reaches every route. | |
data.rule.sell.gas.landing_fee | string | Landing tip in the native currency (SOL on Solana). Omit to retain the chain default. When the effective Solana fee mode is manual, the priority fee and this tip are used on every landing route without a per-route split; the tip is charged only when the trade succeeds, and some routes do not pass it to the block producer, so only the priority fee ranks there. Solana tip guidance: below 0.0001 SOL, ordinary orders have no acceleration routes and failed orders still pay fees. Anti-MEV orders need at least 0.000001 SOL (LANDING_FEE_TOO_LOW below this), and only a very few protected routes take tips in this range. From 0.0001 to below 0.001 SOL, some routes are available. At 0.001 SOL or above, all routes for the selected mode are available. These tiers do not block saving settings. In auto mode, use the total fee budget to read these tiers. | |
data.rule.sell.gas.auto_gas | boolean | Automatic gas estimation. Arc defaults to true; set false to use priority_fee. | |
data.rule.sell.gas.high_tip | object | Alternative high-tip fee lane. Enabling this lane is unsupported on Robinhood and Arc. | |
data.rule.sell.gas.high_tip.enabled | boolean | Enable the alternative high-tip fee lane where the execution route supports it. BSC defaults to enabled at 0.05 gwei with a 0.0005 BNB landing fee. For ordinary buys and sells, explicit gas.priority_fee without high_tip.enabled disables this lane on create. PATCH omission keeps the current value. On Solana this is the manual mode's dual lane; auto fee mode is buy_fee_auto / sell_fee_auto. | |
data.rule.sell.gas.high_tip.priority_fee | string | Priority fee for the high-tip lane; same unit as gas.priority_fee. In gas, sell.gas and follow_sell.gas, the lane takes the ordinary priority_fee from the same request when its own priority_fee is omitted. | |
data.rule.sell.gas.high_tip.landing_fee | string | Landing tip for the high-tip lane in native currency. BSC defaults to 0.0005 BNB at 0.05 gwei; when the lane is on, BSC private routes pay it to the block builder on fill. Solana tip guidance: below 0.0001 SOL, ordinary orders have no acceleration routes and failed orders still pay fees. Anti-MEV orders need at least 0.000001 SOL (LANDING_FEE_TOO_LOW below this), and only a very few protected routes take tips in this range. From 0.0001 to below 0.001 SOL, some routes are available. At 0.001 SOL or above, all routes for the selected mode are available. These tiers do not block saving settings. In Solana manual mode, use the higher of the normal and high-tip values to read these tiers. | |
data.rule.sell.gas.anti_mev | boolean | Send the transaction through a private anti-MEV route. Omit to use the chain default (on for bsc, off for robinhood/solana/arc). On Solana, Anti-MEV fills are slower than normal mode. Below 0.000001 SOL the executor rejects the order with LANDING_FEE_TOO_LOW. From that minimum up to (but below) 0.0001 SOL, only a very few Anti-MEV routes take it. Past your slippage the transaction is dropped and shows as not filled, still with a small on-chain fee. Raise the tip, widen slippage or turn off Anti-MEV. | |
data.created_at | string | ✓ | Creation time in RFC 3339 UTC. |
data.updated_at | string | ✓ | Last item update time in RFC 3339 UTC. |
meta | object | ✓ | Request id, plus paging fields when this operation is a list. |
meta.request_id | string | ✓ | Id of this request. Also sent as the X-Request-Id response header. |
meta.persistence | enum ("committed") | ✓ | The write has been committed to storage. |
warnings | array<object | object> | ✓ | Advisory fees from the saved configuration. The write succeeded. No confirmation or retry is needed. Empty when no threshold is exceeded. |
400 — validation_error / missing_idempotency_key / unsupported_chain_feature
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | ✓ | Why the request failed. |
error.code | string | ✓ | Stable machine-readable error code. |
error.message | string | ✓ | Human-readable explanation of the error. |
error.total | number | Number of distinct blacklisted wallets the account would have on this chain after saving. | |
error.limit | number | Maximum distinct blacklisted wallets per account on this chain. | |
error.details | array<object> | Only present when at least one field-level validation issue exists. | |
error.details[].field | string | ✓ | Request field this issue refers to, or a dotted path such as buy.amount. |
error.details[].reason | string | ✓ | Why that field was rejected. |
error.details[].code | string | Stable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change. | |
meta | object | ✓ | Request id for this failure. |
meta.request_id | string | ✓ | Id of this request. Also sent as the X-Request-Id response header. |
401 — unauthorized (missing/invalid/revoked/expired Bearer token)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | ✓ | Why the request failed. |
error.code | string | ✓ | Stable machine-readable error code. |
error.message | string | ✓ | Human-readable explanation of the error. |
error.total | number | Number of distinct blacklisted wallets the account would have on this chain after saving. | |
error.limit | number | Maximum distinct blacklisted wallets per account on this chain. | |
error.details | array<object> | Only present when at least one field-level validation issue exists. | |
error.details[].field | string | ✓ | Request field this issue refers to, or a dotted path such as buy.amount. |
error.details[].reason | string | ✓ | Why that field was rejected. |
error.details[].code | string | Stable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change. | |
meta | object | ✓ | Request id for this failure. |
meta.request_id | string | ✓ | Id of this request. Also sent as the X-Request-Id response header. |
403 — insufficient_scope / ip_not_allowed
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | ✓ | Why the request failed. |
error.code | string | ✓ | Stable machine-readable error code. |
error.message | string | ✓ | Human-readable explanation of the error. |
error.total | number | Number of distinct blacklisted wallets the account would have on this chain after saving. | |
error.limit | number | Maximum distinct blacklisted wallets per account on this chain. | |
error.details | array<object> | Only present when at least one field-level validation issue exists. | |
error.details[].field | string | ✓ | Request field this issue refers to, or a dotted path such as buy.amount. |
error.details[].reason | string | ✓ | Why that field was rejected. |
error.details[].code | string | Stable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change. | |
meta | object | ✓ | Request id for this failure. |
meta.request_id | string | ✓ | Id of this request. Also sent as the X-Request-Id response header. |
404 — not_found
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | ✓ | Why the request failed. |
error.code | string | ✓ | Stable machine-readable error code. |
error.message | string | ✓ | Human-readable explanation of the error. |
error.total | number | Number of distinct blacklisted wallets the account would have on this chain after saving. | |
error.limit | number | Maximum distinct blacklisted wallets per account on this chain. | |
error.details | array<object> | Only present when at least one field-level validation issue exists. | |
error.details[].field | string | ✓ | Request field this issue refers to, or a dotted path such as buy.amount. |
error.details[].reason | string | ✓ | Why that field was rejected. |
error.details[].code | string | Stable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change. | |
meta | object | ✓ | Request id for this failure. |
meta.request_id | string | ✓ | Id of this request. Also sent as the X-Request-Id response header. |
409 — version_conflict / auto_sell_wallet_conflict / auto_sell_default_conflict / not_paused / idempotency_conflict / idempotency_in_progress
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | ✓ | Why the request failed. |
error.code | string | ✓ | Stable machine-readable error code. |
error.message | string | ✓ | Human-readable explanation of the error. |
error.total | number | Number of distinct blacklisted wallets the account would have on this chain after saving. | |
error.limit | number | Maximum distinct blacklisted wallets per account on this chain. | |
error.details | array<object> | Only present when at least one field-level validation issue exists. | |
error.details[].field | string | ✓ | Request field this issue refers to, or a dotted path such as buy.amount. |
error.details[].reason | string | ✓ | Why that field was rejected. |
error.details[].code | string | Stable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change. | |
meta | object | ✓ | Request id for this failure. |
meta.request_id | string | ✓ | Id of this request. Also sent as the X-Request-Id response header. |
412 — version_conflict (malformed If-Match)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | ✓ | Why the request failed. |
error.code | string | ✓ | Stable machine-readable error code. |
error.message | string | ✓ | Human-readable explanation of the error. |
error.total | number | Number of distinct blacklisted wallets the account would have on this chain after saving. | |
error.limit | number | Maximum distinct blacklisted wallets per account on this chain. | |
error.details | array<object> | Only present when at least one field-level validation issue exists. | |
error.details[].field | string | ✓ | Request field this issue refers to, or a dotted path such as buy.amount. |
error.details[].reason | string | ✓ | Why that field was rejected. |
error.details[].code | string | Stable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change. | |
meta | object | ✓ | Request id for this failure. |
meta.request_id | string | ✓ | Id of this request. Also sent as the X-Request-Id response header. |
428 — precondition_required
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | ✓ | Why the request failed. |
error.code | string | ✓ | Stable machine-readable error code. |
error.message | string | ✓ | Human-readable explanation of the error. |
error.total | number | Number of distinct blacklisted wallets the account would have on this chain after saving. | |
error.limit | number | Maximum distinct blacklisted wallets per account on this chain. | |
error.details | array<object> | Only present when at least one field-level validation issue exists. | |
error.details[].field | string | ✓ | Request field this issue refers to, or a dotted path such as buy.amount. |
error.details[].reason | string | ✓ | Why that field was rejected. |
error.details[].code | string | Stable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change. | |
meta | object | ✓ | Request id for this failure. |
meta.request_id | string | ✓ | Id of this request. Also sent as the X-Request-Id response header. |
429 — rate_limited (Retry-After response header set)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | ✓ | Why the request failed. |
error.code | string | ✓ | Stable machine-readable error code. |
error.message | string | ✓ | Human-readable explanation of the error. |
error.total | number | Number of distinct blacklisted wallets the account would have on this chain after saving. | |
error.limit | number | Maximum distinct blacklisted wallets per account on this chain. | |
error.details | array<object> | Only present when at least one field-level validation issue exists. | |
error.details[].field | string | ✓ | Request field this issue refers to, or a dotted path such as buy.amount. |
error.details[].reason | string | ✓ | Why that field was rejected. |
error.details[].code | string | Stable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change. | |
meta | object | ✓ | Request id for this failure. |
meta.request_id | string | ✓ | Id of this request. Also sent as the X-Request-Id response header. |
500 — internal_error
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | ✓ | Why the request failed. |
error.code | string | ✓ | Stable machine-readable error code. |
error.message | string | ✓ | Human-readable explanation of the error. |
error.total | number | Number of distinct blacklisted wallets the account would have on this chain after saving. | |
error.limit | number | Maximum distinct blacklisted wallets per account on this chain. | |
error.details | array<object> | Only present when at least one field-level validation issue exists. | |
error.details[].field | string | ✓ | Request field this issue refers to, or a dotted path such as buy.amount. |
error.details[].reason | string | ✓ | Why that field was rejected. |
error.details[].code | string | Stable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change. | |
meta | object | ✓ | Request id for this failure. |
meta.request_id | string | ✓ | Id of this request. Also sent as the X-Request-Id response header. |
curl -X PATCH "https://api.apm.fun/v1/auto-sell-tasks/cfg_8f2a1c9b" \
-H "Authorization: Bearer apm_live_<prefix>.<secret>" \
-H "If-Match: "3"" \
-H "Content-Type: application/merge-patch+json" \
-d '{
"name": "Updated protection"
}' {
"data": {
"id": "cfg_8f2a1c9b",
"chain": "string",
"name": "string",
"status": "active",
"version": null,
"sync_state": "string",
"covers_new_wallets": true,
"wallets": [
"0x8f2a1c9bde34567890abcdef1234567890abcdef"
],
"covered_wallets": [
"0x8f2a1c9bde34567890abcdef1234567890abcdef"
],
"rule": {
"enabled": true,
"min_sell_usd": "string",
"retain_bps": 0,
"scope": "string",
"exits": {},
"sell": {
"slippage_pct": "12.50",
"gas": {
"priority_fee": "0.05",
"landing_fee": "0.05",
"auto_gas": true,
"high_tip": {
"enabled": true,
"priority_fee": "0.05",
"landing_fee": "0.05"
},
"anti_mev": true
}
}
},
"created_at": "string",
"updated_at": "string"
},
"meta": {
"request_id": "cfg_8f2a1c9b",
"persistence": "committed"
},
"warnings": [
{
"code": "high_fee",
"path": "string",
"side": "buy",
"item": "priority_fee",
"amount": "0.05",
"threshold": "string",
"unit": "SOL"
}
]
}