> 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     |


---

# 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 dynamically by asking a question.

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

```
GET https://docs.trilobyte.finance/protocol-mechanics/fees.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
