Exploring mrgnlend: A Guide to Decentralized Lending and Borrowing

DANNY
marginfi
Published in
6 min readAug 28, 2023

--

mrgnlend is an overcollateralized borrow-lend build on the marginfi protocol. Designed to prioritize risk management and provide a secure solution for leveraging and optimizing capital, mrgnlend opens up a world of possibilities for users seeking to navigate the world of decentralized lending and borrowing. In this overview, we’ll delve into the critical aspects of lending, borrowing, and liquidation within the mrgnlend protocol, all explained in a clear and accessible manner.

Lending: Growing Your Crypto Holdings

At its core, lending involves putting your crypto assets to work and to generate interest. With mrgnlend, you can lend your digital currencies to others. In return for lending your assets, you receive interest payments, allowing you to grow your crypto holdings over time. This is a unique way to harness the power of your crypto and earn rewards from your investment. The interest earned is quoted as an APY (annual percentage yield) and varies based on the asset you are lending.,

Lending in the context of mrgnlend works a bit differently than traditional lending models. Let’s break it down in simple terms:

How Lending Works in mrgnlend

1. Supplying Funds: As a lender on mrgnlend, you provide your crypto assets (such as Solana, USDC, or other supported tokens) to the designated pool. These assets are used to fund the borrowing activities of other users.

2. Earning Interest: In return for supplying your assets, you earn interest over time. This interest is a form of compensation for allowing others to borrow your funds. This is calculated in APY and varies for different assets.

3. Risk and Security: It’s important to note that lending involves risk.

Lending on mrgnlend

Easy steps to lend on mrgnlend

  1. Connect your Solana wallet to the marginfi dapp
  2. Select from the pool and deposit the amount you wish to lend
  3. Earn yield on your deposited assets

Borrowing: Seizing Opportunities

Borrowing takes a different approach. Imagine you want to seize a lucrative opportunity in the crypto market, but you need more funds than you currently have. mrgnlend enables you to use your existing crypto holdings as collateral to secure a loan. This loan can then be used for various purposes, such as trading, investing, or further diversification. In essence, borrowing through mrgnlend empowers you to take advantage of potential opportunities without immediately liquidating your existing assets.

This is facilitated by a pool of assets pulled in from lenders who earn interest on them. When you borrow any asset from mrgnlend, you will pay a fee called “borrowing interest”.

The interest rate is determined by utilization meaning that the more that is borrowed, the higher the rate.
In mrgnlend there is no set time for repayments, you can borrow for as long or as short as you like if your account remains healthy. A liquidation process is set in if your account falls within the threshold set by the protocol

Borrowing on mrgnlend

3 easy step on how to borrow on mrgnlend

  1. Connect your Solana wallet to the marginfi dapp
  2. Deposit a collateral first. You can do this by supplying/depositing your preferred collateral assets to the designated pools.
  3. Chose from the available pools of assets and click borrow

N/B. Always remember to check the APR (interest rate ) on each asset before borrowing and take notice of your account health to avoid liquidation

In summary, lending in mrgnlend involves supplying your crypto assets to the protocol to earn interest. Borrowing is facilitated by the tokens pooled together by lenders, where borrowers provide collateral and are connected with available funds from lenders. This decentralized approach streamlines the lending and borrowing process while prioritizing risk management for both parties.

Liquidation: Safeguarding Your Investments

Liquidation is a critical safety feature within the mrgnlend ecosystem. If the value of your borrowed assets falls below a certain threshold, the protocol automatically initiates a process to sell a portion of your collateral in order to repay the loan. This protective mechanism ensures that lenders are safeguarded and borrowers remain accountable, maintaining the stability and integrity of the platform. Liquidation acts as an essential safety net .

Liquidation is determined by your account health.

Liquidation Process in mrgnlend

1. Collateralization Ratio: When borrowers request funds, they provide collateral (crypto assets) to secure their loans. This collateral acts as a safety net for lenders in case the borrower is unable to repay. The collateralization ratio is the key factor in determining when liquidation might occur. It’s the ratio of the value of the collateral to the value of the borrowed funds.

2. Threshold Trigger: If the value of the borrowed assets decreases and the collateralization ratio falls below a certain threshold (often referred to as the “liquidation threshold”), the protocol considers the loan to be at risk of default.

3. Liquidation Initiation: When the collateralization ratio crosses the liquidation threshold, the protocol automatically triggers the liquidation process. This involves selling a portion of the borrower’s collateral to repay the borrowed funds and any accrued interest. Liquidation is designed to prevent losses for lenders and maintain the overall health of the platform.

This is determined by your Account health. Let us take a look at account health and how it works

Account Health

Every account in mrgnlend is represented with a health factor. Your account health factor is a single value that represents how well collateralized your portfolio is or in other words how healthy it is.

Account health is calculated with the following formula:

A = assets weighted (collateral) — — liabilities weighted(borrowed tokens) divided by assets weighted

Asset weight is How much your assets count for collateral, relative to their USD value. The higher the weight, the more collateral you can borrow against it.

Your account health is typically between 0% and 100%, You will get liquidated when your account health reaches 0%.

Liquidation Fees

When borrowed trader positions fall below-configured margin requirements, they are exposed to liquidation. Liquidations on mrgnlend are automatic and permissionless.

Liquidations are executed by third-party liquidators who provide this service for a return, and mrgnlend awards a fee for successful liquidations.

When borrowed positions fall below requirements and are liquidated, liquidated borrowers (or, liquidatees) pay a fee as a penalty. Currently, liquidation penalties and liquidator fees are 2.5%

Differentiating mrgnlend from Traditional Lenders

mrgnlend sets itself apart from traditional lenders through its fully decentralized and permissionless nature. Unlike traditional financial services, mrgnlend operates on smart contracts deployed on a blockchain, eliminating intermediaries and granting direct access to its services. This shift promotes transparency, inclusivity, and accessibility, challenging the conventional barriers that often limit financial opportunities.

Comparing mrgnlend with Other DeFi Protocols

Compared to other decentralized lending protocols, marginfi stands out with its robust risk management mechanisms and emphasis on transparency. A notable feature is its support for non-tokenized trader positions from other trading platforms. This feature allows you to consolidate your DeFi portfolio within the marginfi ecosystem, offering enhanced control, safety, and capital efficiency (N/B this feature is not live yet)

Embrace the Future with mrgnlend

In conclusion, mrgnlend empowers you to participate in the world of decentralized lending and borrowing with confidence. By emphasizing risk management, transparency, and accessibility, mrgnlend provides a secure and user-friendly platform for users to engage in lending and borrowing activities. Whether you’re seeking to earn APY from your crypto holdings or explore new opportunities, mrgnlend opens the door to a future of decentralized finance.

--

--

DANNY
marginfi

Ex-Genius II External Dev Advocate Solana Foundation II Bringing decentralization to Africa through Solana Education II CAT IRL