feat: use broker-authoritative qty in slots RPC holdings
Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
co-authored by
genichin
parent
832dcb5fbb
commit
30bcbe1d12
@@ -152,7 +152,8 @@ def _cmd_universe(args, cfg, rpc) -> int:
|
||||
f"degraded={resp.get('degraded')}")
|
||||
for s in slots:
|
||||
print(f" {s.get('portfolio_id')}\t{s.get('symbol')}\t"
|
||||
f"qty(hub)={s.get('asset_quantity')}\tqty(slot)={s.get('qty')}")
|
||||
f"qty(hub)={s.get('asset_quantity')}\t"
|
||||
f"qty(slot)={s.get('slot_quantity', s.get('qty'))}")
|
||||
return 0
|
||||
|
||||
|
||||
@@ -192,7 +193,8 @@ def _cmd_slots(args, cfg, rpc) -> int:
|
||||
wd = s.get("watchdog") or {}
|
||||
tag = " [WATCHDOG: strategy absent]" if wd.get("expired") else ""
|
||||
print(f" {s.get('slot_id')}\t{s.get('status')}\t{s.get('symbol')}\t"
|
||||
f"qty={s.get('qty')}\taqty={s.get('asset_quantity')}\t"
|
||||
f"qty={s.get('qty')}\tsqty={s.get('slot_quantity')}\t"
|
||||
f"aqty={s.get('asset_quantity')}\t"
|
||||
f"limit={s.get('entry_price')}\tavg={s.get('avg_price')}\t"
|
||||
f"pid={pid}\tpaused={s.get('paused')}\twarned={s.get('warned')}{tag}")
|
||||
return 0
|
||||
@@ -205,7 +207,11 @@ def _print_slot_detail(s: dict) -> None:
|
||||
("status", s.get("status")),
|
||||
("symbol", s.get("symbol")),
|
||||
("portfolio_id", s.get("portfolio_id")),
|
||||
("qty (slot mirror)", s.get("qty")),
|
||||
("qty (authoritative)", s.get("qty")),
|
||||
("slot_quantity (core mirror)", s.get("slot_quantity")),
|
||||
("qty_source", s.get("qty_source")),
|
||||
("broker_quantity_available", s.get("broker_quantity_available")),
|
||||
("broker_quantity_captured_at", s.get("broker_quantity_captured_at")),
|
||||
("asset_quantity (hub)", s.get("asset_quantity")),
|
||||
("warned", s.get("warned")),
|
||||
("avg_price", s.get("avg_price")),
|
||||
|
||||
Reference in New Issue
Block a user