How to Use marginfi: Solana Lending Tutorial 2026

— By Tony Rabbit in Tutorials

How to Use marginfi: Solana Lending Tutorial 2026

Learn how to use marginfi on Solana, from supplying assets to understanding collateral, borrowing, health factor and APR for a safer first workflow.

marginfi is easiest to use well when you treat it as two separate jobs: lending first, borrowing second. The protocol can do both, but beginners often jump straight to the borrow button because it feels more active. That is usually backwards. The calmer way to learn marginfi is to understand how supplying works, how the app tracks your position, and how the health factor matters before you ever borrow a single token.

The official docs describe marginfi as a fully decentralized borrowing and lending protocol on Solana with overcollateralization, embedded risk systems, and a health factor that tracks account safety. That language matters because it tells you what kind of product this is. marginfi is not a passive savings app hiding the details. It is a DeFi credit system, and the interface only makes sense once you respect the risk controls behind it.

Quick answer

  • If this is your first time, start on Lend, not Borrow. Supplying a supported asset is the cleanest way to learn the interface.
  • If you plan to borrow, remember that marginfi is overcollateralized. You supply collateral first, then monitor your health factor closely.
  • Use small size, leave room for Solana fees, and adjust priority fees during congestion if your transaction is struggling to land.
marginfi lend interface showing the main Solana lending marketplace and supply options
The main marginfi app already tells you how to approach it: lending and borrowing live in one interface, but you should not treat them as the same risk profile.

What marginfi Is Best Used For

marginfi is best used when you want an on-chain Solana lending and borrowing interface that makes collateral, borrow cost, and account health visible in one place. The docs explain that users can supply assets to pools, earn yield, and borrow against collateral without traditional intermediaries. That makes the protocol useful for capital efficiency, but only if you understand the difference between earning on idle assets and levering a portfolio.

For most first-time users, the better starting point is simple lending. Supply a supported asset, observe how the app records the position, and learn what the portfolio view means. Once that is clear, borrowing becomes much easier to evaluate because you already understand what is being pledged, what rate you are paying, and what the health factor is protecting against.

When marginfi is a strong fit

Lending idle assets
You can supply supported assets into marginfi pools and earn yield while learning the interface with relatively simple first actions.
Borrowing against collateral
The protocol is built for overcollateralized borrowing, which can be useful when you want liquidity without selling your existing assets.
Portfolio-level risk visibility
marginfi puts health factor and position tracking front and center, which is exactly what a serious borrow interface should do.
Not for blind leverage
If you do not know how liquidation risk works, the borrow side will feel easy right up until it is not.

What to Prepare Before You Use marginfi

Before opening marginfi, know which supported asset you want to supply and whether your goal is yield, borrowing power, or both. Then decide what size you are comfortable testing with. On Solana, it also helps to leave some balance for fees and to remember the docs note about priority fees during congestion. A failed transaction can be a network issue, not necessarily a protocol issue.

If you plan to borrow, decide your risk line before clicking. You should know the collateral you are comfortable posting, the borrow asset you want, and the buffer you want to keep in your health factor. Borrowing without a health plan is just hoping the market cooperates.

marginfi documentation homepage introducing decentralized borrowing and lending on Solana
The docs frame marginfi correctly: a decentralized lending and borrowing system with explicit risk mechanics, not a one-click savings product.

The four checks that matter before you interact with marginfi

CheckWhat to reviewWhy it matters
Asset choiceConfirm the token you want to supply or borrow is supported in the live app.A DeFi lending plan starts with the actual market you can access, not the asset you wish were there.
Lend vs borrow goalKnow whether your first transaction is meant to earn yield or create borrowing power.Those two actions have different risk and monitoring requirements.
Rate awarenessReview yield for lending and APR for borrowing before you size up.A position can look attractive until you realize you were reading the wrong rate metric.
Health factor disciplineDecide how much collateral buffer you want to keep if you plan to borrow.Liquidation risk is easier to prevent before the position exists than after the market moves.

How to Use marginfi Step by Step

The cleanest first-time workflow is to connect your Solana wallet, stay on the Lend tab, choose one supported asset, and supply a small amount. The marginfi docs explicitly describe this as the basic lender path: connect, select the asset, specify the amount, and watch the position appear in the portfolio view.

Only after you understand that should you move to Borrow. On marginfi, borrowing normally requires collateral first. Once collateral is posted, you can choose the borrow asset, review the APR, and check how the new position affects your health factor. That single number is not just decoration. It is the fast read on whether your portfolio is still comfortably collateralized.

A safe first-time marginfi workflow

  • Connect your Solana wallet and confirm you are in the correct app interface.
  • Choose Lend first, pick a supported asset, and supply a small test amount.
  • Open the portfolio view and make sure you understand where the supplied position appears.
  • If you later borrow, review APR and the post-borrow health factor before confirming.
  • During congestion, use priority fee settings if needed instead of repeatedly spamming transactions.
Best beginner rule on marginfi
Your first goal is not to maximize APY. Your first goal is to understand the position you just opened, how it appears in the portfolio, and what would make it safer or riskier over time.

Common marginfi Mistakes to Avoid

The biggest mistake is treating the borrow button like free liquidity. It is collateralized liquidity, and the market can turn that into stress very quickly if you do not leave enough room in your health factor. The second mistake is confusing lending yield with borrowing cost. A user can feel smart about the APY headline while ignoring the APR on the debt side.

The mistakes that punish marginfi users fastest

Borrowing too early
Many users should learn the Lend flow first. Jumping straight to leverage is how the interface feels familiar before the risk actually is.
Ignoring health factor
A healthy account today can become an unhealthy one after price moves or rate changes. That number deserves regular attention.
Mixing up APY and APR
Lending yield and borrowing cost are different numbers with different meanings. Confusing them leads to bad decisions.
Forgetting fee and congestion dynamics
On Solana, transactions can struggle during congestion. Repeated failed attempts create frustration and sloppy decisions unless you slow down and adjust settings properly.

How to Troubleshoot Slow Transactions or Risky Positions

If a transaction does not land, first check whether the network is congested and whether you need to increase the priority fee. The docs explicitly mention that higher priority fees improve the probability of processing, even though they do not guarantee faster inclusion. That is a more useful response than mindlessly resubmitting the same transaction.

If your position feels unsafe, do not wait for the market to educate you. Review the health factor, reduce borrow size if needed, or add more collateral while the decision is still yours. On lending platforms, the best troubleshooting often happens before liquidation ever becomes possible.

Frequently Asked Questions

What is marginfi used for?

marginfi is used for decentralized lending and borrowing on Solana. The protocol is designed around permissionless access, overcollateralization, and a health factor that helps manage liquidation risk.

Do I need collateral before borrowing on marginfi?

Yes. The marginfi docs explain that borrowing is overcollateralized, so you normally supply collateral first and only then borrow against it.

What is the health factor on marginfi?

The health factor is the account-level safety indicator that shows how well collateralized your positions are. If it falls too low, liquidation risk rises.

What is the difference between APY and APR on marginfi?

When you lend, you typically focus on yield or APY. When you borrow, you focus on borrowing cost or APR. Mixing those two is one of the easiest beginner mistakes.

Can I use marginfi just to lend and not borrow?

Yes. In fact, that is often the safest first use case. Many users start by supplying a supported asset and learning the interface before they ever open a borrow position.

Disclaimer: This article is for educational purposes only and does not constitute investment or financial advice. DeFi lending and borrowing involve smart contract risk, liquidation risk, interest-rate risk, and execution risk, so always start small and monitor your positions actively.

Related Guides