What is a flash loan?

A flash loan is a crypto loan that you borrow and pay back inside a single transaction. Because the loan never outlives that transaction, the lender asks for no collateral.

If the money isn't back by the end, the whole transaction is cancelled, as if it never happened. The lender can't be left unpaid, so it can lend almost anything in the pool to anyone.

The catch is time. You get the money for a fraction of a second, so you can only use it on things that finish in that same transaction: a trade, a loan repayment, a swap of collateral. Flash loans are a tool for software, and most people meet them inside one-click features of DeFi apps.

Flash loans sit behind several of the strategies in our guide to earning yield on Solana.

How flash loans work: borrow, use and repay in one transaction

A flash loan works in three steps, all in one transaction: borrow, use the money, repay it plus any fee. The blockchain treats the transaction as all or nothing.

That all-or-nothing rule is what makes it safe for the lender. On Solana, the network's own docs say that if any instruction in a transaction fails, "the entire transaction fails and all state changes are reverted". The repayment is one of those instructions. If it fails, the borrow is undone too.

Here is the flow in plain terms:

  1. Borrow 100,000 USDC from a lending pool.
  2. Do something with it, such as buying on one exchange and selling on another.
  3. Repay the 100,000 USDC, plus the fee if there is one.
  4. Keep whatever is left over.
A flash loan inside one transaction

A flash loan exists only if it is repaid in the same transaction, so a failed repayment undoes every step and costs you only the network fee.

Illustrative numbers: a 150,000 USDC arbitrage, as in the article's example.

What happens if a flash loan isn't repaid?

If a flash loan isn't repaid, nothing happens to the lender. The transaction fails and every step in it is reversed.

You still pay something. Solana's docs note that fees are still charged on a failed transaction, so you lose the network fee and any priority fee you added. On Solana that is usually a tiny amount. The trade you planned never happened, so there is no profit and no debt.

So a flash loan carries no default risk for the lender. The bigger risks sit in the code of the apps that lend and borrow, which is where flash loan attacks strike.

Solana flash loans: how instruction introspection checks the repay

On Solana, a flash loan is two separate instructions in one transaction, a borrow near the start and a repay near the end. The lending program checks that the repay is there before it hands over any money.

It can check because of a feature called the Instructions sysvar. Solana's documentation describes it as a way for a program to read the other top-level instructions in the same transaction. The lender reads ahead, sees a matching repay instruction, and only then releases the funds.

Ethereum lenders such as Aave do it the other way round. Aave's docs describe a loan where the pool sends funds to your smart contract and then runs it. Aave checks the repayment when your code finishes.

Solana's version has a practical benefit. You don't need to deploy your own contract. Kamino Finance KMNO$0.023-3.5%'s developer docs say you can put any number of instructions between the borrow and the repay, such as swaps on Raydium RAY$1.25-7.2% or Orca ORCA$1.18-0.8%.

The limit is space. Everything from the borrow to the repay has to fit in one transaction. A classic Solana transaction holds 1,232 bytes, and apps use address lookup tables to squeeze more in.

The newer v1 format, live on mainnet since 15 September 2026, allows up to 4,096 bytes, which leaves room for longer chains of trades. Our report on the larger transaction size covers the change.

The security firm Asymmetric Research explained how Marginfi LST$92.67-8.4% builds this in a September 2025 write-up. A start instruction marks the account as mid-loan, and a matching end instruction runs a health check. If that check fails, the whole transaction reverts. The marginfi lender has been run by Project 0 since September 2025.

What are flash loans used for? Arbitrage, liquidations and collateral swaps

Flash loans are mostly used for three jobs: arbitrage, liquidations and moving or changing a loan. In each case the borrowed money is needed for a moment and then returned.

  • Arbitrage: buy a token where it is cheap and sell it where it is dear, using borrowed money instead of your own.
  • Liquidations: repay someone's unsafe loan on a lending app, collect their collateral at a discount, and use it to repay the flash loan.
  • Collateral swaps and refinancing: close one loan and open another, with different collateral or on another app, without spare cash to bridge the gap.

Jupiter JUP$0.226-8.3%'s lending docs name arbitrage, liquidations and collateral swaps as the uses for Jupiter Lend flashloans. Liquidations matter to everyone who borrows. They keep lending pools solvent, and flash loans mean liquidators don't need big balances to do the job. Our guide to what happens when a DeFi loan is liquidated covers that side.

A worked flash loan arbitrage example

Here is a simple example with made-up prices. SOL trades at $150.00 on one exchange and $150.30 on another.

You borrow 150,000 USDC with a flash loan and buy 1,000 SOL on the cheaper exchange. Then you sell the 1,000 SOL on the dearer one for about $150,300 and repay the 150,000 USDC. About $300 is left, minus fees and the price moving against you as you trade.

In practice, that $300 rarely survives. Automated bots watch for these gaps all day, and your own buying and selling narrows the gap as you trade. If the numbers don't add up, the transaction fails and you lose only the network fee.

One-click leverage: Kamino Multiply and looping

If you have opened a position with Kamino Multiply, you have used a flash loan. Multiply uses one to open a leveraged position in a single step.

Kamino's docs describe the steps. Multiply flash-borrows the extra funds you need and swaps everything into the target asset, such as JitoSOL. It deposits that as collateral and borrows SOL against it. The new borrow repays the flash loan.

Without a flash loan, you would deposit and borrow over and over to reach the same leverage. With one, it all happens in a single transaction. If any step fails, no position is created. Our guide to looping on Solana explains the strategy and its risks.

Where to get a flash loan on Solana: Kamino, Jupiter Lend and Project 0

Flash loans on Solana come from the big lending apps such as Kamino and Jupiter Lend. The fees are tiny or zero. Every one of them needs code, or a tool that builds the transaction for you.

Lender Network Flash loan fee Source
Kamino Solana Set per reserve; 0.001% in Kamino's USDC example Kamino developer docs
Jupiter Lend Solana No fee Jupiter developer docs
Project 0 (formerly marginfi) Solana No fee Project 0 docs
Aave V3 Ethereum and others 0.05% at launch, changeable by governance Aave docs

Fees are set by each app and can change. Jupiter's docs describe Jupiter Lend flashloans as having "no fees", and Project 0's flashloan guide says the same. Kamino's docs say the repay takes "the amount plus the reserve's flash loan fee". Check the app's own docs before you rely on a number.

For a list of the apps that offer them, see our directory of Solana flash loan providers.

Flash loan attacks: why borrowed millions can break a weak protocol

A flash loan attack uses a huge, short-lived loan to exploit a flaw in another app's code. The loan supplies the money; the weakness lies in the app being attacked.

The classic pattern targets an app that sets prices from a single exchange. Chainlink, the oracle network, walks through it in an explainer on flash loans:

  1. Borrow a large sum.
  2. Push a token's price on one exchange with a big trade.
  3. Borrow too much from an app that trusts that price.
  4. Repay the flash loan and keep the rest.

Chainlink sums it up: "flash loans aren't inherently the problem."

The scale is real. Bank of England staff writing on Bank Underground counted 45 attacks backed by flash loans among about 150 in DefiLlama's list in May 2023, and called that a lower bound. One case in their data is Beanstalk on 17 April 2022, where two flash loans totalling $850 million funded an attack that took about $181 million.

OWASP's 2026 Smart Contract Top 10 puts it plainly. It calls flash loans "a legitimate DeFi primitive" that attackers use "to amplify an underlying vulnerability".

What this means for you: before you deposit in a DeFi app, check how it sets prices and whether its code has been audited. That matters far more than whether flash loans exist. Our page on DeFi yield risks covers how to weigh them.

Fake flash loan apps and "free flash loan" bots: how to stay safe

A real flash loan can't be downloaded as an app and can't pay you passive income. If someone offers either, walk away.

Two things go by the name online. The first is a set of mobile cash-loan apps called "flash loan" that have nothing to do with DeFi. The second is crypto offers of "free flash loans" or a "flash loan arbitrage bot" that earns while you sleep.

The bot offers are the ones to watch. Researchers found 10,442 YouTube videos promoting "arbitrage bot" contracts between June 2022 and June 2023. Victims who deployed and funded the contracts lost up to $15 million in total.

A few checks keep you safe:

  • Never deploy or fund a contract copied from a video or a stranger's message.
  • Treat any promise of guaranteed or passive profit from arbitrage as false. Bots compete those gaps away in milliseconds.
  • If you have already signed something you don't trust, review and remove the permissions with our tool for revoking token approvals.

If steady passive income is the goal, the plainest option on Solana needs no code at all: lending your SOL's voting weight to a validator earns around 5% a year, and the SOL stays in an account you control.

Flash loan FAQ: are flash loans legit, and can you make money?

Are flash loans legit?

Yes. Flash loans are a standard feature of the major lending apps on Solana and Ethereum, and Kamino and Aave both document them in full. Borrowing one is not an attack. The attacks come from flaws in other apps' code.

Can you make money with a flash loan?

Some people do, mostly by running fast automated software for arbitrage and liquidations. It is a competitive, technical business. A manual trader or a copied bot will almost always be too slow.

Do you need to code to use a flash loan?

To build your own, yes. Aave's docs say it takes a solid understanding of smart contracts. On Solana you can use one without code through features such as Kamino Multiply, which build the flash loan into one click.

How long does a flash loan last?

A flash loan lasts one transaction. On Solana that is well under a second.

Is a flash loan the same as an instant crypto loan?

No. An instant crypto loan, from an exchange or a lending app, lasts days or months and needs collateral. To borrow that way on Solana, see our guide to how lending and borrowing work.