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:
  • shortPositionUsd and longPositionUsd
From those it computes:
QuantityFormula
Current ratio RshortPositionUsd / longPositionUsd
Guarded short baseshort 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
ValueCheck
Long$800
Short$960
R = $960 / $8001.20R ≥ 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:
OrderNormal baseShort Size Guard gives
Short OPEN (each)$10$5
Short CLOSE (each)$10$5
Step 3: Balance improves
ValueCheck
Long$1,100
Short$1,000
R = $1,000 / $1,1000.91R < 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.02 turns it on
  • 0.94 turns it off
  • 1.01 would normally turn it back on, but cooldown keeps it off
  • After 60 seconds, 1.03 can turn it back on again

Interaction with other features

FeatureInteraction
Hedge ThrottleComplementary. 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 IndicatorExo 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 GuardLong-mode only. Independent. Hedge Guard can still step in on the long side if imbalance becomes extreme.
Long Bias GuardLong-mode only. Independent. It changes long OPEN sizing, not short sizing.
RebalancerStill 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 BalancerStill 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 actionLower entryRatio
Stronger size reduction while activeLower guardedMultiplier
Reduced sizing to stay on until balance improves moreLower exitRatio
Faster re-arming after a disarmLower cooldownMs
Gentler behaviorRaise guardedMultiplier toward 1.0, or raise entryRatio

Troubleshooting

SymptomLikely cause
Feature never turns onShort 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 expectedguardedMultiplier 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 recoveryexitRatio is still below your current ratio, or cooldown has just followed a recent disarm
Short side still grows too quickly in a pumpShort 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 editVerify the effective short-mode scope and confirm enabled: true