# Protocol Fees

To build the right incentives, certain fees are in place. Every user should be aware of the fees they might need to pay, as these may be deducted at certain points.

### Fees

<table><thead><tr><th width="182"></th><th width="234">Details</th><th>Default value</th></tr></thead><tbody><tr><td>Pool fee</td><td>Fixed fee paid to the pool when interacting with it</td><td>1.5 ADA (Paid to the pool with supply token)</td></tr><tr><td>Protocol fee</td><td>% of interest paid to the DAO when repaying the loan</td><td>1% When UR is &#x3C;15%<br>1.5% When UR is between 15% and 45%<br>2% When UR is >45%</td></tr><tr><td>Liquidation fee</td><td>Fee paid by borrower at a time of liquidation</td><td>2.5% of collateral</td></tr><tr><td>Swap fee</td><td>Fee accounted when converting values using price feed</td><td>0.3% of value</td></tr></tbody></table>

#### Pool fee

To optimize protocol usage, a pool fee can be added. The fee is a fixed value (e.g., 1.5 ADA) denominated in pool tokens and must be paid directly to the pool. This fee is incurred for every type of pool interaction:

* Deposit
* Withdraw
* Borrow
* Repay
* Liquidate

#### Protocol fee

A protocol fee is collected in a predefined wallet for each pool. The fee is paid as a percentage of the total interest. This percentage can vary based on the utilization rate; a higher utilization rate could result in a different percentage fee. The UI provider decides which pools to accept.

```rust
fn get_platform_fee(
  collateral_datum: CollateralDatum,
  platform_fee_datum: pool.PlatformFeeDetails,
) -> Int {
  expect Some(utilization_rate) =
    collateral_datum.loan_amount * 1000000
      |> rational.new(collateral_datum.lent_out + collateral_datum.balance)
  if
  (
    utilization_rate
      |> rational.compare(rational.from_int(platform_fee_datum.tier_1_threshold))
  ) == Less{
  
    platform_fee_datum.tier_1_fee
  } else if (
    utilization_rate
      |> rational.compare(rational.from_int(platform_fee_datum.tier_2_threshold))
  ) == Less {
    platform_fee_datum.tier_2_fee
  } else {
    platform_fee_datum.tier_3_fee
  }
}
```

#### Example

* Utilization Rate (UR): 20%
* Protocol Fee if UR is between 15% and 45%: 5%
* Loan Interest: 17.5 ADA

Protocol fee paid to wallet X: $$17.5 ADA×5%=0.875 ADA17.5 ADA×5%=0.875 ADA$$

{% hint style="info" %}
Cardano's native minimum ADA requirement to send is approximately 1 ADA if the fee is in ADA, or approximately **1.2 ADA plus the fee** if the asset is a native asset.
{% endhint %}

#### Liquidation fee

To incentivize liquidators, a liquidation fee is paid when a loan is liquidated. The fee is a percentage of the `collateral value`

```rust
 expect Some(borrower_compensation_in_ada) =
    rational.new(
      ( collateral_value) * 975000,
      1000000,
    )
```

**Example**:

* Loan: 100 ADA
* Collateral: 120 ADA
* Interest: 2 ADA
* Liquidation Fee: 2.5%

Upon liquidation, the liquidator will receive: Liquidation fee = 120 \* 2.5% = 3 ADA

After liquidation, the borrower would receive: 120 ADA - 100 - 2 - 3 = 15 ADA


---

# 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://lenfi.gitbook.io/docs/liquidity-pools/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.
