Skip to content

[Databento] Add symbol_venue_overrides config for Databento adapter #3451

@shzhng

Description

@shzhng

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 OPRA as 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

  1. Symbol prefixes are matched against raw_symbol from Databento
  2. If a prefix matches, use the override venue instead of OPRA
  3. Instruments get cached under the override venue (e.g., SPXW 260120P06835000.XCBO)
  4. IB orders can now find the instruments in cache

Implementation Notes

The feature would require changes to:

  1. Python side: Add symbol_venue_overrides: dict[str, str] | None field to DatabentoDataClientConfig
  2. Rust side:
    • Add the field to DatabentoLiveClient in python/live.rs
    • Add the field to DatabentoFeedHandler in live.rs
    • Update update_instrument_id_map() to check prefix matches before falling back to publisher_venue_map

Related

This is similar to how the IB adapter handles symbol_to_mic_venue mappings for routing purposes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    adapterNautilus integration with external systemsimprovementImprovement to existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions