# Fees

Overview of all fees on Project 0, both at the program level and the front end.



## Program Fees [#program-fees]

These fees are charged at the smart contract level and apply regardless of how you interact with the protocol.

### Deposits and Withdrawals [#deposits-and-withdrawals]

There are **no fees** to deposit into or withdraw from P0.

### Borrowing [#borrowing]

Borrowers pay interest to lenders. For most Banks, a small portion of borrow interest paid is a fee that goes to the administrator. A small portion also goes to the Bank's insurance fund.

The protocol supports borrow origination fees, but as of November 2025, these have always been zero.

### Repayment [#repayment]

There are **no fees** to repay a debt on P0.

### Flashloans [#flashloans]

There are **no fees** to execute a flashloan on P0.

### Liquidation Fees [#liquidation-fees]

If an Account is partially liquidated, it can lose up to 10% of the cash equity value liquidated. For example, if an account has $100 in assets and $90 in debt (net worth $10), a liquidator seizes $10 of collateral and repays $9 in debt. The account now has $90 in assets and $81 in debt: net worth declined by 10%.

Accounts with a net worth of less than $10 can be fully liquidated: all remaining collateral on the Account is seized and all debt repaid, closing out the Account.

## Front-End Fees [#front-end-fees]

These fees are specific to the [app.0.xyz](https://app.0.xyz) front end. You can avoid them by using a different front end, calling the program directly through scripts, CPI, etc.

### Slippage [#slippage]

When swapping asset A for asset B, the value of B you get is slightly smaller than the value of A you give up. You can configure your maximum tolerated slippage for all swap operations in settings. Different asset pairs have different slippage expectations.

### Swap Fees [#swap-fees]

When swapping asset A to asset B (for features such as collateral repay), a small fee is charged. You can see the fee in the preview breakdown before approving the transaction. Typically this is around 5 bps (0.05%).

### Looping Fees [#looping-fees]

A "loop" is when a user lends A, borrows B, swaps B to A, and repeats. There is no fee to loop, but since a swap is involved, swap fees and slippage are incurred.

The theoretical max leverage of a pair A/B, given Collateral Weight of A (CW) and Liability Weight of B (LW), is:

```
L = 1 / (1 - CW/LW)
```

**Example:** Asset Weight of A is 90%, Liability Weight of B is 100%.

```
User has $10 in Asset A

* Deposits $10 in A (worth $9 in collateral), borrows $9 of B
* Swaps B to A, incurring slippage + fees, getting ~$9 in A
* Deposits $9 in A and repeats
```

Max leverage in this example is `1 / (1 - 0.9/1.0)` = **10x**.

Under the hood, a loop is built in one step using a flashloan. For example, for 7x leverage:

```
Start flashloan
Borrow ~$60 of B
Swap B to A, netting ~$60 after fees
Deposit A (initial $10 + $60 = $70)
End flashloan
```

The user ends up with $70 deposited and $60 in debt. The portfolio net value is still $10. One swap + slippage fee is incurred when opening the position, and another set when closing it.

### Strategy Fees [#strategy-fees]

Like loops, there is no fee to open a strategy except the swap fees and slippage incurred to create the looped position. Swapping from one loop pair (A/B) to another (C/D) may incur **two sets** of swap fees: one to close out the A/B loop, and another to open the C/D loop.

## Fees from Integrated Venues [#fees-from-integrated-venues]

Currently, none of the venues integrated with P0 charge notable additional fees.
