{"record":{"id":"a4e6e95d0ae1f323","repo":"nautechsystems/nautilus_trader","slug":"quote-denominated-quantities-are-not-supported-qu","errorCode":null,"errorMessage":"Quote-denominated quantities are not supported; quantity must be denominated in the base token","messagePattern":"Quote-denominated quantities are not supported; quantity must be denominated in the base token","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":1566,"sourceCode":"        let instrument_id = order.instrument_id();\n        let pool = self.resolve_pool(&instrument_id)?;\n\n        if order.order_type() != OrderType::Market {\n            anyhow::bail!(\n                \"Unsupported order type {}; only Market is supported\",\n                order.order_type()\n            );\n        }\n\n        if !matches!(order.order_side(), OrderSide::Buy | OrderSide::Sell) {\n            anyhow::bail!(\n                \"Unsupported order side {}; only Buy and Sell are supported\",\n                order.order_side()\n            );\n        }\n\n        if order.is_quote_quantity() {\n            anyhow::bail!(\n                \"Quote-denominated quantities are not supported; quantity must be denominated in the base token\"\n            );\n        }\n\n        let fee = pool\n            .fee\n            .ok_or_else(|| anyhow::anyhow!(\"Pool {instrument_id} has no fee tier\"))?;\n        let fee = U24::try_from(fee)\n            .map_err(|_| anyhow::anyhow!(\"Pool {instrument_id} fee {fee} exceeds uint24\"))?;\n\n        let base_token = pool.get_base_token();\n        let quote_token = pool.get_quote_token();\n        let quote_currency = Currency::new_checked(\n            &quote_token.symbol,\n            quote_token.decimals,\n            0,\n            &quote_token.name,\n            CurrencyType::Crypto,","sourceCodeStart":1548,"sourceCodeEnd":1584,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L1548-L1584","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\norder.set_quantity(Quantity::new(1000.0, 2)); // 1000 quote units\nclient.submit_order(cmd, &order)?;\n// after\nlet price = latest_mid_price(instrument_id);\nlet base_qty = 1000.0 / price;\norder.set_quantity(Quantity::new(base_qty, base_token.decimals));\nclient.submit_order(cmd, &order)?;","handlingStrategy":"validation","validationCode":"// Rust\nif order.is_quote_quantity() {\n    // convert to base before submitting\n    let base_qty = quote_qty / current_price(instrument_id);\n    order.set_quantity(Quantity::new(base_qty, base_decimals));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["blockchain","quantity","unsupported-operation","swap"],"backgroundTag":"unsupported-operation","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}