> For the complete documentation index, see [llms.txt](https://docs.uniocean.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uniocean.io/protocol-and-infrastructure/protocol/core-modules/revenue-module.md).

# Revenue Module

The Revenue Module is an epoch-based treasury and value-routing mechanism designed to collect protocol trading fees, normalize them into a designated target asset, and deterministically split the resulting proceeds across burn, insurance, and treasury destinations.

## Epoch-Gated Execution Model

Revenue processing is executed in the module's `EndBlocker`, gated by two runtime parameters:

* **Enabled:** Globally toggles the revenue pipeline on or off.
* **EpochBlocks:** Defines the round interval in blocks.

On an epoch boundary, the module increments the internal `CurrentRound` counter and begins a full sweep → convert → allocate → settle cycle.

## Oracle-Based Synthetic Conversion

At each round, for non-target balances, the convertible amount per epoch is calculated as:

$$ConvertAmount = Balance \times \frac{MaxSellBpsPerEpoch}{10000}$$

Then the target amount is calculated as:

$$A\_t = \frac{A\_s \cdot P\_s \cdot 10^{e\_t}}{P\_t \cdot 10^{e\_s}}$$

## Allocation into Buckets

Target-denom revenue is split using basis points that must sum to 10,000:

$$BurnBps + InsuranceBps + TreasuryBps = 10000$$

| Bucket    | Settlement               |
| --------- | ------------------------ |
| Burn      | Tokens are burned        |
| Insurance | Sent to Insurance module |
| Treasury  | Sent to fee collector    |

## Governance Parameters

The following parameters are adjustable via governance:

`Enabled`, `TargetDenom`, `EpochBlocks`, `MinLot`, `MaxSellBpsPerEpoch`, `BurnBps`, `InsuranceBps`, `TreasuryBps`, `DenomOracleSymbols`
