20 lines
1.2 KiB
Markdown
20 lines
1.2 KiB
Markdown
---
|
||
name: feedback_api_errors
|
||
description: Bitfinex API 500 error patterns and fixes — stop ID staleness, min order size, balance locking
|
||
type: feedback
|
||
---
|
||
|
||
1. **止損 ID 過期導致 SELL 失敗**:step 2b 重掛止損後必須更新 `stop_orders_by_sym`,否則 step 10 SELL 時取消的是舊 ID,真正的止損還在鎖餘額。
|
||
**Why:** ETH SELL 反覆 500 "not enough balance" 因為 available=0(被止損鎖住)。
|
||
**How to apply:** step 2b 掛新止損後立即更新 `stop_orders_by_sym[sym]`。
|
||
|
||
2. **小倉位不掛止損**:低於 `MIN_ORDER_AMOUNT` 的殘留持倉(如 XRP 0.017 < 最低 4)不能掛止損,會被交易所拒絕。
|
||
**Why:** Bitfinex 500 "minimum size for XRPUST is 4"。
|
||
**How to apply:** `main.py` step 2b 和 `trader.place_stop_loss_order` 都檢查最低量。
|
||
|
||
3. **報告排除小倉位**:`_build_portfolio_one_liner` 中,amount < MIN_ORDER_AMOUNT 的持倉不計入持倉數和總值。
|
||
**Why:** 殘留微量幣(如賣出後剩 0.017 XRP)不是真正的持倉。
|
||
|
||
4. **Cancel "Order not found" 不是錯誤**:訂單可能已被觸發或過期,返回 True 即可。
|
||
**Why:** 避免 log 噪音和後續邏輯誤判。
|