nautechsystems/nautilus_trader · error
Quote-denominated quantities are not supported; quantity mus
Error message
Quote-denominated quantities are not supported; quantity must be denominated in the base token
What it means
This adapter requires the order quantity to be denominated in the base token of the trading pair; quote-denominated quantities (e.g. spend 1000 USDC) are not supported because the swap math is computed from the base amount. is_quote_quantity() returning true aborts the swap preparation.
Source
Thrown at crates/adapters/blockchain/src/execution/client.rs:1566
let instrument_id = order.instrument_id();
let pool = self.resolve_pool(&instrument_id)?;
if order.order_type() != OrderType::Market {
anyhow::bail!(
"Unsupported order type {}; only Market is supported",
order.order_type()
);
}
if !matches!(order.order_side(), OrderSide::Buy | OrderSide::Sell) {
anyhow::bail!(
"Unsupported order side {}; only Buy and Sell are supported",
order.order_side()
);
}
if order.is_quote_quantity() {
anyhow::bail!(
"Quote-denominated quantities are not supported; quantity must be denominated in the base token"
);
}
let fee = pool
.fee
.ok_or_else(|| anyhow::anyhow!("Pool {instrument_id} has no fee tier"))?;
let fee = U24::try_from(fee)
.map_err(|_| anyhow::anyhow!("Pool {instrument_id} fee {fee} exceeds uint24"))?;
let base_token = pool.get_base_token();
let quote_token = pool.get_quote_token();
let quote_currency = Currency::new_checked(
"e_token.symbol,
quote_token.decimals,
0,
"e_token.name,
CurrencyType::Crypto,View on GitHub (pinned to 18893faf8b)
Solutions
- Convert the desired quote amount to a base-token quantity (divide by current price) and set the order quantity in base units.
- Change the strategy/position sizing configuration to emit base-denominated quantities for this venue.
Example fix
// before order.set_quantity(Quantity::new(1000.0, 2)); // 1000 quote units client.submit_order(cmd, &order)?; // after let price = latest_mid_price(instrument_id); let base_qty = 1000.0 / price; order.set_quantity(Quantity::new(base_qty, base_token.decimals)); client.submit_order(cmd, &order)?;
Defensive patterns
Strategy: validation
Validate before calling
// Rust
if order.is_quote_quantity() {
// convert to base before submitting
let base_qty = quote_qty / current_price(instrument_id);
order.set_quantity(Quantity::new(base_qty, base_decimals));
} Prevention
- Configure position sizing in base-token units for DEX venues.
- Convert notional sizes at signal time using the latest price.
- Assert !order.is_quote_quantity() in strategy unit tests.
When it happens
Trigger: submit_order called with an order whose quantity is expressed in the quote currency (order.is_quote_quantity() == true), typically when the strategy sets a quote-currency size or uses a 'notional' quantity mode.
Common situations: Porting a strategy that sizes positions in quote currency (USD value) to this adapter; risk sizing modules that emit notional quantities; misconfigured order factories defaulting to quote quantity.
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
- HyperSync parsing of swap event is not defined in this dex:
- Unsupported order type {}; only Market is supported
- No deployed bytecode at {description} address {address}
- Venue execution reports are not supported on the blockchain
- HyperSync parsing of pool created event is not defined in th
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/a4e6e95d0ae1f323.
Report an issue: GitHub.