-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
adapterNautilus integration with external systemsNautilus integration with external systemsimprovementImprovement to existing functionalityImprovement to existing functionality
Description
Problem
When using both Databento and Interactive Brokers adapters, options (specifically index and equity, unconfirmed for futures options) instruments can end up cached under different venue IDs for the same underlying symbol, causing cache lookup failures.
Background Discussion
From Discord (#interactive_brokers channel) between myself and @faysou:
- Databento uses OPRA as the venue for options (e.g.,
SPXW 260120P06835000.OPRA) - IB uses XCBO for the same options (e.g.,
SPXW260120P06835000.XCBO) - The venue mismatch means instruments subscribed via Databento can't be found in cache when placing orders via IB
Use Case
Trading SPX/SPXW options where:
- Market data comes from Databento (which now will have
OPRAas the "venue" for all options due the consolidated tape changes) - Order execution goes through IB (using XCBO venue)
- Need instruments to be cached under the same venue ID
Proposed Solution
Add a symbol_venue_overrides configuration option to DatabentoDataClientConfig that allows mapping symbol prefixes to specific venues. This would override the default venue resolution from the publisher map.
Example Configuration
DatabentoDataClientConfig(
api_key="...",
symbol_venue_overrides={
"SPX": "XCBO",
"SPXW": "XCBO",
"VIX": "XCBO",
"VIXW": "XCBO",
}
)How it would work
- Symbol prefixes are matched against raw_symbol from Databento
- If a prefix matches, use the override venue instead of OPRA
- Instruments get cached under the override venue (e.g.,
SPXW 260120P06835000.XCBO) - IB orders can now find the instruments in cache
Implementation Notes
The feature would require changes to:
- Python side: Add
symbol_venue_overrides: dict[str, str] | Nonefield toDatabentoDataClientConfig - Rust side:
- Add the field to
DatabentoLiveClientinpython/live.rs - Add the field to
DatabentoFeedHandlerinlive.rs - Update
update_instrument_id_map()to check prefix matches before falling back to publisher_venue_map
- Add the field to
Related
This is similar to how the IB adapter handles symbol_to_mic_venue mappings for routing purposes.
cjdsellers
Metadata
Metadata
Assignees
Labels
adapterNautilus integration with external systemsNautilus integration with external systemsimprovementImprovement to existing functionalityImprovement to existing functionality