fix: scanner netProfit 漏算exit fees + 孤儿仓位标记failed
- scanner.go: netProfit 扣费改为 2*(buyFee+sellFee) 匹配 calcArbPnL - trader.go: 第二腿失败时设 pos.Status=failed,避免语义混淆
This commit is contained in:
@@ -426,6 +426,7 @@ func (t *Trader) executeEntry(opp *ArbOpportunity, store *PriceStore, notifier *
|
||||
time.Sleep(t.cfg.LegDelay)
|
||||
if err := t.placeOrder(pos.ShortLeg, "sell", store); err != "" {
|
||||
// Leg1 placed successfully, leg2 failed — try to close leg1
|
||||
pos.Status = "failed"
|
||||
if closeErr := t.closeLeg(pos.LongLeg); closeErr != "" {
|
||||
// CRITICAL: leg1 is still open on the exchange!
|
||||
// Record the orphan so we don't silently lose tracking
|
||||
|
||||
Reference in New Issue
Block a user