# Hooks

The `x/inflation` module implements the `AfterEpochEnd` hook from the `x/epoch` module in order to allocate inflation.

### Epoch Hook: Inflation <a href="#epoch-hook-inflation" id="epoch-hook-inflation"></a>

The epoch hook handles the inflation logic which is run at the end of each epoch. It is responsible for minting and allocating the epoch mint provision as well as updating it:

1. Check if inflation is disabled. If it is, skip inflation, increment number of skipped epochs and return without proceeding to the next steps.
2. A block is commited, that signalizes that an `epoch` has ended (block `header.Time` has surpassed `epoch_start` + `epochIdentifier`).
3. Mint coin in amount of `epochMintProvision` and allocate according to inflation distribution to staking rewards, usage incentives and community pool.
4. If a period ends with current epoch,
   1. increment the period by 1 and set to store and
   2. recalculate epochMintProvision and set to store.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.metanovaverse.com/protocol-developers/modules/inflation/hooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
