Flash loans are one of the most powerful — and most misunderstood — features in DeFi. They let you borrow millions of dollars with zero collateral, use the funds for any purpose, and repay everything within a single transaction. If the loan isn't repaid, the entire transaction reverts as if it never happened.
On Solana, flash loans execute in milliseconds rather than seconds, opening up opportunities and risks that don't exist on slower chains. This guide explains how they work, who uses them, and why every Solana DeFi user should understand the concept — even if you never use one directly.
A flash loan is an uncollateralized loan that must be borrowed and repaid within a single atomic transaction. "Atomic" means the entire transaction either succeeds completely or fails completely — there's no in-between state where the lender has given out funds without getting them back.
How It Works (Simplified)
- You initiate a transaction that borrows $1,000,000 USDC from a lending protocol
- Within the same transaction, you use that $1M however you want (swap, liquidate, arbitrage)
- At the end of the transaction, you repay the $1M plus a small fee
- If step 3 fails (you can't repay), the entire transaction — including step 1 — reverts
The lender faces zero risk because the loan either gets repaid or it never happened. This is why no collateral is required.
Flash Loans vs Traditional Borrowing
| Aspect | Flash Loan | Traditional DeFi Loan |
|---|
| Collateral required | None | 100-150%+ of loan value |
| Duration | Single transaction (~400ms on Solana) | Open-ended |
| Maximum amount | Up to the protocol's total liquidity | Limited by your collateral |
| Interest | Small flat fee | Ongoing variable rate |
| Risk to lender | Zero (atomic repayment) | Liquidation risk |
| Accessibility | Requires technical knowledge | Any user via UI |
Flash Loan Protocols on Solana
Save (formerly Solend)
Save (previously known as Solend) is one of the original Solana lending protocols and supports flash loans. Developers can borrow up to the total available liquidity in any Save pool within a single transaction.
Flash loan fee: Typically 0.01-0.3% of the borrowed amount (varies by pool).
Marginfi offers flash loan functionality through its lending protocol. As one of Solana's largest lending platforms, it provides access to significant liquidity pools.
Kamino Finance supports flash loans through its lending markets. Kamino's integration with automated yield strategies means flash loans can interact with concentrated liquidity positions and other complex DeFi operations.
Primary Use Cases
1. Arbitrage
The most common flash loan use case is arbitrage — exploiting price differences between venues.
Example: SOL is priced at $155.00 on Raydium but $155.50 on another DEX. A flash loan lets you:
- Borrow 10,000 USDC via flash loan
- Buy ~64.5 SOL on Raydium at $155.00
- Sell 64.5 SOL on the other DEX at $155.50
- Receive 10,004.75 USDC
- Repay the 10,000 USDC loan + fee
- Pocket the profit (~$4.50 minus fees)
Without a flash loan, you'd need $10,000 of your own capital to execute this trade. With a flash loan, you need effectively $0 in capital — just enough SOL to pay the transaction fee.
Important reality check: Simple two-venue arbitrage like this is extremely competitive. Professional MEV bots and searchers execute these trades in milliseconds. Retail traders are unlikely to find profitable simple arb opportunities. The real money is in more complex multi-hop arbitrage paths.
2. Liquidations
When a borrower's collateral falls below the required ratio on lending protocols, their position can be liquidated. Flash loans enable liquidators to operate without capital:
- Flash borrow the repayment token
- Repay the borrower's debt (which triggers liquidation)
- Receive the borrower's discounted collateral
- Sell the collateral for more than the repayment amount
- Repay the flash loan
- Keep the liquidation bonus
On Solana, liquidation bots powered by flash loans help keep lending protocols like Marginfi and Kamino solvent by quickly clearing undercollateralized positions.
3. Collateral Swaps
Want to switch your lending collateral from SOL to USDC without closing your position? Flash loans make this possible in one transaction:
- Flash borrow enough to repay your debt
- Repay your debt and free your SOL collateral
- Swap SOL to USDC on Jupiter
- Deposit USDC as new collateral
- Borrow again to repay the flash loan
Without flash loans, you'd need extra capital or would have to close and reopen your position (potentially missing out on your borrowing rate or triggering tax events).
4. Self-Liquidation
If your lending position is approaching liquidation and you want to deleverage:
- Flash borrow the debt token
- Repay part (or all) of your debt
- Withdraw freed collateral
- Sell collateral for the debt token
- Repay the flash loan
This lets you manage your position efficiently without needing spare capital.
5. Yield Strategy Optimization
Some yield strategies use flash loans to amplify returns:
- Flash borrow USDC
- Deposit into a yield protocol
- Borrow against the deposit
- Use the borrowed funds to repay the flash loan
- Result: A leveraged yield position created in a single transaction
This is essentially looping (depositing, borrowing, depositing again) compressed into one atomic operation.
Risks and Concerns
Flash Loan Attacks
Flash loans have been used to exploit vulnerabilities in DeFi protocols. The pattern typically involves:
- Flash borrow a large amount
- Manipulate a price oracle or pool ratio
- Exploit the manipulated price in a vulnerable protocol
- Repay the flash loan with the profits
Notable flash loan attacks have resulted in millions of dollars in losses across DeFi. However, the flash loan itself isn't the vulnerability — it's the amplifier. The underlying issue is always an oracle or logic bug in the exploited protocol.
Key insight for traders: If a protocol you're using gets flash-loan attacked, the issue is with that protocol's security, not with flash loans as a concept. Well-audited protocols with robust oracle implementations are resistant to these attacks.
Oracle Manipulation
The most common flash loan attack vector is oracle manipulation. If a lending protocol uses an on-chain AMM pool to determine asset prices (instead of a robust oracle like Pyth), a flash loan can temporarily skew the pool ratio to manipulate the price.
Solana protocols have largely moved to Pyth and Switchboard oracles (off-chain feeds resistant to single-transaction manipulation), reducing this risk significantly compared to 2022-2023.
Transaction Complexity
Flash loan transactions are complex, multi-instruction transactions. If any instruction fails, everything reverts. On Solana, where transaction size limits exist, very complex flash loan strategies may hit compute unit limits.
Flash loan transactions are visible in the mempool (briefly) and can be front-run by MEV bots. If your arbitrage transaction is visible before it's confirmed, a bot can extract the same opportunity before you. Using Jito bundles or private mempools can mitigate this.
Can Regular Users Access Flash Loans?
Flash loans are primarily a tool for developers and sophisticated operators. There's no "flash loan" button in Phantom or Jupiter that regular users can click. To use a flash loan, you typically need to:
- Write custom code (Rust or JavaScript using Solana SDKs)
- Compose multi-instruction transactions programmatically
- Interact with lending protocol flash loan functions directly
- Handle error cases and gas optimization
That said, some protocols are building more accessible flash loan interfaces, and some DeFi aggregators incorporate flash loan logic behind the scenes (for example, when executing a collateral swap or leveraged position opening).
How Flash Loans Affect You (Even If You Never Use Them)
Even if you never execute a flash loan yourself, they affect your DeFi experience:
- Better prices: Flash loan arbitrageurs keep prices aligned across DEXes, meaning you get better swap prices
- Healthier lending markets: Flash loan liquidators ensure undercollateralized positions are cleared quickly, protecting depositors
- Protocol risk: If a protocol you use is vulnerable to flash loan exploits, your deposits are at risk
Flash Loans vs Jito Bundles
On Solana, Jito bundles serve a similar purpose to flash loans for some use cases. Jito bundles let you submit multiple transactions that execute atomically — if any fails, all revert. The key difference:
- Flash loans: Borrow capital within a single transaction
- Jito bundles: Execute multiple transactions atomically without borrowing (but you need your own capital)
For arbitrage, professional MEV searchers often use Jito bundles rather than flash loans because bundles provide atomicity guarantees without the flash loan fee. For capital-intensive operations where you don't have the capital, flash loans are necessary.
How to Monitor Flash Loan Activity
If you want to track flash loan usage on Solana:
- Solscan: Solscan shows transaction details. Flash loan transactions are typically complex with many instructions — look for borrow + repay instructions to the same protocol within a single transaction.
- Dune Analytics: Custom dashboards track flash loan volumes, fees, and usage patterns across protocols.
- Protocol dashboards: Individual lending protocols often display flash loan statistics.
The Future of Flash Loans on Solana
Flash loans on Solana will likely become:
- More accessible: Better tooling and UI layers will make flash loans usable without custom code
- Higher volume: As Solana DeFi TVL grows, the capital available for flash loans increases, enabling larger operations
- More integrated: DeFi protocols will increasingly use flash loans behind the scenes for position management, rebalancing, and liquidations
- Cross-protocol composability: Flash loans that span multiple protocols in a single transaction will become standard for complex DeFi strategies
Final Thoughts
Flash loans are a fundamental DeFi primitive that makes the entire ecosystem more efficient. They enable capital-free arbitrage that keeps prices fair, instant liquidations that protect lenders, and complex position management that would otherwise require large amounts of idle capital.
For most Solana traders, you don't need to use flash loans directly — but understanding them helps you grasp why DEX prices stay aligned, how lending protocols stay solvent, and what risks exist in protocols that lack proper oracle security.
If you're interested in the broader lending ecosystem on Solana, check out our guide to the best Solana lending protocols. And for understanding the MEV landscape that's closely related to flash loan activity, read our explanation of what Jito MEV is and how it works.