nautechsystems/nautilus_trader · error · anyhow::Error

AX dated contract has different quote and settlement…

Error message

AX dated contract {} has different quote and settlement currencies: {} and {}

What it means

For dated (expiring) AX contracts, the quote currency and the funding settlement currency must be identical. The adapter enforces this because dated futures settle in their quote currency in its accounting model; a mismatch would produce inconsistent money calculations.

Solutions

  1. Verify the instrument metadata on the AX venue; if it is genuinely a mixed-settlement contract, the adapter currently does not support it.
  2. Exclude the unsupported instrument from your instrument list or request a different set of symbols.
  3. If the venue metadata is wrong, get it corrected upstream.
  4. Extend the adapter (with maintainer guidance) if support for differing quote/settlement currencies is needed.

Example fix

// before (payload)
{ "symbol": "BTC-28SEP26", "quote": "BTC", "funding_settlement_currency": "USDT", "expiration": "2026-09-28" }
// after
{ "symbol": "BTC-28SEP26", "quote": "USDT", "funding_settlement_currency": "USDT", "expiration": "2026-09-28" }
Defensive patterns

Strategy: validation

Validate before calling

fn dated_contract_supported(d: &InstrumentDefinition) -> bool {
    d.expiration.is_none() || d.quote_currency == d.funding_settlement_currency
}

Prevention

When it happens

Trigger: parse_instrument (via request_instruments/request_instrument) encountering an instrument definition with a non-None `expiration` whose quote_currency differs from funding_settlement_currency (e.g. quote BTC, settlement USDT).

Common situations: New AX listing with non-standard settlement (inverse-style contracts quoted in one currency but settled in another); wrong metadata from the venue; fixture copied from a perp and given an expiration without updating currencies.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at crates/adapters/architect_ax/src/http/parse.rs:300

        );
    }

    if let Some(v) = definition.price_band_upper_deviation_pct {
        info.insert(
            "price_band_upper_deviation_pct".to_string(),
            json!(v.to_string()),
        );
    }

    if let Some(v) = definition.price_band_lower_deviation_pct {
        info.insert(
            "price_band_lower_deviation_pct".to_string(),
            json!(v.to_string()),
        );
    }

    if let Some(expiration) = definition.expiration {
        anyhow::ensure!(
            definition.quote_currency == definition.funding_settlement_currency,
            "AX dated contract {} has different quote and settlement currencies: {} and {}",
            definition.symbol,
            definition.quote_currency,
            definition.funding_settlement_currency
        );
        let expiration_ns = datetime_to_unix_nanos(Some(expiration))
            .context("Failed to convert AX contract expiration to Unix nanoseconds")?;
        let multiplier = decimal_to_quantity(definition.multiplier, "multiplier")?;
        info.insert(
            "expiration".to_string(),
            json!(expiration.display_with_offset(Offset::UTC).to_string()),
        );
        info.insert(
            "activation_source".to_string(),
            json!("unavailable_from_ax"),
        );

View on GitHub (pinned to 18893faf8b)