piker/piker/brokers
Gud Boi db3d41a022 .ib.broker: eagerly pre-qualify pp/order mkts
Follow-up to the lazy order-req qualify: pre-qualify (and
cache) contracts for ALL already-open pps and orders during
`open_trade_dialog()` startup so live submissions NEVER pay
a first-request qualification delay; the warmup runs before
the order handler task starts so early reqs just buffer in
the ems IPC stream. Any brand-new mkt still lazily
qualifies on its first submission.

Deats,
- factor the `Client` lookup-table writes out of
  `.symbols.get_mkt_info()` into a new `cache_contract()`
  helper which now ALSO keys `_contracts` by `mkt.fqme`
  (read by the fill-time pp-update path in
  `emit_pp_update()`) alongside `mkt.bs_fqme` (read by
  `Client.submit_limit()`); resolves the old "post-split
  mktmap lookup" TODO.
- explicitly `cache_contract()` in
  `handle_order_requests()` since the lifo-cache may
  deliver a hit (body skipped) when another acct/client
  already qualified the fqme.
- filter `None` entries (ambiguous contracts) from
  `qualifyContractsAsync()` results in
  `Client.find_contracts()` before any attr access + raise
  a better "use a (more) venue-qualified fqme" error msg.
- relay ALL (non-cancel) errors from the aio method-relay
  task to the `trio`-side caller instead of crashing the
  whole proxy/dialog; critical post-`datad`-split where eg.
  qualification failures are expected to be caught
  per-request by order/warmup code.
- handle inline `('event', ...)` api-farm status msgs in
  `MethodProxy._run_method()` at info-level instead of the
  "UNKNOWN IB MSG" warning.
- only `log.setLevel()` in `open_trade_dialog()`;
  attaching a handler via `get_console_log()` double-prints
  every record since the daemon fixture already enables the
  console handler on the parent subsys logger.

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-11-09 17:06:33 -05:00
..
binance Declare per-daemon-kind backend mod groups 2026-11-09 17:02:44 -05:00
deribit Declare per-daemon-kind backend mod groups 2026-11-09 17:02:44 -05:00
ib .ib.broker: eagerly pre-qualify pp/order mkts 2026-11-09 17:06:33 -05:00
kraken Declare per-daemon-kind backend mod groups 2026-11-09 17:02:44 -05:00
__init__.py Use `__name__` for loggers across most sub-mods 2026-02-23 12:22:48 -05:00
_daemon.py brokerd: slim RPC caps + `ib` client-id offset 2026-11-09 17:05:43 -05:00
_util.py Register all custom excs with `tractor` IPC 2026-10-07 03:10:41 -04:00
cli.py .data: cut feed layer over to `datad` actors 2026-11-09 17:05:43 -05:00
core.py .data: cut feed layer over to `datad` actors 2026-11-09 17:05:43 -05:00
data.py Update `tractor` private-API refs across codebase 2026-10-07 03:10:41 -04:00
kucoin.py Update to latest `KucoinMktPair` spec 2025-02-12 18:08:40 -05:00
questrade.py Register all custom excs with `tractor` IPC 2026-10-07 03:10:41 -04:00
robinhood.py Use `__name__` for loggers across most sub-mods 2026-02-23 12:22:48 -05:00