{"record":{"id":"b23debe3ea6bd160","repo":"nautechsystems/nautilus_trader","slug":"reduce-only-is-not-supported-for-hyperliquid-hip-4","errorCode":null,"errorMessage":"Reduce-only is not supported for Hyperliquid HIP-4 outcomes: {symbol}","messagePattern":"Reduce-only is not supported for Hyperliquid HIP-4 outcomes: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/hyperliquid/src/execution.rs","lineNumber":2722,"sourceCode":"\n    match order.order_type() {\n        OrderType::Market\n        | OrderType::Limit\n        | OrderType::StopMarket\n        | OrderType::StopLimit\n        | OrderType::MarketIfTouched\n        | OrderType::LimitIfTouched => {}\n        _ => anyhow::bail!(\n            \"Unsupported order type for Hyperliquid: {:?}\",\n            order.order_type()\n        ),\n    }\n\n    // HIP-4 outcomes are fully-collateralized side tokens with no margin,\n    // funding, or trigger machinery. Reject features that don't apply.\n    if product_type == HyperliquidProductType::Outcome {\n        if order.is_reduce_only() {\n            anyhow::bail!(\"Reduce-only is not supported for Hyperliquid HIP-4 outcomes: {symbol}\");\n        }\n\n        if !matches!(order.order_type(), OrderType::Market | OrderType::Limit) {\n            anyhow::bail!(\n                \"Trigger order types are not supported for Hyperliquid HIP-4 outcomes: \\\n                 {symbol} (received {:?})\",\n                order.order_type()\n            );\n        }\n    }\n\n    if matches!(\n        order.order_type(),\n        OrderType::StopMarket\n            | OrderType::StopLimit\n            | OrderType::MarketIfTouched\n            | OrderType::LimitIfTouched\n    ) && order.trigger_price().is_none()","sourceCodeStart":2704,"sourceCodeEnd":2740,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/execution.rs#L2704-L2740","documentation":"HIP-4 outcome tokens are fully-collateralized side tokens with no margin or funding machinery, so reduce-only semantics do not apply. The adapter rejects any reduce-only order targeting an Outcome product with this error.","triggerScenarios":"Submitting an order with is_reduce_only() true where the instrument resolves to HyperliquidProductType::Outcome; e.g. reusing a close-position reduce-only flow for an outcome side token.","commonSituations":"Generic position-closing logic that always sets reduce_only, applied to HIP-4 outcome markets; strategies copied from perpetual markets and run against outcome tokens.","solutions":["Set is_reduce_only to false for orders on HIP-4 outcome instruments.","Skip reduce-only position-closing logic for outcome tokens and size the closing order explicitly instead.","Branch on the instrument's product type before submission so perp-only features are not applied to outcomes."],"exampleFix":"// before\nlet order = factory.limit(...).reduce_only();\nexec_client.submit_order(&order).await?;\n// after\nlet is_outcome = product_type == HyperliquidProductType::Outcome;\nlet order = factory.limit(...);\nlet order = if is_outcome { order } else { order.reduce_only() };\nexec_client.submit_order(&order).await?;","handlingStrategy":"validation","validationCode":"fn can_reduce_only(product_type: HyperliquidProductType) -> bool {\n    product_type != HyperliquidProductType::Outcome\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate reduce-only logic on instrument product type","Size closing orders explicitly for HIP-4 outcome tokens","Keep per-product feature matrices in strategy configuration"],"tags":["rust","hyperliquid","hip-4","reduce-only","unsupported-feature"],"backgroundTag":"unsupported-operation","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"}