mrgnlend

Edited

A User Guide to Decentralized Borrowing and Lending with mrgnlend

mrgnlend is first-and-foremost a fully decentralized, permissionless protocol for borrowing and lending. Unlike traditional borrowing and lending services, mrgnlend requires no intermediaries for you to supply or access liquidity — all interactions with the mrgnlend protocol are executed by programs deployed on the Solana blockchain. This approach enhances transparency, inclusivity, and accessibility, breaking down the traditional barriers that often restrict financial opportunities.

mrgnlend is designed to provide anyone, anywhere with access to a secure and efficient decentralized lending and borrowing platform built on Solana. By leveraging overcollateralization and robust risk management strategies, mrgnlend ensures users can safely optimize and leverage their capital without relying on traditional intermediaries.

This guide will explore the key aspects of decentralized borrowing and lending with mrgnlend, including its features, benefits, and importance. Let's dive in and discover how mrgnlend can transform your Solana DeFi experience.

What Is Lending on mrgnlend?

Rather than letting your crypto holdings sit idly in your wallet, you can lend them on mrgnlend to achieve capital efficiency and earn interest on the amounts you lend. In principle, lending on mrgnlend looks similar to lending in the world of traditional finance: you supply any amount of capital that others will use for their own borrowing purposes, and you receive interest payments on the capital you supplied. Your deposits are added to an asset pool that borrowers can withdraw from. The yield on your deposits are expressed in terms of an APY (Annual Percentage Yield) and varies depending on the asset you’re lending. While lending on mrgnlend offers great opportunities, it’s important to be aware that lending involves risk.

What Is mrgnlend’s Lending Model?

Supplying Funds. As previously mentioned, lending on mrgnlend requires you, the Lender, to supply funds to a designated asset pool. These funds will then be used to finance the borrowing activities of other mrgnlend users. You can only supply tokens that mrgnlend supports; to view the list of supported assets, please reference app.marginfi.com.

Earning Interest. You earn yield on the amounts you lend. mrgnlend’s interest rate mechanism uses a 2-piece piecewise function that is configured per asset:

<ImageComponent src={LendingEquation} alt="Lending Equation" />

Let’s break this equation down to simpler terms:

  • Utilization (x): This represents the current usage of the available funds in the lending pool. It is calculated as the ratio of borrowed funds to the total available funds (borrowed + unborrowed). For example, if 70% of the pool’s funds are currently lent out, the utilization is 70%.

  • Optimal Utilization (o): This is the target utilization level that the protocol aims to achieve. It’s the point where the interest rates are balanced to encourage both borrowing and lending. If the current utilization matches the optimal utilization, the system is working as intended.

  • Borrower Rate at Optimal Utilization (pl): This is the interest rate that borrowers pay when the utilization of the pool is at the optimal level. It’s set to be attractive enough to encourage borrowing without being too high, ensuring that the pool maintains its optimal utilization.

  • Maximum Borrower Rate (pm): This is the highest possible interest rate that borrowers will pay if the utilization goes beyond the optimal level. As more funds are borrowed and the utilization increases, the interest rate moves towards this maximum rate to manage the demand and incentivize repayments, ensuring the stability of the pool.

How to Lend On mrgnlend: Step by Step

In order to participate as a Lender on mrgnlend, follow these steps (all photos are taken on mobile views):

Step 1. Go to the mrgnlend app and click the dropdown button on the “Sign In”. Proceed to sign in with any available sign in option:

If you’re an experienced Solana user, feel free to sign in with any one of the supported Solana wallets:

Step 2. On the Action Box, make sure you’re on the “Lend” option and proceed to select the asset you want to supply from mrgnlend’s list of supported tokens:

Step 3. Specify an amount and click “Supply” to deposit your tokens into an asset pool:

Step 4. Begin earning yield on your deposit:

Congratulations! if you followed along with the steps above, then you just successfully participated in the mrgnlend protocol. Immediately after providing liquidity, the Portfolio page will be updated with your Supply position.

Step 5. Withdrawing and/or depositing from your Supplied positions:

If you ever decide to withdraw from or add more to your Supplied positions, simply visit the Portfolio page and select the Supplied position you want to interact with and specify the amount you want to withdraw/supply. You can also reference the Portfolio page to track key metrics on your borrow and lend positions, including the interest you’ve earned over time (coming soon).

In times of network congestion, you might want to manually adjust the priority fee of your deposit transaction in order to improve the probability of your transaction landing on chain. To do so, simply click the “Settings” button on the action box and adjust your priority fee accordingly. Priority fees do not mean that your transaction will land faster nor do they guarantee that your transaction will land. They simply improve the probability that your transaction will be processed by the block leader.

What Is Borrowing On mrgnlend?

The Solana DeFi ecosystem presents endless opportunities to profit, but the landscape is constantly evolving, and access to instant liquidity is critical to take advantage of many lucrative trades. When you borrow with mrgnlend, you get immediate access to the liquidity you need to seize these fleeting opportunities without liquidating your existing assets.

mrgnlend is an overcollateralized protocol, meaning you must first lend assets to use as collateral before borrowing liquidity. This ensures that the loans are secure and minimizes risk for Lenders. Borrowing funds on mrgnlend incurs a fee called “borrowing interest,” which is expressed as an Annual Percentage Rate (APR). The more you borrow, the higher your interest rate will be. APRs for each asset can be found in marginfi web interfaces and protocol configurations.

There is no set time for repayments—you can borrow for any duration as long as your account remains “healthy.” If your account health falls below a certain threshold, your positions will be liquidated to repay the loan and protect the protocol.

How to Borrow On mrgnlend: Step by Step

Step 1. Go to the mrgnlend app and connect your Solana wallet:

If you do not have a prior history with the mrgnlend protocol as a Lender, then you must first lend some liquidity before proceeding.

Step 2. Select “Borrow” in the Action Box and review the available liquidity pools of supported tokens. Then choose which asset you want to borrow:

Step 3. In the Action Box, specify the amount you want to borrow and then click “Borrow”:

The “Available Collateral” indicator shows the amount of collateral you have left after opening this borrow position. This available collateral can be used to open other borrow positions or to withdraw part of your collateral.

Always remember to **check the Annual Percentage Rate (APR) for each asset before borrowing** to understand the interest you'll be paying. Additionally, keep an eye on your account health to ensure it remains strong and to avoid the risk of liquidation.

What Is Liquidation on mrgnlend?

Liquidation is first-and-foremost a safety feature. When a Borrower’s positions fall below a safety threshold (determined by the mrgnlend protocol), the Borrower is exposed to liquidation.

When an account is subject to liquidation, the borrower incurs a 5% liquidation penalty, split equally between the liquidator (2.5%) and the Marginfi protocol’s insurance fund (2.5%). The protocol employs a partial liquidation approach, liquidating only the asset with the smallest amount necessary to restore the account's health factor to 1. (More on “health factor” later.)

Liquidations are an automatic and permissionless process, and are executed by third-party liquidators who are rewarded a fee by marginfi for successfully carrying out the liquidation process. Liquidated Borrowers (a.k.a the liquidatees) also pay a penalty fee.

Currently, liquidation penalties, liquidator fees, and insurance fund fees are fixed (but can be configured for each asset pool):

  • Liquidatee penalty: 5% of the liquidatee's position collateral at time of liquidation

  • Liquidator fee: Of the 5% the liquidatee pays as a penalty, the liquidator earns half; or, 2.5% of liquidatee's liquidated collateral.

  • Insurance fund fee: Of the 5% the liquidatee pays as a penalty, the collateral asset-specific insurance fund collects half; or, 2.5% of the liquidatee's liquidated collateral.

The Liquidation Process: Step by Step

  1. Collateralization Ratio. When Borrowers request funds, they must provide collateral in the form of crypto assets to secure their loans. This collateral acts as a safety net for Lenders, ensuring they are protected if the Borrower cannot repay the loan. The collateralization ratio is crucial in determining when liquidation might occur. It is calculated as the ratio of the value of the collateral to the value of the borrowed funds. For example, if you provide $150 worth of collateral to borrow $100, your collateralization ratio is 150%. A higher ratio indicates a more secure loan position.

  2. Threshold Trigger. The threshold trigger, often referred to as the “liquidation threshold,” is a specific point at which the loan is considered at risk of default. If the value of the borrowed assets increases or the value of the collateral drops, causing the collateralization ratio to fall below this threshold, the protocol flags the loan as risky. For instance, if the liquidation threshold is set at 120%, and your collateralization ratio falls to 110%, the protocol will consider your loan at risk and take action to protect the Lenders.

  3. Liquidation Initiation. When the collateralization ratio falls below the liquidation threshold, the protocol automatically initiates the liquidation process to prevent losses for Lenders and maintain the platform’s overall health. This involves selling a portion of the borrower’s collateral to repay the borrowed funds and any accrued interest. For example, if your collateral falls in value and your collateralization ratio drops to 100%, the protocol will sell enough of your collateral to bring the ratio back above the safe threshold, ensuring that the lenders' funds are protected and the platform remains stable.

Account Health Factor: How to Avoid Liquidation

Every account on marginfi with open positions has a “health factor.” This health factor is a single value that indicates how well-collateralized your portfolio is. In other words, it measures the overall stability and safety of your Borrowed and Supplied positions, helping you understand the risk level and whether any actions are needed to prevent liquidation.

Account health is calculated as follows:

Account health is typically between 0% and 100%, but can technically go as low as -∞. When your account health reaches 0% or below, you are exposed to liquidation.

To avoid liquidation on mrgnlend, regularly monitor your account health and maintain a buffer above the liquidation threshold. Understand the weight of your assets and liabilities to better estimate your account health. Consider using stablecoins as collateral for their stable value and leverage marginfi’s tools and resources for informed decision-making.

You’re Now a mrgn mama

Congratulations, you’re now a mrgn mama! This user guide has outlined the fundamental aspects of decentralized borrowing and lending with mrgnlend, including the processes, benefits, and key considerations. By understanding and utilizing the features of mrgnlend, you can effectively optimize and leverage your capital, while also mitigating risks through overcollateralization and robust risk management strategies. Embrace the future of finance with mrgnlend and explore the endless possibilities that decentralized borrowing and lending have to offer.

Stay in touch with marginfi’s latest news by following us on X, and get in touch with the team via our Discord.