Skip to main content
Glama
hyperliquid-preflight

hyperliquid-preflight

by PTone111

hyperliquid-preflight

hyperliquid-preflight

CI License: MIT MCP x402

Check a Hyperliquid perp trade before you place it. Built for AI agents, and it works from a plain script too.

HIP-3 stock perps (xyz:NVDA, xyz:TSLA, ...) keep trading when the US stock market is closed. During a closure the price comes only from the on-chain book, inside per-market discovery bounds. A 10x position can be liquidated on a thin weekend book while the stock itself hasn't moved. See data/weekend-backtest-20261205.md: 12 markets, May to Nov 2026. At 5x there were no weekend liquidations. At 10x, the volatile names were liquidated several times, and the price was often back by the Monday reopen.

The check returns risk_level low, medium or high with reasons, covering:

  • leverage tier

  • market session and upcoming closures (trade[XYZ] official schedule and holidays)

  • discovery bounds and weekend book depth

  • mark/oracle deviation

  • funding cost

  • slippage

  • approximate liquidation distance

  • fees

It is read-only: it never places orders and never needs keys.

Quick start

# free: which listing of NVDA should I trade?
curl -A my-agent https://x402-bsc-tools.x402-bsc-tools.workers.dev/v1/hl/market-verify?symbol=NVDA

# Claude Code: add the MCP server
claude mcp add --transport http preflight https://x402-bsc-tools.x402-bsc-tools.workers.dev/mcp

Related MCP server: hyperliquid-agent-gateway

Use it

  • Agent Skill: copy skill/hyperliquid-preflight/ into your agent's skills folder.

  • MCP server (streamable HTTP): https://x402-bsc-tools.x402-bsc-tools.workers.dev/mcp. See examples/mcp-config.md.

  • HTTP:

    GET /v1/hl/pretrade-check?coin=xyz:NVDA&side=long&size_usd=1000&leverage=5&hold_hours=24
  • Python: examples/check_then_trade.py gates your own order code behind the check, using the standard library only.

Pricing via x402, per call, USDC on Base or USDT on BNB Chain. hl_pretrade_check costs $0.02, hl_account_audit (builder fee approvals, agent wallets, positions near liquidation) $0.01, and hl_market_verify is free. You are not charged if Hyperliquid data cannot be fetched. Machine-readable: /openapi.json, /llms.txt.

Limits

  • Liquidation figures are approximations: isolated margin, with fees and funding ignored.

  • Published trade[XYZ] parameters carry params_verified_at.

  • The backtest uses 1h traded candles as a stand-in for the mark price.

  • Risk information only, not financial advice.

License

MIT for the code and the Skill in this repository. The hosted API is a separate paid service.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to interact with Hyperliquid perpetual futures exchange for market analysis, account management, and risk-managed trading.
      5
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Provides AI agents read-only, keyless access to Hyperliquid market data, funding rates, account risk, and HyperEVM token transfers through MCP tools, with caching and rate limiting to protect upstream APIs.
      12
      52 PyPI
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI trading agents to submit proposed trades for deterministic pre-execution risk evaluation, returning allow/warn/deny decisions, risk scores, and tamper-evident audit hashes. It also supports token safety checks, balance simulation, asset registry lookup, and audit trail verification.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to perform token risk checks across BNB Smart Chain, Ethereum, Base, and Arc by simulating real buys and sells plus 70+ contract checks, with tools for reports, feeds, trade simulation, liquidity analysis, and fund tracing. Successful paid calls settle automatically in USDC on Base via x402, with no account or API key required.
      123 npm
      MIT