> ## 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.

# Events and errors

> Everything the contracts emit, for indexers, and every error, with what it means.

## Events

| Contract | Event | When |
| - | - | - |
| Market | `Listed(id, maker, token, amount, bond, request)` | Order listed; carries the full request |
| Market | `Interested(id, filler, bond)` | Fill requested |
| Market | `InterestWithdrawn(id, filler, bond)` | Request withdrawn, or bond returned at match or close |
| Market | `Matched(id, filler, statement)` | Filler selected |
| Market | `FeeTaken(id, token, fee)` | Order filled; the fee |
| Market | `IntegratorSet(id, integrator, bps)` | Order listed through an integrator |
| Market | `IntegratorFeeTaken(id, integrator, token, fee)` | Order filled; the integrator's fee |
| Market | `PayoutRequested(id, filler, payout)` | A fill request named a receive address |
| Router | `TokenPaid(statement, spent, received)` | An ERC-20 payment, measured |
| Router | `TicketCreated(statement, ticket, budget, maxFeePerGas)` | `RetryableRouter` sent an outcome to Elysium |
| Inbox | `Claimed(statement, id, claimant, outcome, deadline)` | A bonded claim |
| Inbox | `Disputed(statement, disputer)` | A claim was disputed |
| Inbox | `Resolved(statement, winner, amount, truth)` | A claim's bonds were released |
| Inbox | `BondWithdrawn(account, to, amount)` | Bonds withdrawn |
| Market | `Filled(id, filler)` | Order filled |
| Market | `Refunded(id)` | Escrow returned (closed listing or expiry) |
| Market | `CancelProposed(id, proposer)` | Cancel proposed |
| Market | `CancelAccepted(id, accepter)` | Cancel accepted |
| Market | `Withdrawn(owner, asset, to, amount)` | Credit withdrawn |
| Market | `FeeRecipientProposed(proposed)`, `FeeRecipientChanged(previous, current)` | Fee recipient change |
| Registry | `VerifierApproved(verifier, codeHash, route)`, `VerifierDisabled(verifier)` | Route approval |
| Router | `Decided(statement, outcome)` | Paid or ExpiredUnpaid recorded on the destination |
| Inbox | `Recorded(statement, outcome)` | Outcome delivered on Ethereum |

To rebuild an order's history, key market events by `id`, and join `Decided` and `Recorded` through the `statement` from `Matched`. That's exactly what the indexer behind `GET /offers/{id}` does.

## Errors

| Error | Raised by | Meaning |
| - | - | - |
| `InvalidTerms` | Market | Bad amounts, empty fields, wrong `msg.value`, token without code, terms the verifier rejects, or a bad withdrawal |
| `PaymentWindowTooShort` | Market | Under 30 minutes before `payBy` at listing or matching |
| `Unavailable` | Market | The action doesn't fit the order's state, or a cancel after Paid was recorded |
| `Unauthorized` | Market | Not the maker, the filler or the proposed fee recipient |
| `InvalidBond` | Market | `msg.value` isn't the order's bond |
| `InterestLimit` | Market | The order already has 64 requests |
| `VerifierCodeChanged` | Market | The verifier's code no longer matches the order's pinned hash |
| `InvalidProof` | Market | The verifier hasn't recorded that outcome |
| `TransferFailed` | Market | A token moved a different amount than requested |
| `VerifierUnavailable` | Registry | Not approved, disabled, or code changed |
| `InvalidVerifier` | Registry | Approving an address with no code or an empty label |
| `InvalidOutcome` | Router | Wrong caller, past or before the deadline, wrong amount, or already decided |
| `BadRoute` | Inbox | Unauthenticated, `Pending`, or conflicting outcome |


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