bifitnex-trading/memory/feedback_api_errors.md
kroutony 84093929d1 Backup Claude memory files to project repo
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:23:22 +00:00

20 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
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 噪音和後續邏輯誤判