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

# Performance

> What Atrum costs to use, measured on real transactions.

Every figure here comes from real testnet transactions, not local estimates.

## Gas per action

Monad charges the **declared** gas limit, and that limit is public. So every user action
declares one identical envelope — otherwise the limit itself would reveal which private action
you took.

| action          | gas         | % of the 2,500,000 envelope |
| --------------- | ----------- | --------------------------- |
| `betEncrypted`  | \~1,947,000 | 78%                         |
| `deposit`       | 1,815,993   | 73%                         |
| `withdraw`      | 1,804,341   | 72%                         |
| `redeemPrivate` | 1,671,108   | 67%                         |

<Note>
  Local `forge` figures understate real cost by **32–55%** — they charge neither calldata, the
  intrinsic transaction cost, nor true cross-contract cold access. Every number above is measured
  on chain.
</Note>

The envelope is set once. Changing it is publicly observable and would shrink the anonymity set
of everything submitted before the change.

## Proving, client-side

Proofs are generated in your browser. Your secrets never leave the device, which means the
circuit artifacts have to be downloaded once.

| circuit          | constraints | prove time | download |
| ---------------- | ----------- | ---------- | -------- |
| `deposit`        | 1,621       | 0.3s       | 2.4 MB   |
| `bet_encrypted`  | 21,252      | 2.3s       | 11.8 MB  |
| `redeem_private` | 14,405      | 1.4s       | 7.8 MB   |
| `withdraw`       | 14,438      | 1.4s       | 7.8 MB   |

Artifacts are cached after first use and loaded per action, so a first bet fetches what it
needs and later ones are instant.

`bet_encrypted` is the largest because the ElGamal encryption happens inside the proof — that
is the step that hides your stake, and it is worth what it costs.

## Batching

Inserting a commitment into the tree costs more gas than a single action can carry. So actions
queue their commitment and the sequencer grafts 64 at a time — a **15.9× saving** per leaf.

Batching is a requirement of the gas budget, not an optimisation.

## Mechanism notes

**Parimutuel dilution.** Money arriving after you changes your payout. That is a property of
pooled markets and applies to every participant equally.

**Fixed denominations.** Deposits and withdrawals use a set ladder of sizes. An unusual amount
would identify its owner and shrink the anonymity set for everyone, so the contract enforces
the ladder rather than leaving it to convention.
