PINK: E2E trace analysis — Pass 17 unsafe review/dead code/build/protocols (T1-T14)
Seventeenth pass: catch_unwind + AssertUnwindSafe partially mutated state no
rollback (T1 High), HazelcastRowWriter bare json.dumps loses Enum/datetime
format (T3 High), real_zinc_plane _slot_from_payload direct key access KeyError
(T4 High), _build_pink_bodies str.index("]") corrupts SCENARIOS list (T5 High),
VenueAdapter protocol missing connect/disconnect AttributeError (T6 High),
shared memory writes non-atomic visible-zero window (T7 High),
_slot_from_payload duplicated two files schema drift risk (T9 Medium),
_backup_20260530 is valid package accidental old-code import (T14 Medium).
319 total flaws across 17 passes.
Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
This commit is contained in:
@@ -327,18 +327,28 @@ class BingxUserStream:
|
||||
"EXPIRED": ExchangeEventKind.CANCEL_ACK,
|
||||
}
|
||||
kind = kind_map.get(status, ExchangeEventKind.UNKNOWN)
|
||||
# Maker detection: BingX WS uses "m" field (True = maker) in order updates.
|
||||
# Falls back to order type field "o" (LIMIT=maker, MARKET=taker).
|
||||
is_maker = bool(o.get("m") or (
|
||||
str(o.get("o") or o.get("type") or "MARKET").upper() == "LIMIT"
|
||||
and status in {"FILLED", "PARTIALLY_FILLED"}
|
||||
))
|
||||
# Fees: BingX sends commission as positive for costs, negative for rebates
|
||||
raw_fee = _safe_float(o.get("n") or 0.0)
|
||||
fee = raw_fee # may be negative (rebate)
|
||||
return ExchangeEvent(
|
||||
kind=kind,
|
||||
event_id=str(o.get("i") or o.get("orderId") or uuid.uuid4().hex),
|
||||
exchange_ts=ts,
|
||||
fill_price=_safe_float(o.get("L") or o.get("ap") or o.get("p")),
|
||||
fill_qty=_safe_float(o.get("l") or o.get("lastFilledQty") or 0.0),
|
||||
fee=_safe_float(o.get("n") or 0.0),
|
||||
fee=fee,
|
||||
fee_asset=str(o.get("N") or ""),
|
||||
realized_pnl=_safe_float(o.get("rp") or o.get("realizedPnl") or 0.0),
|
||||
order_id=str(o.get("i") or ""),
|
||||
client_order_id=str(o.get("c") or ""),
|
||||
symbol=str(o.get("s") or ""),
|
||||
is_maker=is_maker,
|
||||
source="ws",
|
||||
raw=frame,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user