nautechsystems/nautilus_trader · error

Invalid account currency code: {code}

Error message

Invalid account currency code: {code}

What it means

Error "Invalid account currency code: {code}" thrown in nautechsystems/nautilus_trader.

Source

Thrown at crates/adapters/betfair/src/config.rs:39

use nautilus_model::{
    identifiers::{AccountId, TraderId},
    types::{Currency, Money},
};
use rust_decimal::Decimal;
use serde::{Deserialize, Serialize};

use crate::{
    common::{
        credential::{BetfairCredential, CredentialError},
        parse::parse_betfair_timestamp,
    },
    provider::NavigationFilter,
    stream::config::BetfairStreamConfig,
};

fn parse_currency(code: &str) -> anyhow::Result<Currency> {
    code.parse::<Currency>()
        .map_err(|_| anyhow::anyhow!("Invalid account currency code: {code}"))
}

fn make_min_notional(value: Option<Decimal>, currency: Currency) -> anyhow::Result<Option<Money>> {
    value
        .map(|amount| Money::from_decimal(amount, currency))
        .transpose()
        .map_err(Into::into)
}

fn validate_market_start_time(label: &str, value: &Option<String>) -> anyhow::Result<()> {
    if let Some(value) = value {
        parse_betfair_timestamp(value)
            .map(|_| ())
            .map_err(|e| anyhow::anyhow!("Invalid {label} '{value}': {e}"))?;
    }

    Ok(())
}

View on GitHub (pinned to a4b06ed870)

When it happens

Trigger: Thrown at crates/adapters/betfair/src/config.rs:39 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of nautechsystems/nautilus_trader@a4b06ed870 (2026-08-16). Data as JSON: /api/errors/4e7450d1f017c12b. Report an issue: GitHub.