nautechsystems/nautilus_trader · error · anyhow::Error

Unsupported order type for Hyperliquid: {order_type:?}

Error message

Unsupported order type for Hyperliquid: {order_type:?}

What it means

This is the catch-all branch of the order-type mapping in the Hyperliquid adapter. Only the order types explicitly handled above (Market, Limit, MarketIfTouched, LimitIfTouched, etc.) are supported by Hyperliquid; any other Nautilus order type falls into the wildcard and is rejected with the unsupported type's Debug representation interpolated into the message.

Source

Thrown at crates/adapters/hyperliquid/src/common/parse.rs:636

            if let Some(trigger_price) = order.trigger_price() {
                let raw = trigger_price.as_decimal();
                let trigger_price_decimal = if should_normalize_prices {
                    normalize_price(raw, price_decimals).normalize()
                } else {
                    raw.normalize()
                };
                HyperliquidExchangeOrderKind::Trigger {
                    trigger: HyperliquidExchangeTriggerParams {
                        is_market: false,
                        trigger_px: trigger_price_decimal,
                        tpsl: HyperliquidExchangeTpSl::Tp,
                    },
                }
            } else {
                anyhow::bail!("Limit-if-touched orders require a trigger price")
            }
        }
        _ => anyhow::bail!("Unsupported order type for Hyperliquid: {order_type:?}"),
    };

    Ok(HyperliquidExchangePlaceOrderRequest {
        asset,
        is_buy,
        price: price_decimal,
        size: size_decimal,
        reduce_only,
        kind,
        cloid,
    })
}

/// Default slippage buffer in basis points for MARKET orders.
pub const DEFAULT_MARKET_SLIPPAGE_BPS: u32 = 50;

/// Derives a market order limit price from a quote with a configurable
/// slippage buffer in basis points, rounded to 5 significant figures and

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Restrict the strategy to order types Hyperliquid supports (Market, Limit, and trigger-based MIT/LIT).
  2. Emulate unsupported types (e.g. trailing stops) client-side with regular trigger orders and strategy-level updates.
  3. Check the adapter's supported OrderType mapping and file/await an upstream feature request for the needed type.

Example fix

// before
let order = self.order_factory.trailing_stop_market(...); // unsupported on Hyperliquid
// after
let order = self.order_factory.market_if_touched(
    instrument_id, side, qty, Some(trigger_price), TimeInForce::Gtc,
);
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED: &[OrderType] = &[OrderType::Market, OrderType::Limit, OrderType::MarketIfTouched, OrderType::LimitIfTouched];
if !SUPPORTED.contains(&order.order_type()) {
    return Err(format!("{:?} not supported on Hyperliquid", order.order_type()));
}

Prevention

When it happens

Trigger: Calling submit_order/modify_order/order_request with an order type not implemented in the mapping — e.g. TrailingStopMarket, TrailingStopLimit, or another venue-specific order type on Hyperliquid.

Common situations: Running a multi-venue strategy unchanged against Hyperliquid when it was written for a venue supporting trailing stops or other exotic order types; upgrades where a new order type is used before adapter support exists.

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


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/8713f28622a6c433. Report an issue: GitHub.