# Fees

Trilobyte charges two types of fees to sustain the protocol and incentivise responsible management.

## Protocol Fee

A **0.5% fee** (50 basis points) is charged on two types of transactions:

| Transaction           | When                          | Example                                                       |
| --------------------- | ----------------------------- | ------------------------------------------------------------- |
| **Investor deposits** | During the RaisingFunds phase | 100,000 USDC deposit → 500 USDC fee → 99,500 USDC credited    |
| **Loan repayments**   | During the Active phase       | 10,000 USDC payment → 50 USDC fee → 9,950 USDC split to pools |

The protocol fee is deducted automatically and transferred to the **protocol treasury** address stored in the Globals contract.

### Fee Configuration

* The default fee is set to `50_000` in 7-decimal format (0.5%)
* The fee can be updated by the Governor via `set_fee(caller, fee)` on the Globals contract
* Fee changes go through the **Timelock** for governance delay

{% hint style="info" %}
The protocol fee is intentionally low to encourage participation. It covers operational costs and funds protocol development.
{% endhint %}

## 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
* **Applied by**: The Pool Manager via `apply_late_fee(caller)`
* **Condition**: Can only be applied when `now > next_due` (payment is overdue)
* **Effect**: Increments the missed payments counter and advances the next due date (prevents double-charging)

Late fees are calculated as:

$$
\text{late\_fee} = \text{overdue\_amount} \times \frac{18%}{12}
$$

Late fees accumulate in the vault's `late_fees` balance and serve as a signal of vault health. They are tracked on-chain via the `LateFeeApplied` event.

## Fee Summary

| Fee          | Rate     | Charged On            | Recipient | Set By                  |
| ------------ | -------- | --------------------- | --------- | ----------------------- |
| Protocol fee | 0.5%     | Deposits & repayments | Treasury  | Governor (via Timelock) |
| Late fee     | 18% p.a. | Overdue payments      | Vault     | Pool Manager            |


---

# 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.trilobyte.finance/protocol-mechanics/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.
