Skip to content

Capital Reservation

Aegis uses a max-of-concurrency-groups model to estimate the worst-case margin required for a strategy configuration. This model determines how much exchange balance must be available before the bot will open a new position.


Within a single strategy, legs are organized into concurrency groups — sets of legs that can be simultaneously active. The capital reservation is the maximum margin required across all concurrency groups, not the sum of all legs.

This is distinct from a naive sum-of-all-legs approach:

ApproachEstimate
Sum of all legsAssumes all legs are open simultaneously — overly conservative
Max-of-concurrency-groupsUses the worst-case group that can be open at once — accurate

Setup: A full_short_protection Bastion strategy. Pool value = $1,000, capitalBufferPct = 0.1, leverage = 5×.

First, compute margin per leg using the effective capital (see capitalBufferPct):

effectiveCapitalUsd = $1,000 × (1 + 0.1) = $1,100
marginPerLeg = $1,100 / 5 = $220
LegMargin per activation
lower_short$220
upper_short (reentry)$220

Sum-of-all-legs estimate: $220 + $220 = $440
Max-of-concurrency-groups estimate: max($220, $220) = $220

In the full_short_protection preset, at most one of the two legs is active at a given time (successive events: exit, then reentry). The capital reservation model correctly identifies that the maximum concurrent requirement is $220, not $440.


capitalBufferPct does not add a separate safety buffer on top of a calculated margin — it multiplies the pool value to produce the effective capital the bot sizes against:

effectiveCapitalUsd = poolValueUsd × (1 + capitalBufferPct)
marginPerLeg = effectiveCapitalUsd / leverage
required_balance ≥ worst_case_group_margin

A higher capitalBufferPct means a larger position notional, a higher margin per leg, and therefore a higher required balance. The buffer is baked into the notional size, not added afterward.

See Risk Parameters — capitalBufferPct for the full reference and numeric examples.