Fall back to `con.exchange` in IB ledger fill loop

Use `con.primaryExchange or con.exchange` so
`pexch` is populated even when `primaryExchange`
is empty (e.g. for certain combo/forex fills).

(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
kraken_stale_ws_token
Gud Boi 2026-04-15 19:05:46 -04:00
parent d06bbec24f
commit d1eec24ed5
1 changed files with 1 additions and 1 deletions

View File

@ -501,7 +501,7 @@ async def update_ledger_from_api_trades(
for fill in fills:
con: Contract = fill.contract
conid: str = con.conId
pexch: str | None = con.primaryExchange
pexch: str|None = con.primaryExchange or con.exchange
if not pexch:
cons = await client.get_con(conid=conid)