{"record":{"id":"aaa42f622212b65d","repo":"nautechsystems/nautilus_trader","slug":"limit-sell-orders-require-quote-quantity-false-am","errorCode":null,"errorMessage":"Limit SELL orders require quote_quantity=false (amount in shares)","messagePattern":"Limit SELL orders require quote_quantity=false \\(amount in shares\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/polymarket/src/execution/submitter.rs","lineNumber":446,"sourceCode":"        requests: &[LimitOrderSubmitRequest],\n    ) -> Vec<anyhow::Result<SignedLimitOrderSubmission>> {\n        let futures = requests\n            .iter()\n            .map(|request| self.prepare_limit_order_submission(request));\n        futures_util::future::join_all(futures).await\n    }\n\n    pub(crate) async fn prepare_limit_order_submission(\n        &self,\n        request: &LimitOrderSubmitRequest,\n    ) -> anyhow::Result<SignedLimitOrderSubmission> {\n        let order_type = PolymarketOrderType::try_from(request.time_in_force)\n            .map_err(|e| anyhow::anyhow!(\"Unsupported time in force: {e}\"))?;\n        let side = PolymarketOrderSide::from(request.side);\n        let expiration = limit_order_expiration(request.expire_time);\n\n        let order = if request.quote_quantity {\n            anyhow::ensure!(\n                side == PolymarketOrderSide::Buy,\n                \"Limit SELL orders require quote_quantity=false (amount in shares)\"\n            );\n            self.order_builder.build_limit_order_from_collateral(\n                &request.token_id,\n                request.price.as_decimal(),\n                request.quantity.as_decimal(),\n                &expiration,\n                request.neg_risk,\n                request.tick_decimals,\n            )\n        } else {\n            self.order_builder.build_limit_order(\n                &request.token_id,\n                side,\n                request.price.as_decimal(),\n                request.quantity.as_decimal(),\n                order_type,","sourceCodeStart":428,"sourceCodeEnd":464,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/polymarket/src/execution/submitter.rs#L428-L464","documentation":"Raised via anyhow::ensure! in `prepare_limit_order_submission` when a limit SELL order is requested with quote_quantity=true, i.e. the amount is denominated in USDC collateral rather than shares. Polymarket only supports collateral-denominated (quote) amounts on the BUY side, so the adapter rejects quote-denominated SELLs outright. This is a pre-trade validation; nothing is signed or sent.","triggerScenarios":"Constructing a LimitOrderSubmitRequest with side=Sell and quote_quantity=true (amount interpreted as USDC).","commonSituations":"Copy-pasting BUY-side order construction code for SELLs; risk/sizing engines that uniformly express target exposure in quote currency; adapter upgrades where quote_quantity defaults flipped.","solutions":["Set quote_quantity=false for SELL limit orders and express the amount in shares","Flip the sizing logic so SELL quantities are computed in base (share) units","Add a client-side pre-check mirroring this constraint before calling the submitter"],"exampleFix":"// before\nlet req = LimitOrderSubmitRequest { side: OrderSide::Sell, quote_quantity: true, amount: usdc_amount, .. };\n// after\nlet req = LimitOrderSubmitRequest { side: OrderSide::Sell, quote_quantity: false, amount: share_amount, .. };","handlingStrategy":"validation","validationCode":"if req.side == OrderSide::Sell && req.quote_quantity {\n    return Err(anyhow!(\"SELL limit orders must be share-denominated\"));\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = prepare_limit_order_submission(&req).await {\n    if e.to_string().contains(\"Limit SELL orders require quote_quantity=false\") {\n        // rebuild request with quote_quantity=false and share-denominated amount\n    }\n}","preventionTips":["Denominate SELL order amounts in shares by convention","Add a unit test asserting SELL requests use quote_quantity=false"],"tags":["polymarket","limit-order","validation","side"],"backgroundTag":"invalid-argument-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}