Skip to content

Grid preview

POST /strategies/grid/preview previews a Hyperliquid spot grid before a user creates a bot.

The preview is the contract: prices and sizes returned by this endpoint are the values the bot is designed to place after the user confirms the configuration.

{
"platform": "hyperliquid",
"asset": "HYPE/USDC",
"lower_price": "60",
"upper_price": "70",
"size_per_order_usd": "25",
"compounding": false,
"grid_count": 20,
"step_pct": null
}
{
"platform": "hyperliquid",
"asset": "HYPE/USDC",
"market": "spot",
"current_price": "65.1234",
"grid_count": 20,
"step_pct": "0.8146",
"levels": [
{
"index": 0,
"price": "60",
"side": "buy",
"size": "0.4166",
"notional_usd": "24.996"
}
],
"floating_level": {
"index": 9,
"price": "65",
"side": "buy",
"size": "0.3846",
"notional_usd": "24.999"
},
"summary": {
"buy_count": 10,
"sell_count": 9,
"total_size": "7.1234",
"total_notional_usd": "475.00"
},
"requirements": {
"market": "spot",
"needs": [
{ "coin": "USDC", "amount": "240.00" },
{ "coin": "HYPE", "amount": "12.5" }
]
}
}
  • Grid preview is spot-only.
  • Perp assets are rejected with GRID_006_PERP_UNSUPPORTED.
  • grid_count and step_pct are mutually exclusive inputs.
  • Prices and sizes are rounded to Hyperliquid spot precision rules.
  • floating_level is the one slot the runtime holds back when placing the initial grid.