Skip to main content

Trading Tools for Your Agent

Algos overview

HAIPA pairs its policy engine with institutional-grade infrastructure for your agent: Tokyo-colocated compute, persistent VMs, and algo primitives. Trailing stop, peg (chase), and trigger bracket orders are live now, with more algo primitives shipping over time. Your agent gets the same tools institutional HFT desks have run for decades, but every order is still checked against your rules before it fires. Non-custodial, always.

Trailing stop order

A trailing stop is an exit order that follows the market instead of sitting at a fixed price. As your position moves in your favor, the stop trails behind it at a set distance. If the market reverses and pulls back by that distance, the order fires and closes the position — locking in gains without capping how far the upside can run.

It protects you when the position goes against you, like a static stop. But it also protects profits when the position moves your way, because the stop is dragged along as the market moves in your favor. For example: "buy 10 BTC and place a trailing stop 800 points lower."

On HAIPA, the trailing stop is one of the algo primitives your agent can use as part of its execution toolkit. But it doesn't sit outside your rules: every trailing stop your agent places is still checked against your policy caps (size, leverage, position limits) before it's submitted. HAIPA never holds your funds and never overrides what you've set — it makes sure the order matches your rules before it goes out.

Important — read this before placing one

HAIPA currently supports one trailing stop per instrument. You can't place two trailing stops on the same instrument with different offsets (for example, one at offset 150 and another at offset 200 on the S&P 500). It's one or the other, and it applies to the full position. If you or your agent gets flat some other way, or flips the position, the trailing stop auto-cancels.

The offset is set in absolute price points, not a percentage. For example:

  • On the S&P 500, the offset is in index points.
  • On SOL or BTC, it's in USD per coin.
  • On Brent oil, it's in USD per barrel, and so on.

You can see your running trailing stops in the admin UI under the Algos tab at app.haipa.ai. You can also ask your agent to "list my algos" to list all running algo orders, and you can pause, resume, or cancel any of them.

  • Pause freezes the stop at its current level — it stops trailing but stays in place, so you keep your protection.

Example prompts

  • "Place a trailing stop in xyz:sp500, offset 100."
  • "Trail a stop 40 points above my xyz:TSLA short."
  • "What are my options for protecting my position?"

Peg (chase) order

A peg order (chase order) is a limit order that automatically reprices itself to follow the best bid or ask as the market moves, so it keeps resting at the top of the book instead of getting left behind. The order moves up (or down) toward your limit price as the market moves; once it reaches your limit, it rests there as a normal limit order.

You can also configure a peg order to act like an iceberg by setting the Max Show quantity lower than the order's total quantity. An iceberg order displays only a small portion of the total size (the "tip") on the order book at a time, automatically replenishing the visible slice as each piece fills, so the full size stays hidden from other traders.

Post-only (maker) orders pay lower fees natively on Hyperliquid; aggressive (taker) orders pay a higher fee to the exchange.

You can ask your agent to "list my algos" to list all running algo orders, and you can pause, resume, or cancel a running peg order.

Example prompts

  • "Buy 100 xyz:BRENTOIL perps using a peg order, max show 10 lots at a time, limit 94."
  • "Sell 10 xyz:sp500, peg order, max show 2 perps, limit 7450."
  • "Use a peg order to buy 50 HYPE, limit 60."

Trigger bracket order

A trigger bracket is a fully self-managing breakout trade: you set a trigger price, and if the market reaches it, the algo enters at market and immediately places a stop loss to protect your entry (and optionally a take-profit to exit a winner) at your desired offset.

If the trade works, the take-profit closes it. If it doesn't, the stop closes it. Either way, no follow-up action is needed from you or your agent. The bracket manages both the happy path and the unhappy path on its own.

For example: "If the SP500 breaks 7465, buy 10, stop 65 points below the trigger, take profit 130 above."

Sells work the same way: the trigger fires when the market falls to your price, with the stop above and the target below.

How trigger brackets work

The trigger fires on Hyperliquid's mark price, exchange-side, so your entry triggers even if you're offline. The stop and take-profit are sized to what actually filled (never more), and both are reduce-only: a trigger bracket can only open or add to a position, and its exits can only reduce it. Over a full round trip, a bracket's net effect on your position is zero.

Because of this, a bracket that would trade against your existing position is rejected upfront. If you're short SOL, a sell bracket is fine, but a buy bracket would reduce your short rather than open a trade, and that's a job for a regular order.

Stacking brackets

You can stack up to ten brackets in a single perp market, all inside one algo. The boundary is one trigger-bracket algo per market, with up to ten brackets inside it. Stack same-direction brackets as an entry ladder, or place a buy above and a sell below to trade a breakout in either direction. If the two ever cross, they simply close each other out, which is reflected in the algo's stats.

Offset and target parameters

The offset and target_offset parameters are in absolute price points, using the same convention as trailing stops:

  • On the S&P 500, the offset is in index points.
  • On SOL or BTC, it's in USD per coin.
  • On Brent oil, it's in USD per barrel.

Both are measured from the trigger price (stop = trigger − offset, target = trigger + offset for buys), and each must be at least 0.10% (10 basis points) of the trigger price.

The take-profit rests as a limit order, so it typically earns the cheaper maker fee. Its contract is price-or-better: if the market has already run past your target by the time it's placed, it fills immediately.

Adjusting a running trigger bracket

You can add brackets to a running algo or edit them live: "add a third bracket at 7500," or "move the stop on my fired bracket to 40 points." Running brackets are never disturbed by edits to their neighbors. Adding brackets re-checks your account's risk rails at the new combined size.

Managing your trigger brackets

You can see your running trigger brackets in the admin UI under the Algos tab at app.haipa.ai, with per-bracket state (armed / fired / protected / done), fills, and notices. You can also ask your agent to "list my algos" and it will list all your running algo orders. You can pause, resume, and cancel a running trigger bracket.

  • Pause pulls the entry triggers (no new positions can open while paused) but leaves the stops and take-profits of any bracket that already fired in place, so protection stays on.
  • Resume re-arms the entries, unless the market crossed a trigger while you were paused (re-placing it would fire instantly, so the algo tells you instead).
Caution on cancel

Cancelling the algo pulls everything it owns, including the stop and take-profit of a bracket that already fired. The position that bracket was managing is left unprotected. The cancel response warns you when this is about to happen. Re-protect the position or close it if that's not what you intended.

Example prompts

  • "Place a trigger bracket on xyz:sp500 — buy 10 if it breaks 7465, stop 65 points below the trigger, take profit 130 above."
  • "Bracket xyz:BRENTOIL both ways: buy 5 if it breaks 89, sell 5 if it breaks 87, stops 50 cents, targets 1 dollar."
  • "Add a third bracket to my sp500 algo: buy 5 more if it breaks 7500, same offsets."
  • "Move the take-profit on my fired bracket to 40 points."
  • "Ladder into HYPE: buy 20 at 62, 20 more at 64, 20 more at 66, each with a 1 dollar stop."