What problem does marginfi solve?
In traditional finance, lending requires trust: banks verify identity, credit scores, and income before issuing loans. Decentralized lending protocols like marginfi replace this trust with math. Instead of checking who you are, the protocol checks what you have locked as collateral — and enforces repayment automatically through on-chain rules.
marginfi is a non-custodial, overcollateralized lending protocol on Solana. This means that to borrow $100 worth of USDC, you must first deposit more than $100 worth of another asset (say, SOL) as collateral. The protocol never holds your funds — everything is governed by programs (smart contracts) on-chain.
The core accounting: asset weights
Not all collateral is treated equally. marginfi assigns each asset two key parameters that determine how much borrowing power it grants or how much debt it counts for:
Asset Weight (deposit side): how much collateral value the protocol recognizes. SOL might have a deposit weight of 0.80 — meaning $1,000 in SOL only counts as $800 in borrowing power.
Liability Weight (borrow side): how much borrowed value the protocol counts against you. USDC might have a liability weight of 1.20 — meaning borrowing $100 in USDC is treated as $120 of debt in the risk calculation.
These weights create an implicit buffer. Even if both asset and liability prices stay flat, you can never borrow the full value of your collateral. The weights are set conservatively based on each asset's liquidity and volatility profile.
Health Factor: the key metric
The protocol continuously calculates a Health Factor for every account. This is the single number that determines whether your position is safe or at risk of liquidation.
Health Factor = (Σ deposits × asset_weight × price) / (Σ borrows × liability_weight × price)
If Health Factor ≥ 1.0 → position is healthy If Health Factor < 1.0 → position can be liquidated
For example: you deposit 10 SOL at $150 each ($1,500 total). Asset weight = 0.80, so your weighted collateral = $1,200. You borrow 800 USDC. Liability weight = 1.20, so your weighted debt = $960. Health Factor = 1,200 / 960 = 1.25. You're safe — for now.
If SOL price drops to $100, your weighted collateral falls to $800. Health Factor = 800 / 960 = 0.83. The protocol now allows liquidators to step in.
Interest rate model: dynamic rates driven by utilization
marginfi uses a kinked interest rate model. The interest rate paid by borrowers (and earned by lenders) is not fixed — it changes dynamically based on how much of the pool is being used.
Utilization Rate (U) = Total Borrowed / Total Deposited
If U < Optimal Utilization (e.g. 80%): Borrow Rate = Base Rate + (U / Optimal_U) × Rate_Slope_1
If U ≥ Optimal Utilization: Borrow Rate = Base Rate + Rate_Slope_1 + ((U - Optimal_U) / (1 - Optimal_U)) × Rate_Slope_2
The "kink" at the optimal utilization point is intentional. Below 80% utilization, rates rise slowly to attract more borrowers. Above 80%, rates spike sharply — this incentivizes borrowers to repay and depositors to add liquidity, naturally pushing utilization back toward the safe zone. The model is self-regulating.
Liquidation mechanics
When an account's Health Factor drops below 1.0, any external actor (a liquidator bot) can partially repay the borrower's debt in exchange for a discounted portion of their collateral. This is called a liquidation.
The liquidation incentive is a fee — typically 5% — built into the discount. If a liquidator repays $100 of USDC debt, they receive $105 worth of SOL collateral. This profit motive ensures that liquidators are always present and that underwater positions are closed quickly, protecting the solvency of the protocol.
Liquidations on Solana are particularly fast and competitive because of Solana's ~400ms block times and low fees. Liquidator bots can monitor thousands of accounts and execute transactions in near real-time, which dramatically reduces bad debt risk compared to slower chains.
A portion of the liquidation fee also goes to the protocol's insurance fund — a reserve designed to cover any bad debt that occurs if a position becomes insolvent before liquidation is triggered.
Why this design matters
The combination of asset weights, a dynamic interest rate model, and competitive liquidation creates a self-sustaining system. Rates equilibrate supply and demand automatically. Liquidators are economically incentivized to keep the system solvent. And the weights act as a first line of defense against volatility.
marginfi's architecture on Solana takes advantage of the chain's high throughput and low fees to make this system practical at scale. The result is a lending protocol that can serve thousands of concurrent users with sub-second price oracle updates and real-time liquidation coverage.
Understanding these mechanisms is essential for anyone building on top of lending primitives, integrating with marginfi's SDK, or designing protocols that interact with collateralized debt positions on Solana.
