# Fees

Divigent charges a protocol fee only on realised yield.

The fee model is:

* 10% of realised yield, calculated at withdrawal time.
* Zero fee if no realised yield exists.
* Zero fee if the withdrawal returns less than principal.
* No fee on principal under any condition.

## How Realised Yield Is Calculated

The router measures realised yield from the actual USDC received during withdrawal, not from estimates:

```
actualGross = USDC balance after redemption - USDC balance before redemption
realisedYield = max(actualGross - principalOut, 0)
fee = ceil(realisedYield * 10%)
netToWallet = actualGross - fee
```

`principalOut` is the proportional slice of the wallet's `costBasisUSDC` corresponding to the dvUSDC being burned. This is the protocol's record of how much principal the wallet originally contributed for those shares.

If `actualGross <= principalOut`, realised yield is zero and the fee is zero.

## Why Post-Redemption

Vault calls can include rounding, liquidity effects, or exact-asset redemption behaviour. Estimating fees from share prices before redemption could over-charge or under-charge. Divigent measures actual delivered USDC and applies the fee only after the router knows what actually arrived.

## Fee Collection

The `DivigentFeeCollector` does not custody USDC.

When a fee exists, the fee collector pulls the fee amount directly from the router to the treasury using `safeTransferFrom`. The router holds the USDC for the duration of the withdrawal transaction only.

## Treasury Rotation

The fee treasury can be rotated, but the path is intentionally slow:

* 7-day timelock between rotation proposal and execution.
* 14-day grace window after the timelock during which the rotation can be executed.
* Gated through the emergency multisig.

This prevents a single rapid action from redirecting protocol revenue without on-chain visibility.

{% hint style="success" %}
Divigent fees are charged on realised yield only. Principal is never charged a protocol fee.
{% endhint %}


---

# 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://divigent.gitbook.io/divigent-docs/protocol/fees.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.
