A rule says when to look, if what it reads holds, and then what to do. Your executor checks a strategy’s rules in order and runs the actions of those that hold: build the position, unwind it, guard the hedge, pause, alert. Every option on this page is off unless you set it, and says what it does in the front too, behind the info icon beside its field.

How rules run

  • In order. The rules run top to bottom at each check. A rule that pauses the strategy stops the ones after it, so the order matters: put the emergency exits and the guard before any entry. Move up and Move down change it.
  • One at a time. A rule never starts again while its actions run, a margin move it started included.
  • Only on what’s known. A rule acts only when all its conditions hold, each strictly above or below its threshold. A figure your executor can’t read never holds.
  • Only while active. A paused strategy’s rules wait, whatever they read.
  • Hedged, or it says why. A two-leg action ends with both legs level: the leg that filled less is sent again, then the other leg’s excess is closed.
A strategy carries at most 20 rules, a rule at most 10 conditions and 5 actions, and at least one action.

Where to edit them

On a strategy’s page, the Rules tab lists them as Flows or as Sentences, each with a badge that says where it stands now. A rule opens in the flow editor: blocks you drag from a palette into three lanes, When, And if and Then. Add a rule starts a new one, and From a template adds a ready-made one. Above an open rule, a bar says what it would do if it ran now, and why not, tested by your executor without acting. Test again tests it as written, saved or not.

When: the trigger

A rule has one trigger. Its kind can change after the rule is saved. How often your executor checks. Every 30 seconds, unless its ENGINE_TICK_SECONDS setting says otherwise, it reads both legs of each active strategy on the venues. It also runs a strategy when a venue’s live feed moves one of its markets, at most every 5 seconds. So an interval under 30 seconds holds only while a feed pushes. An interval rule that fired waits out its interval before it may fire again. A leg is uncovered when what one leg holds beyond the other is over 2% of both legs’ sizes together, and an order its venue takes to close it: from its smallest closing order, or the whole leg where its venue takes that (the last of a position). A leg closed by its venue, or a fill that came short. After the executor’s own orders, wait (15 seconds by default) covers a venue that shows a fill a moment late; a leg left alone otherwise, as by a liquidation, is acted on at once.

The events

One time reacts to the first. What an event rule’s actions cause is counted and reacted to in turn, each rule once per round.

And if: the conditions

Each condition compares one figure, Above or Below a Threshold. The price gap is read at the prices both books would fill the rule’s slice at. A book that can’t fill it leaves the gap unknown, and the rule waits. It can count the taker fees too: below.

Three options that steady a condition

All three are optional. A rule without them reads the figure now and acts on the first reading, as rules always did.
On any condition. In minutes, from 0 to 1,440 (a day).The condition counts only once its figure has held that long without a break.
  • What it buys: a blip doesn’t trip the rule.
  • What it costs: the rule acts that much later on a real change.
  • At 0, it counts at once, on the first reading.
A check that can’t read the legs, a change to the rule or the strategy, activating the strategy, a long gap between two checks, or a restart of your executor starts the count again. Nothing acts on a stretch your executor didn’t see.
On both funding conditions. The rate now, or the last hour, 4, 8 or 24 hours, or 7 days paid.
  • The rate now moves with every reading, and jumps at each funding time as a venue starts the next period’s estimate. Pick it to react at once.
  • An average of the hours paid moves slowly. It reacts later to a real change, but one reading’s dip doesn’t trip it. Pick it to act only on what was paid.
An average covers the hourly rates each venue paid over those hours, before the current hour, which isn’t paid yet. It comes from each venue’s own funding history. A venue that fails to give it leaves the average unknown, and the condition waits.
On both funding conditions. In minutes on each side of the funding time, from 0 to 30.At each leg’s funding time, as its venue sets it, the rate a venue shows jumps to the next period’s estimate, then settles. That jump is enough to unwind a pair at the top of the hour and enter it again a minute later. This window ignores the readings around it: the condition doesn’t hold there, and a held-for count neither starts nor breaks.
  • What it buys: no reaction to the jump at the funding time.
  • What it costs: your rule is blind for those minutes. To exit on any change, leave it at 0.
  • At 0, it ignores nothing: every reading counts.

The price gap after fees

After taker fees, a switch on the price gap, takes both legs’ taker fees off the gap. It’s off unless you turn it on: every rule and every ready-made template reads the gap alone. The fees count in percent of the notional, as the gap does of the prices’ middle. Which ones depends on the rule’s trade: With 0.045% on the long leg’s venue and 0.035% on the short leg’s, a gap of 0.2% in your favor reads 0.2 − 2 × 0.08 = 0.04% for an entry, and 0.2 − 0.08 = 0.12% for an exit. An entry that rests a maker order pays its maker leg’s maker fee going in instead of its taker fee, and a reduction that rests one pays it coming out: the gap after fees takes that one off there.
  • Each leg’s fee is your account’s own on its market where the venue says it: your volume tier with your staking and referral discounts on Hyperliquid, scaled on a HIP-3 market; your VIP tier on Aster; your fee tier on Polymarket Perps; your account type and LIT staked on Lighter. Else the venue’s base taker fee for the market.
  • A fee that isn’t known leaves the gap after fees unknown: the condition doesn’t hold, and the rule waits, as for any figure it can’t read. It never counts a missing fee as 0, nor guesses one.
  • What it buys: the rule acts only once the gap covers the fees as well.
  • What it costs: it acts less often, and later. Off, leave room for the fees in the threshold yourself.
  • What it shows: the rule’s badge, its blocks and its test read the gap after fees, and say so: “Waiting · gap after fees at +0.04%”.
  • Two rules that work against each other: a gap after fees keeps two rules apart where its threshold alone already does. Since the page doesn’t know the fees, it never flags two rules as meeting on it.

The pair’s net P&L

Both legs’ P&L added up since the strategy began: realized and unrealized, funding received or paid, less fees and margin moves. A loss on one leg that the other’s gain offsets doesn’t move it, so a hedged pair isn’t closed for one leg’s swing.
  • Compared in % of margin, it’s weighed against the margin both legs use now: −50 lost half of it. Within 1,000% either way.
  • Compared in Dollars, as it is.
  • It’s unknown until the strategy’s first P&L point and for a few seconds after each fill. A condition never holds on an unknown figure.
  • On a market two of your strategies share, it counts this strategy’s own fills and its own part of each funding payment, never the other strategy’s. Two strategies on one market.
Worse leg’s P&L is the other measure: one leg alone. A hedged pair can read −80% there and be flat. Use it only when one leg’s loss is what you mean to act on.

The distance to liquidation

How far the leg closer to liquidation stands from its liquidation price, in percent of its price. A leg starts about 100 ÷ leverage percent from it, less the venue’s maintenance margin: near 3.75% at 20×, near 1.25% at 40×. A threshold at or above that fires right after entry. At 40× and above, 2% is already more than where a leg starts: use a lower threshold, or a lower leverage. It reads sets which liquidation price that is. It starts on The venue’s price: every rule and every ready-made template reads that one unless you change it.
  • The venue’s price is the one each venue reports for the leg’s position. In cross margin, not every venue says it moves when another position of the same account loses. Where it doesn’t, a position outside the strategy can drain the account and the rule doesn’t see it.
  • The nearer of venue’s and computed also computes a price from the venue account’s equity and maintenance margin, so a loss on any position of the account brings it closer. It reads whichever of the two stands closer to the leg’s price.
The second choice never reads further than the first. The venue’s price always counts when the venue gives one. The computed price is added where your executor can work it out, and can only bring the distance down. A rule that closes below a level fires with it whenever it would have fired without. Where a computed price exists, for a leg in cross margin: A leg in isolated margin has its venue’s price alone: nothing else in the account moves it.
  • It can fire earlier than the venue’s own figure would. The computed price is an estimate from the account’s figures. Only on Hyperliquid’s standard accounts is the venue’s own price documented to cover the whole account; elsewhere the two can disagree, and the nearer one wins.
  • On Polymarket Perps the two are known to disagree. On the one account’s figures we could compare, the computed price of a long stood well closer than the venue’s: 0.50 against 0.42, for a mark of 0.76. Which one is right isn’t verified until a live account is recorded. Until then, expect a rule with this choice to act sooner there than Polymarket’s own figure would.
  • A leg with neither price makes the condition unknown. It doesn’t hold and the rule doesn’t act, as with any figure a rule can’t read. One case still acts: a rule that fires below a level does once the other leg is seen under it.
  • The computed price takes each position’s maintenance margin from its venue’s general rule. A venue’s tiers for a large position can move it a little.

Enough margin on both accounts

Before an entry slice sends, each venue account it opens on must have free the initial margin its orders take there, plus the Safety buffer. If one hasn’t, neither leg is sent: one leg never opens alone.
  • Why a buffer: the price moves, and fees come out of margin, between the check and the fill. Without it, a slice could pass the check, then be refused for cents on one venue while the other leg fills. 0 asks for the margin alone.
  • What it costs: an entry waits a little longer on a tight account.
  • It holds when the rule opens nothing now, or when a venue doesn’t say what it has free: that venue still refuses an order it can’t carry.
When margin alone holds an entry back:
  • the rule shows as Blocked, and the warnings badge beside the strategy’s status names the rule, the account, what it has free, what the slice needs with its buffer, and how short it is;
  • you’re told once per account, with what fixes it: add margin to that account, or lower the slice, the leverage or the rule’s safety buffer. It’s told again only if it gets worse by half, or an hour on, and never because your executor restarted;
  • once every account has carried the slice for 5 minutes, or a slice goes through, that’s told once too.
Without this condition, an entry still waits until each account can carry the rest of the target, its margin and its taker fees, with no buffer: see Margin to enter. The generic template’s entry has it at 10%.

Then: the actions

Up to 5, in order.

What each action takes

  • Open and Reduce: the share, from 1 to 100% of target.
  • Open and Reduce: its execution, taker on both legs, the default, or maker on one leg, and then which leg rests.
  • Open, Reduce and Close both legs:
    • Which leg goes first: both legs together, the long leg first, or the short leg first. An opening or a reduction as a maker on one leg has none: the other leg follows each fill.
    • Retries: a leg that fills less is sent again so many times (2 by default, 5 at most), so long apart (1 second by default, 60 at most); then the other leg’s excess is closed.
    • Its own slippage ladder, in place of the strategy’s. An emergency close may climb further than an ordinary exit, since staying open costs more.
  • Close uncovered and Cover with the other leg: what doesn’t fill can rest in the book, at the last price the venue accepted, for up to a day; then it’s cancelled and tried again at the price then. 0, the default, rests nothing. Resting suits a book whose sellers sit beyond what the venue lets an order take; its cost is a leg left uncovered while the order waits.
  • Cover with the other leg: how far the position may grow past its target, 10% by default, 100% at most. It levels the position at once, at the cost of a larger one.
  • Hold entries: for how long, 30 minutes when you add it, a week at most.
  • Move margin: the distance to liquidation the closer leg gets back to, and the most a move and a day may carry, in dollars, from $10. It’s taken from the other leg, never past what keeps that leg at the same distance too. It needs LaMarge. Whether it runs depends on the margin keeper: below.
  • Alert: your message, 280 characters at most.

Maker on one leg

An Open or a Reduce sends both legs as takers, each up its slippage ladder, unless you set its execution to Maker on one leg. Then one leg rests a post-only order in the book and pays the maker fee, often far less than the taker fee; the other leg is sent as a taker as soon as the first one fills. It’s off unless you turn it on: every rule and every ready-made template trades as a taker.
  • Which leg rests. Lower fees, the default, rests the leg whose trade costs less in all, its own maker fee and the other leg’s taker fee, as your accounts pay them, else the venues’ base fees: the same leg going in and coming out. Or pick Long or Short. At the same cost, the long leg rests. A fee your executor can’t read on a leg is never counted as 0: the leg whose cost it knows rests, and the long leg when it knows neither; the journal says which and why. A leg whose venue places no post-only order never rests one: with Lower fees the other leg rests, and a leg you picked that can’t rests nothing, said once.
  • Where it rests. When the rule is due and every condition holds, one post-only order for the slice goes to the best price of its leg’s side. An opening buys the long leg at the best bid and sells the short one at the best ask; a reduction sells the long leg at the best ask and buys the short one back at the best bid, its order reduce-only too, so it only ever closes. A venue refuses a post-only order that would take at once; the rule then tries again at its next run, at the price then. Nothing goes on the other leg yet.
  • How it follows the price. At each run of the rule, every interval it’s set to, its conditions are read again: the price gap, an entry’s or an exit’s, with the order’s own price on the resting leg and the other leg’s taker price for the slice from its book. One that no longer holds takes the order out of the book. Otherwise, when the best price of its side moved, the order moves there: taken out, then placed again for what’s left. There’s never more than one at a time for a strategy, an opening’s or a reduction’s, and no entry of the strategy goes while one rests.
  • When it fills. Each fill, a partial one too, sends the other leg at once as a taker for what filled, up the action’s ladder, sent again as often as its retries say: an opening’s opens it as much, a reduction’s closes it as much, reduce-only. If it still doesn’t fill, the maker order is taken out of the book and what one leg holds beyond the other is closed, as for any trade: the hedge counts as failed. A venue’s live account feed tells your executor of a fill at once; without one, it looks every 3 seconds. A fill smaller than the other venue’s smallest order waits for the next one, and the unhedged guard leaves it be meanwhile; one the order ends with is closed where its venue takes it.
  • What takes it out. Pausing or changing the strategy, turning its rule off, another rule’s reduction, closing both legs, or an emergency close: what it filled is sent on the other leg first. Holding the entries takes out an opening’s, never a reduction’s. A reduction’s order takes out an opening’s before it rests. A restart of your executor finds it again and follows it on.
  • A time limit. Pair a maker exit with a taker one: rule A reduces as a maker while the exit gap favors it, rule B reduces as a taker once funding has been negative longer. When B fires, it takes A’s order out and closes as it asks.
  • The last of a position. A reduction closes what’s left once its slice is more than both legs hold. Under a venue’s smallest order, an order that only closes goes where the venue takes it: Hyperliquid takes one for the whole position under its $10, and Aster any from its smallest size, its $5 floor holding no such order. Lighter’s and Polymarket Perps’ smallest order holds for a closing one too: less than it stays there.
  • Margin. A venue holds back a resting opening’s margin: Margin to enter and Enough margin on both accounts count it as free for the entry it belongs to, so a slice isn’t counted twice. A reduction’s holds none.
  • Not yet: a strategy with a leg on a market another strategy shares rests no maker order; its rule says so once.
  • What it buys: the maker fee on one leg, and the price the book offers on its side rather than across it.
  • What it costs: an order may fill slowly, partly or not at all, and between a fill and the other leg’s, that leg stands alone for a moment.

Move margin, beside the margin keeper

Two things can move a strategy’s margin: this rule, and the margin keeper. Only one of them does at a time, so they never move against each other. They don’t decide the same way, so pick the one that says what you mean:
  • The keeper reads what each leg gained or lost. It refills the leg that’s short of its margin from the strategy’s other leg, past its group’s threshold, and carries every strategy’s move in one bridge. It never brings a leg above its margin.
  • This rule reads the distance to liquidation. Below your threshold, it moves what brings the closer leg back to your target distance, within its own dollar caps, for this strategy alone.
To hand a cross strategy to its own rule, turn Kept level by the keeper off for it: Keeper options…, in its menu on the Strategies page. The keeper then keeps its group without it.

When a rule can’t act

  • A slice under a venue’s smallest order sends nothing and alerts once, with each venue’s minimum and a target or a share that would clear them.
  • A book too thin for the slice within the slippage sends nothing, and the rule shows as Blocked.
  • A leg that can’t be read leaves nothing to weigh: the rules wait for the next check, but the event rules that react to it.
  • Two rules that work against each other are flagged in the warnings badge beside the strategy’s status: an entry and an exit that both hold at once, so the strategy opens and closes in turn and pays fees each time; or a rule that closes both legs without a Pause or Hold entries, so an entry opens them again right after.
  • No rule that closes the strategy near liquidation is flagged in the same badge: none of the rules that are on has a Distance to liquidation condition below a level and an action that closes both legs. Add or enable one, such as the ready-made Emergency exit near liquidation. It is only a warning: nothing is added for you. That rule is what protects a strategy when something outside it drains its account: the margin keeper never makes up for that.

Where a rule stands

Each rule’s badge on the Rules tab: A rule turned off has no badge: its switch says so, and its flow is dimmed. A condition held for a while says so while it counts (“Waiting · spread held 1 min of 2 min”), and one ignored near a funding time too (“Waiting · spread near a funding time”).

The generic template, rule by rule

What Generic delta-neutral starts a strategy with, in the order they run. All can be changed, turned off or removed. Its entry and exit read the funding spread now, with no held-for count, no average and no window around funding times: those are yours to add. One leg’s loss that the other’s gain offsets closes nothing; a single leg’s danger is left to the margin keeper and to the liquidation exit. Default rules is the lighter set: entry in 10% slices every 5 minutes above 10% APR, exit when funding turns, the unhedged guard without a pause, the pause after a failed hedge, and Keep both legs from liquidation, a margin rule that starts off (below 15% from liquidation, move margin to get back to 30%, at most $1,000 a move and $3,000 a day). Only new strategies take a template’s rules: the rules of a strategy made before stay as they are.

Executor rules

Besides each strategy’s rules, your executor has rules of its own, across its strategies: Settings, under Executor rules.
  • When something happens on a venue so many times within a span: its live feed goes down, it can’t be read, its market data goes stale, an order is refused or fills nothing, a margin or leverage is refused, a hedge fails, or an account can’t carry an entry’s margin. On one venue you trade on, or on any; each venue is counted apart.
  • Then, up to 5 actions: pause the strategies on that venue, pause every strategy, hold the entries on that venue for a while, alert.
They act as soon as it happens, after each strategy’s own rules. Your executor starts with one, off: Pause a venue’s strategies when its feed is down. It carries at most 20.