nautechsystems/nautilus_trader · error · anyhow::Error
AT_THE_CLOSE time in force is not supported by Hyperliquid
Error message
AT_THE_CLOSE time in force is not supported by Hyperliquid
What it means
nautilus_time_in_force_to_hyperliquid cannot map an AtTheClose time-in-force; Hyperliquid has no closing-auction TIF concept, so this Nautilus TIF variant has no equivalent and the conversion is rejected.
Source
Thrown at crates/adapters/hyperliquid/src/common/converters.rs:262
tif: TimeInForce,
) -> anyhow::Result<HyperliquidTimeInForce> {
match tif {
TimeInForce::Gtc => Ok(HyperliquidTimeInForce::Gtc),
TimeInForce::Ioc => Ok(HyperliquidTimeInForce::Ioc),
TimeInForce::Fok => {
anyhow::bail!("FOK time in force is not supported by Hyperliquid")
}
TimeInForce::Gtd => {
anyhow::bail!("GTD time in force is not supported by Hyperliquid")
}
TimeInForce::Day => {
anyhow::bail!("DAY time in force is not supported by Hyperliquid")
}
TimeInForce::AtTheOpen => {
anyhow::bail!("AT_THE_OPEN time in force is not supported by Hyperliquid")
}
TimeInForce::AtTheClose => {
anyhow::bail!("AT_THE_CLOSE time in force is not supported by Hyperliquid")
}
}
}
/// Converts a Hyperliquid time in force to a Nautilus `TimeInForce`.
pub fn hyperliquid_time_in_force_to_nautilus(hl_tif: HyperliquidTimeInForce) -> TimeInForce {
match hl_tif {
HyperliquidTimeInForce::Gtc => TimeInForce::Gtc,
HyperliquidTimeInForce::Ioc
| HyperliquidTimeInForce::FrontendMarket
| HyperliquidTimeInForce::LiquidationMarket => TimeInForce::Ioc,
HyperliquidTimeInForce::Alo => TimeInForce::Gtc,
}
}
/// Determines the TP/SL type based on order type and side.
///
/// # LogicView on GitHub (pinned to 18893faf8b)
Solutions
- Use a market/limit order with GTC or IOC submitted at your desired close time.
- Cancel remaining quantity after your close window to emulate MOC behavior.
- Add a venue-capability check that blocks AtTheClose for Hyperliquid.
Example fix
// before let tif = TimeInForce::AtTheClose; // after let tif = TimeInForce::Gtc; // schedule submission near session close yourself
Defensive patterns
Strategy: validation
Validate before calling
fn hyperliquid_tif_ok(tif: TimeInForce) -> bool {
matches!(tif, TimeInForce::Gtc | TimeInForce::Ioc)
}
if !hyperliquid_tif_ok(tif) { return Err(anyhow::anyhow!("unsupported TIF {tif:?} for Hyperliquid")); } Try / catch
match nautilus_time_in_force_to_hyperliquid(tif) {
Ok(t) => send(t),
Err(e) => anyhow::bail!("adjust time in force: {e}"),
} Prevention
- Use GTC/IOC with your own close-window scheduling.
- Keep a single TIF capability check used by all order paths.
- Test order builders against the supported TIF set for each venue.
When it happens
Trigger: Converting TimeInForce::AtTheClose via nautilus_time_in_force_to_hyperliquid when routing an order to Hyperliquid.
Common situations: Strategies liquidating at the close ported from equities; shared order templates across venues.
Related errors
- FOK time in force is not supported by Hyperliquid
- GTD time in force is not supported by Hyperliquid
- DAY time in force is not supported by Hyperliquid
- AT_THE_OPEN time in force is not supported by Hyperliquid
- FOK time in force is not supported by Hyperliquid
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/6770a9eb6bbba721.
Report an issue: GitHub.