> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yield.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Monetization

> On Morpho Blue, charge your own fee on the collateral, on the amount borrowed, or both, through the supply wrapper and the borrow allocator.

On Morpho Blue markets, you can charge your own fee on loans opened through your integration: on the collateral a user supplies, on the amount they borrow, or both. Fees are taken on-chain by Yield.xyz fee contracts that sit between the user and Morpho Blue. The position always stays on the user's own address, so liquidation works exactly as it does on Morpho.

Fees are available on Morpho Blue markets today. Aave V3, SparkLend and Lista carry no fee contract, and their markets' fee fields are always zero.

## How fees are configured

Fee contracts are configured per project, and per integration, with the Yield.xyz team. Each fee is set in basis points, as a default and optionally per market, and is capped on-chain at 500 bps (5%) per operation. Commercial terms are on [Plans](https://docs.yield.xyz/documentation/plans-limits/plans-tiers.md).

Read the fees on a market before you build an action:

| Market field | Meaning |
| - | - |
| `feeWrapperAddress` | The supply fee wrapper for your project, or `null` when none is configured |
| `supplyCollateralFeeBps` | The supply fee rate, as a string such as `"50"` (0.5%) |
| `originationFeeWrapperAddress` | The borrow allocator for your project, or `null` |
| `originationFeeBps` | The fee on borrowed capital |

A configured contract can still charge `0`: the address tells you a contract is in place, and the bps tells you the current rate.

## Fee on collateral: the supply wrapper

The supply-collateral fee is charged on `supply`. When the wrapper applies, the action's `APPROVAL` targets the wrapper instead of Morpho, and the wrapper deducts its fee before the rest reaches Morpho as collateral. A supply of `amount` leaves `amount × (1 − feeBps / 10000)` as collateral.

The action previews the fee in `metadata.feeAmount`, in raw units of the supplied token, and `metadata.feeBps`. `predictedHealthFactor` and `predictedLtv` already reflect the collateral after the fee. When you size a supply by `borrowAmount` and `targetLtv` on a first deposit, the API grosses up the collateral so the target LTV still holds after the fee.

## Fee on borrowed capital: the borrow allocator

The borrow allocator charges an origination fee on the borrowed amount. This is usually the natural place to charge, because the fee scales with the loan the user takes.

When the allocator applies, a `borrow` routes through it:

1. **`AUTHORIZE`** lets the allocator borrow on the user's behalf on Morpho. It is added only when the user has not already authorized it.
2. **`BORROW`** goes through the allocator. It borrows from Morpho against the user's own position, sends the fee to your fee recipient and sends the rest to the user. The API grosses up the principal so the user receives the amount they asked for, and the recorded debt is correspondingly higher.
3. **`DEAUTHORIZE`** revokes the authorization, when your project is configured to leave no standing authorization. A `DEAUTHORIZE` is also added when a `withdraw`, or a `repay` with a collateral leg, takes all remaining collateral and closes the user's last Morpho Blue position on that network.

Supply, repay and withdraw go straight to Morpho; the allocator is only in the path when a fee is taken. The action previews the fee in `metadata.originationFeeBps`, `metadata.originationFeeAmount` and `metadata.effectivePrincipalAmount`.

## Next steps

> [card] [Core concepts](https://docs.yield.xyz/documentation/borrow/core-concepts/index.md)
>
> Actions and the preview metadata that reflects these fees before you sign.

> [card] [Borrow objects](https://docs.yield.xyz/api-reference/borrow/objects.md#action-metadata)
>
> Every fee field on markets and actions.

> [card] [Borrow API guide](https://docs.yield.xyz/guides/borrow/index.md#fees)
>
> How fees change the transactions and amounts an action returns.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.