> For the complete documentation index, see [llms.txt](https://docs.trilobyte.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trilobyte.finance/protocol-mechanics/fees.md).

# Fees

Trilobyte charges two types of fees: a protocol fee that sustains the protocol, and a late fee that signals vault health.

## Protocol Fee

A **0.5% protocol fee** (a governance parameter, default `50_000` in 7-decimal fixed-point) is collected at two points, and always sent to the **protocol treasury** (the address stored in the Globals contract).

### On investor deposits (funding)

When an investor funds a loan, 0.5% is taken off the deposit and sent to the treasury; the **remainder is what gets lent**. Debt tokens are minted 1:1 with the **net** amount.

> *Example: a 100,000 USDC deposit → 500 USDC to the treasury → 99,500 USDC enters the loan (and 99,500 debt tokens are minted to the investor).*

### On loan repayments — charged to the borrower, never the investors

Each repayment is **first split** by the vault's split ratio (the investor share goes to the **EMI pool**, the remainder to the borrower's **cash pool**). The 0.5% fee — calculated on the gross payment — is then charged **only to the borrower's cash share. The EMI pool is never touched.**

This is a deliberate design choice: **investor amortisation is independent of the fee.** Investors always receive their full split; the protocol fee comes out of the borrower's retained cash.

> *Example (50/50 split, 10,000 gross payment): 5,000 → EMI pool (investors, untouched); 5,000 cash share → 50 fee to the treasury → 4,950 to the borrower's cash pool.*

{% hint style="info" %}
**Fee clamp.** The repayment fee can never exceed the borrower's cash share. It would only bind if the protocol fee were raised above the cash percentage (e.g. above 50% on a 50/50 split). If it ever clamps, a `ProtocolFeeClamped` event is emitted so the treasury shortfall is observable.
{% endhint %}

### Fee configuration

* Default: `50_000` (0.5%).
* Updated via `set_protocol_fee(fee, caller)` on the Globals contract by the **Operations Admin**. *(This action is not currently timelocked — see* [*Governance*](/protocol-mechanics/governance.md)*.)*

## Late Fees

When a borrower misses a payment deadline, the Pool Manager can apply a **late fee** penalty.

* **Rate**: 18% per annum on the overdue amount — currently **hardcoded in the vault contract** (`1800` bps), not read from a configurable setting.
* **Applied by**: the Pool Manager, via `apply_late_fee(caller)`.
* **Condition**: only when the payment is overdue (`now > next_due`).
* **Effect**: accrues to the vault's `late_fees` accounting balance and advances the schedule to prevent double-charging.

$$
\text{late\_fee} = \text{overdue\_amount} \times \frac{1800\ \text{bps}}{10{,}000 \times 12}
$$

{% hint style="info" %}
Late fees are an **accounting figure** that signals vault health — they accrue in the vault's `late_fees` balance and are emitted via the `LateFeeApplied` event. Note that the default-trigger clock uses an immutable schedule measured from disbursement, so applying a late fee cannot delay when a loan can be marked in default.
{% endhint %}

## Fee Summary

| Fee          | Rate     | Charged on        | Taken from                                       | Recipient |
| ------------ | -------- | ----------------- | ------------------------------------------------ | --------- |
| Protocol fee | 0.5%     | Investor deposits | The deposit                                      | Treasury  |
| Protocol fee | 0.5%     | Loan repayments   | The borrower's cash share (never investor yield) | Treasury  |
| Late fee     | 18% p.a. | Overdue payments  | Accrued (accounting only)                        | Vault     |
