Short Size Guard
What it does
Reduces your short base order size once short inventory grows too large relative to long inventory. Helps slow short accumulation without widening the grid or changing long-mode behavior.
Why this exists
In hedge mode you run a long grid and a short grid independently. On a strong uptrend, the short grid keeps filling sell orders so your short grows, while price moves away from the long grid's buy levels and long CLOSE sells fill, so your long shrinks. Over time your short can end up much larger than your long.
Hedge Throttle tackles that by pushing new short entries farther apart. Short Size Guard tackles it a different way: once short has overtaken long, it makes each new short order smaller.
It does not create new fills. It swaps your normal short base for a smaller guarded base while active. While it stays active, every short order that starts from your normal short base uses the guarded one instead. When balance improves, new short orders go back to normal size.
This feature is short-mode only. Long mode is unchanged.
For all config fields, see Config Reference.
How it works
Short Size Guard compares your short and long position value for the pair:
shortPositionUsdandlongPositionUsd
From those it computes:
| Quantity | Formula |
|---|---|
| Current ratio R | shortPositionUsd / longPositionUsd |
| Guarded short base | short orderSizeUsd × guardedMultiplier |
Short Size Guard is active when:
R >= entryRatio- Or short inventory exists while long is 0, so there is no long reference yet
Short Size Guard turns inactive when:
R < exitRatio- Or both sides are flat
While active, new short orders use the guarded short base instead of the neutral short base. When it turns inactive, new short orders return to the neutral base.
Worked example
Settings: defaults (
entryRatio = 1.0, exitRatio = 0.95, guardedMultiplier = 0.5, cooldownMs = 60000).You run $10 short orders and $10 long orders on HYPEUSDT.
Step 1: Drift above parity
| Value | Check | |
|---|---|---|
| Long | $800 | |
| Short | $960 | |
| R = $960 / $800 | 1.20 | R ≥ 1.0 → Short Size Guard turns active |
Step 2: Base size changes
| Value | |
|---|---|
| Neutral short base | $10 |
| Guarded short base = $10 × 0.5 | $5 |
While active, new short orders start from $5 instead of $10:
| Order | Normal base | Short Size Guard gives |
|---|---|---|
| Short OPEN (each) | $10 | $5 |
| Short CLOSE (each) | $10 | $5 |
Step 3: Balance improves
| Value | Check | |
|---|---|---|
| Long | $1,100 | |
| Short | $1,000 | |
| R = $1,000 / $1,100 | 0.91 | R < 0.95 → disarming condition passes |
After disarming, new short orders return to the normal $10 base.
Cooldown
After a disarm, Short Size Guard waits for
cooldownMs before it can turn back on. This stops rapid on and off flipping when the pair hovers near the threshold.With defaults, a ratio sequence like
[1.02, 0.94, 1.01, 1.03 after 60s] produces states [active, inactive, still inactive, active].1.02turns it on0.94turns it off1.01would normally turn it back on, but cooldown keeps it off- After 60 seconds,
1.03can turn it back on again
Interaction with other features
| Feature | Interaction |
|---|---|
| Hedge Throttle | Complementary. Hedge Throttle widens spacing. Short Size Guard reduces per-order short base size. When both are active, short OPEN orders are smaller and farther apart. |
| Exo Indicator | Exo still behaves normally. If a short OPEN order is amplified, it starts from the current short base. When Short Size Guard is active, that base is the guarded size. |
| Hedge Guard | Long-mode only. Independent. Hedge Guard can still step in on the long side if imbalance becomes extreme. |
| Long Bias Guard | Long-mode only. Independent. It changes long OPEN sizing, not short sizing. |
| Rebalancer | Still corrects drift as usual. When it places short-side correction orders, it starts from the current short base, so the guarded size carries through while active. |
| Position Balancer | Still accelerates profitable short CLOSE orders as usual. If Short Size Guard is active, the close-side base starts smaller before any close-side boost applies. |
Tuning tips
| If you want... | Adjust this |
|---|---|
| Earlier action | Lower entryRatio |
| Stronger size reduction while active | Lower guardedMultiplier |
| Reduced sizing to stay on until balance improves more | Lower exitRatio |
| Faster re-arming after a disarm | Lower cooldownMs |
| Gentler behavior | Raise guardedMultiplier toward 1.0, or raise entryRatio |
Troubleshooting
| Symptom | Likely cause |
|---|---|
| Feature never turns on | Short is not yet large enough versus long, both sides are flat, or enabled: false |
| Feature turns on but orders do not shrink as much as expected | guardedMultiplier is too close to 1.0, or the exchange minimum order size is lifting the final size |
| Feature seems to stay on too long after recovery | exitRatio is still below your current ratio, or cooldown has just followed a recent disarm |
| Short side still grows too quickly in a pump | Short Size Guard reduces size, it does not widen spacing. Pair it with Hedge Throttle if you want both smaller and farther apart short orders |
| No visible change after a config edit | Verify the effective short-mode scope and confirm enabled: true |