Skip to main content

Protocol fees and reserves

Exactly two fees​

Farmenta charges two fees and nothing else:

  1. The reserve factor: a share of the interest that borrowers pay. 15% on the Blue-chip market, 25% on the Meme market.
  2. The protocol liquidation fee: one tenth of the liquidator bonus, paid by the liquidator in USDG. 0.5% of the repaid amount on Blue-chip, 1% on Meme.

Both go into the market's reserve. There is no deposit fee, no withdrawal fee, no origination fee and no flash loan fee. This list is fixed in the current code.

One drawer with a minimum​

It is easy to picture the 15% being split: some for profit, some for a rainy day. That is not how it works.

Think of the till drawer in a shop. All the money goes into the same drawer. The drawer must always keep a minimum amount of change. Only what is above that minimum can be taken home.

The reserve is that drawer. Everything the protocol earns goes in. The minimum is the reserve floor. The owner can withdraw only the part above the floor. So the split is not a percentage, it is an order: fill the drawer to the floor first, and only the excess is revenue.

A small example​

Lina supplies $100,000 to the Blue-chip market. Budi borrows $10,000. Nobody else uses the market.

utilization = 10,000 / (90,000 + 10,000) = 10%
borrow rate = 4% × 10 / 80 = 0.5% per year

After one year:

interest added to Budi's debt $50.00
85% to lenders (Lina) $42.50
15% to the reserve $7.50

lender funds = cash + totalBorrows − reserves
= $90,000.00 + $10,050.00 − $7.50 = $100,042.50

reserve floor = lender funds × 1% = $1,000.42
reserve = $7.50
withdrawable by the owner = $0.00

The reserve holds $7.50 and the floor is $1,000.42. Nothing can be withdrawn. All of the $7.50 acts as a loss buffer for lenders.

Every action and its fee​

ActionWho actsProtocol feeGoes to
deposit / mint (supply USDG)LenderNone
depositCollateral, depositCollateralWithPermit, mintAndDepositBorrowerNone
borrowBorrowerNone
Interest accrualBorrowersReserve factor: 15% of interest (Blue-chip), 25% (Meme)Reserve
collectFeesBorrowerNone
increaseLiquidity / decreaseLiquidityBorrowerNone
repayBorrowerNone
liquidateLiquidatorOne tenth of the bonus: 0.5% of the repaid amount (Blue-chip), 1% (Meme)Reserve
withdrawCollateralBorrowerNone
withdraw / redeem (take USDG out)LenderNone
withdrawReservesOwnerNonePays out only the part above the floor

Swap fees that your position earns on Uniswap are yours. Farmenta takes no share of them.

The reserve factor​

Interest is not billed separately. It is a spread. On the Blue-chip market at 50% utilization, borrowers pay 2.5% per year and lenders earn 1.0625% per year on all supplied funds. The difference that does not reach lenders is the 15% that goes to the reserve.

reserves = reserves + interest × reserveFactor

This happens automatically on every accrual. See interest rates.

The protocol liquidation fee​

The fee is derived from the pool's liquidator bonus, not stored separately:

protocolLiquidationFee = liquidatorBonus / 10

The liquidator pays it on top of the amount repaid. Example on Blue-chip, where Rina repays $6,150 of Budi's debt:

repaid $6,150.00
seized for Rina (+5%) $6,457.50
protocol fee (0.5%) $30.75 to the reserve
Rina pays in total $6,180.75
Rina's net margin $276.75 (4.5% of the repaid amount)

A liquidator always keeps nine tenths of the bonus. If a pool is listed with a higher bonus, for example 7%, the protocol fee becomes 0.7% automatically. See liquidation mechanics.

The reserve floor​

floor = totalAssets × reserveFloorBps / 10000
withdrawable = min(reserves − floor, cash) (zero if reserves <= floor)
Blue-chipMeme
Reserve floor (reserveFloorBps)1% of totalAssets2.5% of totalAssets

withdrawReserves(amount, to) reverts with ReserveWithdrawalExceedsAvailable if amount is larger than withdrawable. There is no switch that opens or closes withdrawals. If the reserve drops below the floor, because of bad debt or because new deposits raised totalAssets, withdrawals close by themselves until the reserve has grown back.

The lens contract shows the current numbers: reserveFloor() and withdrawableReserves(). The market exposes reserves(), reserveFloorBps() and totalReservesWithdrawn(), the running total the owner has taken out.

Why the floor follows lender funds, not debt​

The floor is a promise to lenders, so it follows what lenders have at stake: totalAssets.

Compare it with a floor based on outstanding debt, for instance 2% of debt. Repaying a loan does not reduce what lenders have at stake. It only moves money from "lent out" to "idle cash". A floor based on debt would shrink with every repayment and vanish once all loans are repaid, which would make the whole buffer withdrawable while lenders are still in the market.

StateLent outLender fundsFloor at 2% of debtFloor at 1% of lender funds
Busy$51,250$101,062.50$1,025.00$1,010.62
Quiet$10,000$101,062.50$200.00$1,010.62
All repaid$0$101,062.50$0.00$1,010.62

The floor does shrink when lenders withdraw their funds. At that point there is less left to protect.

How long until anything is withdrawable​

From interest alone, the time until the reserve passes the floor is roughly:

years = reserveFloorRate / (utilization × borrowRate × reserveFactor)

Here reserveFloorRate is reserveFloorBps / 10000, which is 1% in the Blue-chip market.

For the Blue-chip market with $100,000 supplied:

BorrowedUtilizationBorrow rateTo lenders per yearTo the reserve per yearYears until the floor is passed
$10,00010%0.5%$42.50$7.50about 133
$30,00030%1.5%$382.50$67.50about 14.8
$50,00050%2.5%$1,062.50$187.50about 5.3
$80,00080%4%$2,720.00$480.00about 2.1

The figures are approximate because the floor itself rises slowly as lender funds grow. In every row, the amount withdrawable in the first year is $0.

Liquidations bring the reserve closer to the floor from one side only. The liquidation fee raises the reserve, but a liquidation without bad debt does not change totalAssets (cash goes up, debt goes down by the same amount), so the floor stays where it is.

The floor limits the owner, not loss absorption​

The floor does not protect the reserve from bad debt

When a loan ends as bad debt, the loss is taken from the whole reserve, including the part below the floor. The floor only limits what the owner can withdraw through withdrawReserves.

This is deliberate. If the floor also shielded the reserve from bad debt, losses would land on lenders while reserve money sat idle. See bad debt and loss absorption.

The reserve grows from interest and liquidation fees, so it starts small and builds up over time. The bad debt example shows how a loss is split between the reserve and lenders.

Cash is a shared physical limit​

The reserve is not a separate wallet. Its USDG sits in the same contract balance as the lenders' idle cash. That is why withdrawable is also capped by cash: nobody can take out USDG that is currently lent to borrowers.

When utilization is high, lenders and the owner draw on the same cash, and whoever withdraws first is served first. The cash limit gives lenders no priority. It does not lower the value of lender shares either, because totalAssets already excludes the reserve. It can only affect how soon a lender can withdraw.