nautechsystems/nautilus_trader · error · anyhow::Error

AX whoami account {} supplied no fee rates

Error message

AX whoami account {} supplied no fee rates

What it means

Thrown by request_account_fees() when GET /whoami succeeds but the selected account object has maker_fee or taker_fee set to null (the fields are Option<Decimal> in models.rs). The client deliberately refuses to substitute zero because zero is itself a valid fee rate and a silent zero would persist in cached instruments after the cause disappeared. The account id is included so you can identify which AX account is misconfigured.

Source

Thrown at crates/adapters/architect_ax/src/http/client.rs:1409

            .get_whoami()
            .await
            .map_err(|e| anyhow::anyhow!(e))
            .context("failed to request AX whoami")?;

        let Some(account) = whoami.accounts.first() else {
            anyhow::bail!("AX whoami returned no accounts to resolve fees from");
        };

        if whoami.accounts.len() > 1 {
            log::warn!(
                "AX credentials cover {} accounts, using fee rates from {}",
                whoami.accounts.len(),
                account.id,
            );
        }

        let (Some(maker_fee), Some(taker_fee)) = (account.maker_fee, account.taker_fee) else {
            anyhow::bail!("AX whoami account {} supplied no fee rates", account.id);
        };

        let fees = (maker_fee, taker_fee);
        self.account_fees.store(Some(Arc::new(fees)));

        Ok(fees)
    }

    /// Requests all instruments from Ax.
    ///
    /// Fee rates fall back to the rates last resolved from `GET /whoami`, and to zero when no
    /// rates have been resolved.
    ///
    /// # Errors
    ///
    /// Returns an error if the HTTP request fails or instrument parsing fails.
    pub async fn request_instruments(
        &self,

View on GitHub (pinned to a4b06ed870)

Solutions

  1. Verify the account fee schedule with Architect (dashboard or support) and confirm the account id in the error message actually has maker/taker rates assigned.
  2. Check which account is first in whoami.accounts: if your key covers multiple accounts, the client uses the first one, which may be the fee-less account while another account has rates.
  3. Re-run request_account_fees() after the fee schedule is attached; if AX changed the response schema, inspect the raw /whoami JSON and report the contract change.
  4. As a workaround for instrument building, call request_instruments(Some(maker), Some(taker)) with explicit rates - it does not require request_account_fees to succeed.

Example fix

// before
let (maker, taker) = client.request_account_fees().await?; // bails on null rates

// after: fall back to explicit rates while the account is fixed
let (maker, taker) = match client.request_account_fees().await {
    Ok(fees) => fees,
    Err(e) if e.to_string().contains("supplied no fee rates") => {
        log::warn!("AX fee resolution failed ({e}); using configured rates");
        (dec!(0.0002), dec!(0.0025))
    }
    Err(e) => return Err(e),
};
Defensive patterns

Strategy: try-catch

Validate before calling

// No public pre-check exists for whoami contents; validate after the call
let fees = client.request_account_fees().await;

Try / catch

match client.request_account_fees().await {
    Ok(fees) => { /* proceed */ }
    Err(e) if e.to_string().contains("supplied no fee rates") => {
        // account misconfigured: use explicitly configured rates downstream
        log::warn!("AX fee resolution failed: {e}");
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling request_account_fees() (or any startup flow that resolves fees) with credentials whose first whoami account returns "maker_fee": null or "taker_fee": null. Note an empty string "" parses to Decimal::ZERO and does NOT trigger this; only a missing/null field does.

Common situations: New or sub-account on AX without a fee schedule attached yet; API key provisioned with entitlements but no trading fee tier; AX backend/API version change dropping the fields from /whoami; test environment accounts that never had fees configured.

Related errors


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