> For the complete documentation index, see [llms.txt](https://docs.peach.ag/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.peach.ag/documentation/arc/launchpad/launchpad-pro/core-features/events-and-indexing.md).

# Events & Indexing

Index Factory **`0x957B372851b845303714EdF151B80355a7fC1057`** on chain **`5042002`** and Hook proxy **`0xa92B3A16e18Cc90550c9550C6fF92a839F19E044`**. Discover each Token and Curve from that Factory's records and receipts.

Use transaction receipts to confirm actions and events to build history. Read the relevant contract state after each confirmed action before choosing the next step.

### What to track

| Contract              | Main events                                                            | Application result                                               |
| --------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------- |
| Factory               | `TokenCreated`, `LaunchCreatedV2`                                      | Register the token, its curve, creator and quote token           |
| Token                 | `Transfer`, `MetadataUpdated`                                          | Update balances, live supply and metadata                        |
| Curve                 | `CurveTrade`, `FeeAllocated`, `CurveFeesSwept`                         | Record actual trades, accrued fees and settlement                |
| GraduationCoordinator | `GraduationSwept`, `PoolGraduated`, `EmergencyExited`                  | Update the lifecycle state, official pool or redemption instance |
| Hook proxy            | Pool fee and settlement events                                         | Track fees by pool and asset                                     |
| FeeEscrow             | `FeeCredited`, `FeeClaimed`, `PartnerFeeCredited`, `PartnerFeeClaimed` | Update credited balances and withdrawals                         |

Resolve each instance from the launch's registered contracts and decode receipts with the matching ABI. Filter by the actual emitter; Hook logs come from the configured proxy. Keep `poolId` from the `PoolGraduated` event.

### Record actual spending

| `CurveTrade` field        | Buy                                | Sell                     |
| ------------------------- | ---------------------------------- | ------------------------ |
| `tokenAmount`             | Tokens delivered                   | Tokens sold              |
| `grossQuoteBasisRaw`      | Actual quote spent, including fees | Quote output before fees |
| `quoteSpentOrReceivedRaw` | Actual quote spent                 | Quote paid after fees    |
| `tokenRecipient`          | Token recipient                    | Quote recipient          |

A last buy can spend less than the submitted input. Record its actual fill and refund rather than the request amount. The immediate payer can be a router or Forwarder; keep it separate from the user's account.

`AutoGraduationFailed` can be emitted by the Curve or, for an initial buy, the Factory. It does not by itself mean the purchase failed. Re-read the [graduation state](https://docs.peach.ag/documentation/arc/launchpad/launchpad-pro/core-features/graduation).

### Track money once

Accrued fees, Escrow credit and wallet payouts are stages of the same funds. Keep them separate by asset and destination. In particular, `pendingCreatorTax` is already included in `pendingCreator`.

For an indexer, identify each log by chain, block hash, transaction hash and log index. Support chain reorganizations and periodically reconcile balances against contract reads. See [Fees & Claims](https://docs.peach.ag/documentation/arc/launchpad/launchpad-pro/core-features/fees-and-claims) and [Revenue Distribution](https://docs.peach.ag/documentation/arc/launchpad/launchpad-pro/core-features/revenue-distribution).

### Protection and Holder events

Decode ConfigRegistry `PoolProtectionConfigured(bytes32)` with the V7 ABI and refresh rule caches; there is no global duration field. Token `PoolProtectionInitialized` records actual duration in seconds and the fixed list. Global rule changes must not rewrite existing token settings.

Track Pro Holder `DividendEpochPublished`, `DividendClaimed` and `DividendEpochRolledOver` separately from ordinary FeeEscrow credits. Store the Epoch payout asset alongside its amounts. A reward publication does not mean the beneficiary has claimed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.peach.ag/documentation/arc/launchpad/launchpad-pro/core-features/events-and-indexing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
