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

# Threats and limits

> Every attack considered and how it's stopped, the invariants that always hold, and what v1 doesn't protect against.

## Threat model

> [accordion] A fake or malicious verifier
>
> A maker deploys an inbox that reports ExpiredUnpaid after the filler pays. **Stopped:**`list` only accepts approved inboxes whose code hash matches the registry.

> [accordion] A verifier swapped after listing
>
> **Stopped:** the order stores the code hash at listing. `matchOffer`, `fulfill` and `refundExpired` revert with `VerifierCodeChanged` if it differs.

> [accordion] Free-option griefing
>
> A filler reserves an order and only pays if the price moves their way. **Priced out:** the matched filler's bond goes to the maker on expiry.

> [accordion] A match with seconds left
>
> **Stopped:**`matchOffer` requires 30 minutes before `payBy`.

> [accordion] Replay across chains or deployments
>
> **Stopped:** the statement commits to the origin chain ID and the market address.

> [accordion] A payment claimed for another order
>
> **Stopped:** the statement commits to the order ID, maker, escrow, full request and filler. Any difference is a different statement.

> [accordion] Paid and ExpiredUnpaid for the same order
>
> **Stopped:** the router decides once, and the inbox refuses a conflicting record.

> [accordion] A forged bridge message
>
> **Stopped:** the inbox checks both the messenger and the cross-domain sender.

> [accordion] A relayer stealing funds
>
> **Impossible:** settlement credits the filler or maker stored in the order, never the caller.

> [accordion] Reentrancy through a token
>
> **Stopped:** value-moving functions are `nonReentrant`, settlement makes no external calls, and withdrawals clear the credit first.

> [accordion] Fee-on-transfer or mis-reporting tokens
>
> **Stopped:** exact balance checks on escrow deposits and withdrawals. A taxed payment token settles only through `payToken`, which measures that the maker received at least the requested amount.

> [accordion] A false claim
>
> A filler claims Paid without paying. **Stopped:** any watcher disputes within the window, and a disputed claim never releases escrow. The bridge then records ExpiredUnpaid and the liar loses the claim bond.

> [accordion] A griefing dispute
>
> Someone disputes an honest claim to delay the filler. **Priced:** the order waits for the bridge, which records Paid, and the griefer's dispute bond goes to the claimant.

> [accordion] Cancelling after the filler paid
>
> **Stopped once Paid is recorded on Ethereum:**`acceptCancel` reverts. While the payment is still in flight it can't be seen, so a filler who has paid must not accept.

> [accordion] Bond-return griefing with many requests
>
> **Bounded:** at most 64 requests per order.

## Invariants

These hold in every reachable state. The fuzzed ledger test checks solvency across random sequences of actions.

* **Solvency:** for each token, the market's balance equals the escrow of live orders plus all credits in that token. For ETH, it also includes the bonds held for live orders.
* **Exclusivity:** a statement has at most one outcome, on the router and on the inbox.
* **Ownership:** only the address a credit belongs to can withdraw it.
* **Finality:** a filled, refunded or cancelled order never changes state again.

## Known limits

* **A permanent route stall locks a matched escrow** until both parties cancel.
* **Fast settlement needs one honest watcher** on the destination chain during each 30-minute window. Relayers watch every claim; makers can watch their own.
* **A disputed order waits for the bridge,** about 7 days on rollup routes.
* **The Elysium market is as secure as Elysium,** which launched with a single sequencer and a single data availability server.
* **The filler pays from the same address on both chains.** Smart-contract wallets with per-chain addresses can't fill.
* **Tokens that can freeze balances** (USDC, USDT) could freeze the market's holdings of that token.
* **Rebasing tokens** misbehave in escrow. Use wrapped forms.
* **Non-EVM chains aren't live yet.** Their verifiers are on the [roadmap](https://docs.ambichain.org/resources/roadmap.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.