piker/piker
Gud Boi b0766764f0 .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-06-10 20:09:27 -04:00
..
accounting .clearing: lazily spawn `brokerd` from `emsd` 2026-06-10 13:12:59 -04:00
brokers .ib.broker: eagerly pre-qualify pp/order mkts 2026-06-10 20:09:27 -04:00
clearing .clearing: lazily spawn `brokerd` from `emsd` 2026-06-10 13:12:59 -04:00
cli brokerd: slim RPC caps + `ib` client-id offset 2026-06-10 13:14:24 -04:00
data .data: cut feed layer over to `datad` actors 2026-06-10 13:13:44 -04:00
fsp Use `tractor.ipc._shm` types directly across codebase 2026-03-17 18:00:29 -04:00
service Add `datad` daemon machinery to `.data` 2026-06-10 13:12:26 -04:00
storage Move `reg_err_types` imports to module-level 2026-03-30 13:25:41 -04:00
testing Pass a config `tmp_dir: Path` to the runtime when testing 2023-03-09 15:37:43 -05:00
toolz Delegate `.toolz.open_crash_handler()` to `tractor.devx` 2024-01-16 10:26:38 -05:00
tsp Update `tractor` private-API refs across codebase 2026-03-24 20:21:29 -04:00
ui .data: cut feed layer over to `datad` actors 2026-06-10 13:13:44 -04:00
watchlists Add license headers to pertinent files 2020-11-06 12:23:14 -05:00
__init__.py Start `piker.service` sub-package 2023-03-09 15:37:42 -05:00
_cacheables.py Move `._cacheables.open_cached_client()` into `.brokers` pkg mod 2023-06-27 13:41:47 -04:00
calc.py Lul, adhere to returning `str`s in `humanize()` 2022-01-25 07:57:01 -05:00
config.py Fix `pytest` config-dir isolation in subactors 2026-06-10 13:10:09 -04:00
log.py Auto-enable `tractor` logging when runtime active 2026-02-23 12:22:48 -05:00
types.py Point `.types.Struct` to `tractor.msg.pretty_struct` 2026-02-22 16:07:53 -05:00