> ## Documentation Index
> Fetch the complete documentation index at: https://docs.convallax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Smart Margin

> How Convallax's Smart Margin collateral engine maximizes capital efficiency for market makers.

Convallax is built around market makers who provide liquidity by shorting options. Every short option needs USDC collateral to guarantee the holder can be paid at expiry. The least capital-efficient way to set that collateral is to look at each trade in isolation and lock its maximum possible loss. That is the simple max-loss approach.

Smart Margin is the more efficient way. It looks at a market maker's whole book as a single payout surface and locks only the true worst-case payout, not the sum of every individual worst case. Because prediction-market underlyings are bounded between $0 and $1 and a call and a put at the same strike cannot both finish in the money, a lot of the stacked "max losses" in a multi-position book can never happen at the same time. Smart Margin removes that dead weight from the collateral requirement.

## The least efficient approach: max loss per trade

If a market maker is short `q_c` calls and `q_p` puts at the same strike `K`, the simple approach adds each trade's maximum possible payout:

```
collateral = q_c × (1 − K) + q_p × K
```

This treats the call's worst case (`S_T = 1`) and the put's worst case (`S_T = 0`) as if they could both occur. But the YES price cannot finish at $1.00 and $0.00 simultaneously. For a mixed book, that over-collateralizes: it locks the cost of two mutually exclusive disasters.

For a multi-strike or multi-market book, the same effect repeats. Worst cases are stacked across strikes and markets that cannot all resolve against the maker at once. The simple approach leaves a lot of maker capital sitting idle.

## Smart Margin: net the payoffs

Smart Margin starts from the same payoff definitions:

```
Call payoff:  C_K(S_T) = max(0, S_T − K)
Put payoff:   P_K(S_T) = max(0, K − S_T)
```

A call and a put at the same strike always add to the absolute distance from `K`:

```
C_K(S_T) + P_K(S_T) = |S_T − K|
```

This is the payoff of a long straddle. When a market maker is short both a call and a put at the same strike, the holder only collects on one side — not both — because the final price `S_T` is a single number.

For a short book of `q_c` calls and `q_p` puts at strike `K`, the total payout owed is `q_c C_K(S_T) + q_p P_K(S_T)`. Because `S_T` is bounded on \[0, 1], the worst case is reached at one of the two endpoints:

| Final price | Total payout    | Description               |
| ----------- | --------------- | ------------------------- |
| `S_T = 0`   | `q_p × K`       | puts finish in the money  |
| `S_T = 1`   | `q_c × (1 − K)` | calls finish in the money |

So Smart Margin locks the larger of the two mutually exclusive outcomes:

```
collateral = max( q_p × K, q_c × (1 − K) )
```

This is the efficient worst case for that strike — the larger of two outcomes that cannot happen together.

## Which endpoint dominates?

Let `delta = q_c − q_p`, so `q_c = q_p + delta`. The condition for which boundary has the larger payout is:

* If `q_p(2K − 1) > delta(1 − K)`, the worst case is `S_T = 0` and the collateral is `q_p × K`.
* If `q_p(2K − 1) < delta(1 − K)`, the worst case is `S_T = 1` and the collateral is `q_c × (1 − K)`.
* If the two expressions are equal, both endpoints require the same collateral.

<Tip>
  When the book is one-sided (`q_p = 0` or `q_c = 0`), the formula reduces to the same per-position max loss. The efficiency gain appears when a maker is short both calls and puts around the same strike.
</Tip>

## Numerical examples

<Accordion title="100 short calls and 100 short puts at K = $0.70">
  * `q_c = 100`, `q_p = 100`, `K = 0.70`, `delta = 0`
  * Simple max loss: `100 × 0.30 + 100 × 0.70 = $100`
  * Smart Margin: `max(100 × 0.70, 100 × 0.30) = $70`
  * **Capital saved: 30%** for this strike
</Accordion>

<Accordion title="50 short calls and 150 short puts at K = $0.60">
  * `q_c = 50`, `q_p = 150`, `K = 0.60`, `delta = -100`
  * At `S_T = 0`: `150 × 0.60 = $90`
  * At `S_T = 1`: `50 × 0.40 = $20`
  * Smart Margin: `max(90, 20) = $90`
  * Simple max loss would be `50 × 0.40 + 150 × 0.60 = $110`
</Accordion>

<Accordion title="One-sided book: 100 short calls at K = $0.50">
  * `q_c = 100`, `q_p = 0`, `K = 0.50`
  * Smart Margin: `max(0 × 0.50, 100 × 0.50) = $50`
  * This is the same as the simple per-trade max loss, because there is nothing to net.
</Accordion>

## Extending across strikes and markets

A real market-making book contains many strikes and many prediction markets. For each underlying the final price is still bounded on \[0, 1], so the total portfolio payoff is a piecewise-linear function of a finite set of prices. The true worst case of the whole book is found at boundary points and strike points.

Smart Margin evaluates that function across all of a maker's open shorts and returns a single portfolio-level collateral number. Because it nets offsetting exposures, it reduces the capital required for multi-strike and multi-market books the same way it does for a single strike: the collateral is the actual worst case of the combined surface, not the sum of isolated maxima.

## What this means for market makers

* **More capital stays available for quoting.** Less USDC is locked against payouts that cannot happen at the same time.
* **Two-sided markets become economical.** A maker can comfortably quote both calls and puts around the same strike without doubling the collateral.
* **Multi-strike and multi-market books scale better.** Portfolio-level netting replaces position-by-position stacking of worst cases.
* **Collateral matches the real risk.** It is sized to the true worst-case payout of the book, not a conservative sum of mutually exclusive extremes.
