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

# Risk and inventory

> The four protections, how much a ladder can fill, fill tracking, stopping.

## Protections

<img className="pa-fig pa-fig-wide-light" src="https://mintcdn.com/biconomy-73bb4454/40CFSb7K3hPGZ20b/images/propamm/protections-wide-light.svg?fit=max&auto=format&n=40CFSb7K3hPGZ20b&q=85&s=2f40a7a53ec0ff0db693f668e8d5f24c" alt="Four protections: block cap, age fade, move premium and auto-dark." width="940" height="176" data-path="images/propamm/protections-wide-light.svg" />

<img className="pa-fig pa-fig-wide-dark" src="https://mintcdn.com/biconomy-73bb4454/40CFSb7K3hPGZ20b/images/propamm/protections-wide-dark.svg?fit=max&auto=format&n=40CFSb7K3hPGZ20b&q=85&s=74ace3f38d101578eb57215a7c59753d" alt="Four protections: block cap, age fade, move premium and auto-dark." width="940" height="176" data-path="images/propamm/protections-wide-dark.svg" />

<img className="pa-fig pa-fig-narrow-light" src="https://mintcdn.com/biconomy-73bb4454/40CFSb7K3hPGZ20b/images/propamm/protections-light.svg?fit=max&auto=format&n=40CFSb7K3hPGZ20b&q=85&s=241bb557495dca956191ece345f2e40e" alt="Four protections: block cap, age fade, move premium and auto-dark." width="480" height="333" data-path="images/propamm/protections-light.svg" />

<img className="pa-fig pa-fig-narrow-dark" src="https://mintcdn.com/biconomy-73bb4454/40CFSb7K3hPGZ20b/images/propamm/protections-dark.svg?fit=max&auto=format&n=40CFSb7K3hPGZ20b&q=85&s=98209dede2a21498c034ac9b685e64f1" alt="Four protections: block cap, age fade, move premium and auto-dark." width="480" height="333" data-path="images/propamm/protections-dark.svg" />

Block cap, age fade and move premium are set in one `board-controls` message per ladder and stay in force until you send new ones. Auto-dark is the `expiresAt` on every message.

| Dial         | Field                   | Effect                                                                              | Default   | Typical                    |
| ------------ | ----------------------- | ----------------------------------------------------------------------------------- | --------- | -------------------------- |
| Block cap    | `blockCap`              | maximum `tokenIn` the ladder fills in one block, across all takers                  | `0` (off) | a fraction of the top size |
| Age fade     | `widenPpmPerSqrtSecond` | extra discount of this many ppm times the square root of the quote's age in seconds | `0` (off) | 50 to 200                  |
| Move premium | `premiumPpm`            | extra discount in ppm after a price change                                          | `0` (off) | a few hundred              |
|              | `premiumBlocks`         | blocks the premium lasts, counting the commit block                                 | `0` (off) | 1 or 2                     |
| Auto-dark    | `expiresAt`             | the ladder stops quoting after this time                                            | required  | 10 to 30 s                 |

Age fade at `widenPpmPerSqrtSecond = 100`:

| Quote age | Extra discount |
| --------- | -------------- |
| 1 s       | 100 ppm (1 bp) |
| 4 s       | 200 ppm        |
| 25 s      | 500 ppm        |

```json theme={null}
{
  "type": "board-controls",
  "payload": {
    "mm": "0xYourSigner",
    "tokenIn": "0x8b414aD7005EeFd315aF2A16538885Eae229bab7",
    "tokenOut": "0xAbbdbbbd6d56593A9c5656c06cB30D61E4a544Df",
    "nonce": "<unix milliseconds>",
    "blockCap": "5000000000000000000",
    "widenPpmPerSqrtSecond": "100",
    "premiumPpm": "500",
    "premiumBlocks": "1",
    "signature": "<EIP-712 signature>",
    "chainId": 84532
  }
}
```

Aggregators see the block cap before trading: `board()` reports what is left in the current block, and the venue routes the rest of an order to other makers. `controls(mm, tokenIn, tokenOut)` on the executor returns your settings.

## Maximum payout per ladder

A ladder fills at most its top size, counted across every taker. A new `price-ladder` or `offsets` message resets the count. The maximum payout is fixed when you sign:

| Step  | Cumulative size | Price   | Pays at most   |
| ----- | --------------- | ------- | -------------- |
| 1     | 2 WETH          | 2000.00 | 4,000.00 USDC  |
| 2     | 5 WETH          | 1999.40 | 5,998.20 USDC  |
| 3     | 12 WETH         | 1998.20 | 13,987.40 USDC |
| 4     | 20 WETH         | 1995.50 | 15,964.00 USDC |
| Total | 20 WETH         |         | 39,949.60 USDC |

Keep at least that much `tokenOut` in the provider. A fill that finds less reverts.

| Mode    | Top size limits                                           |
| ------- | --------------------------------------------------------- |
| Rewrite | fills per ladder update                                   |
| Reprice | fills per `offsets` message, across any number of anchors |

## Fill tracking

| Data                            | Source                                                                                                                          |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| Inventory                       | `balanceOf` on your provider                                                                                                    |
| Filled and remaining size       | `board(mm, tokenIn, tokenOut)`: `filled`, `remaining`                                                                           |
| Filled this block               | `controls(mm, tokenIn, tokenOut)`: `filledThisBlock`                                                                            |
| Each fill                       | `MMFillExecuted(mmProvider, mmSigner, receiver, tokenIn, tokenOut, amountIn, amountOut, avgPrice, filledAfter)` on the executor |
| Messages that reached the chain | `LadderCommitted`, `OffsetsCommitted`, `AnchorCommitted`, `ControlsCommitted` on the executor                                   |

`mmProvider` and `mmSigner` are indexed. A trade split across makers emits one `MMFillExecuted` per maker.

## Stop quoting

| Action                                                             | Effect                                  |
| ------------------------------------------------------------------ | --------------------------------------- |
| Stop sending                                                       | ladders expire at their `expiresAt`     |
| Send a tombstone: a ladder with a dust top size and a higher nonce | replaces outstanding quotes immediately |
| `setApprovedExecutor` to another address                           | all fills revert                        |
| `withdraw`                                                         | provider is empty; fills revert         |

To resume, send new messages with higher nonces.
