nautechsystems/nautilus_trader · error

Cannot subscribe for synthetic instrument `OptionGreeks` dat

Error message

Cannot subscribe for synthetic instrument `OptionGreeks` data

What it means

OptionGreeks data is computed or provided by specific data clients and is not supported for synthetic instruments in this engine path. The engine bails on SubscribeCommand::OptionGreeks when the instrument ID is synthetic.

Source

Thrown at crates/data/src/engine/mod.rs:1105

            {
                self.subscribe_spread_quotes(cmd);
                return Ok(());
            }
            SubscribeCommand::Trades(cmd) if cmd.instrument_id.is_synthetic() => {
                self.subscribe_synthetic_trades(cmd.instrument_id);
                return Ok(());
            }
            SubscribeCommand::Instrument(cmd) if cmd.instrument_id.is_synthetic() => {
                anyhow::bail!("Cannot subscribe for synthetic instrument `Instrument` data");
            }
            SubscribeCommand::InstrumentStatus(cmd) if cmd.instrument_id.is_synthetic() => {
                anyhow::bail!("Cannot subscribe for synthetic instrument `InstrumentStatus` data");
            }
            SubscribeCommand::InstrumentClose(cmd) if cmd.instrument_id.is_synthetic() => {
                anyhow::bail!("Cannot subscribe for synthetic instrument `InstrumentClose` data");
            }
            SubscribeCommand::OptionGreeks(cmd) if cmd.instrument_id.is_synthetic() => {
                anyhow::bail!("Cannot subscribe for synthetic instrument `OptionGreeks` data");
            }
            _ => {} // Do nothing else
        }

        let retained = cmd.clone();

        // Book ownership, including failed acquisitions, is already counted by the engine
        let retain_on_failure = !matches!(
            &cmd,
            SubscribeCommand::BookDeltas(_) | SubscribeCommand::BookDepth10(_)
        );

        #[cfg(feature = "streaming")]
        let cmd = self.subscribe_command_with_prefilled_start_ns(cmd)?;

        if let Some(client) = self.get_command_client(cmd.client_id(), cmd.venue()) {
            client.execute_subscribe_with_retained(cmd, retained, retain_on_failure);
        } else {

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Only subscribe to OptionGreeks for real (non-synthetic) instrument IDs.
  2. Filter out ids where is_synthetic() is true before issuing greeks subscriptions.
  3. Compute greeks locally for synthetic instruments instead of requesting them from the data engine.

Example fix

// before
engine.subscribe_option_greeks(synthetic_option_id)?;
// after
if !synthetic_option_id.is_synthetic() {
    engine.subscribe_option_greeks(synthetic_option_id)?;
}
Defensive patterns

Strategy: type-guard

Validate before calling

// Rust
if !option_id.is_synthetic() {
    engine.subscribe_option_greeks(option_id)?;
}

Type guard

// Rust
fn supports_greeks_subscription(id: &InstrumentId) -> bool {
    !id.is_synthetic()
}

Try / catch

// Rust
if let Err(e) = engine.subscribe_option_greeks(id) {
    if e.to_string().contains("synthetic instrument `OptionGreeks`") {
        // compute greeks locally instead
        compute_local_greeks(id);
    } else {
        return Err(e.into());
    }
}

Prevention

When it happens

Trigger: Subscribing to OptionGreeks with a synthetic InstrumentId (is_synthetic() == true).

Common situations: Options strategy templates that subscribe to greeks for all option instruments, where some option IDs are synthetic/generated rather than venue-listed.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/be51e6594ea341d7. Report an issue: GitHub.