Mispricing Gazette

Home › Strategy & Costs › Flash Loan Arbitrage Explained: Borrowing Within One Transaction

Flash Loan Arbitrage Explained: Borrowing Within One Transaction

Editorial team · Updated 2026-10-14 · 5 min read

Flash loan arbitrage uses an uncollateralised loan that is borrowed and repaid inside one Ethereum transaction. The contract borrows tokens, buys in a cheap pool, sells in an expensive one, repays the lender with a fee and keeps any remainder. If repayment would fail, the whole transaction reverts.

How a flash loan works

Normal lending needs collateral because the lender cannot be sure of repayment. A flash loan removes that risk with atomicity. Ethereum transactions either complete entirely or revert entirely, so a lending protocol can hand out funds on the condition that they come back, with a fee, before the transaction ends. If they do not, the transaction fails as if it never happened.

The Aave flash loan documentation describes the pattern: your contract requests a loan, receives the funds, runs its own logic in a callback, and must return the borrowed amount plus a premium before the callback ends. The exact premium is protocol-defined and can change, so check the current documentation rather than relying on any figure quoted in an article.

Key takeaway: a flash loan is not free money. It is a way to rent trading size for one transaction, in exchange for a fee and for the requirement that the trade must be profitable.

The arbitrage sequence

  1. The bot detects a gap between two pools.
  2. It computes the size that maximises profit after fees and impact, which can now be far larger than its own balance.
  3. A single transaction borrows the asset, buys in the cheap pool, sells in the dear pool and repays the lender plus the premium.
  4. If the final balance exceeds the debt, the surplus is kept. If not, the transaction reverts.
Item Own-capital arbitrage Flash loan arbitrage
Capital needed Enough to fund the trade Only gas, plus any fee
Trade size Limited by balance Limited by pool depth and lender liquidity
Extra cost None Loan premium
Contract complexity Moderate Higher, needs callback logic
Failure outcome Revert costs gas Revert costs gas

What the vendors describe

CryptoMEV Bot’s flash loan arbitrage page states that users need only enough crypto for network gas fees, that borrowing, both trades and repayment run in a single transaction, and that a failed transaction reverts so that the user loses only the gas fee rather than the loan. It also describes pre-flight simulation of each trade. A companion page covers Aave-based flash loan arbitrage. These are product descriptions from the vendor. Independent verification of results is not provided on the page, so treat the claims about outcomes as unconfirmed.

The atomicity description is accurate in principle. The point to add is that “only the gas fee” can still be a lot of money if failures are frequent, a point worked through in gas fees and arbitrage profit.

Real risks that remain

  • Gas on failures. A mined reverted transaction costs gas. Repeated failures add up.
  • Smart-contract bugs. Flash loan contracts are custom code. Mistakes can lose funds, and attackers can exploit insecure callbacks.
  • Fee erosion. The premium cuts directly into the spread, so thin gaps become unprofitable.
  • Competition. Everyone with a flash loan contract can chase the same gap, which compresses margin.
  • Protocol changes. Fees, supported assets and liquidity depend on the lender and can change.
  • Reputational and legal context. Flash loans have been used in attacks on poorly designed protocols. Legitimate arbitrage is different, but you should understand the environment and the rules that apply to you. See whether crypto arbitrage is legal.

When flash loans help and when they do not

Flash loans help when the best trade size exceeds your balance, and when the gap is wide enough to cover the premium with room to spare. They help less when the profit-maximising size is small anyway, because most of the benefit of borrowing is size. For small gaps, own capital avoids the premium and the extra gas of the loan callback.

They also do not reduce the need for fast, private execution. A flash loan transaction sent through the public mempool can be copied just like any other, so routing still matters; see Flashbots Protect and arbitrage.

Anatomy of the contract

It helps to picture what the on-chain code actually does, because most flash loan failures are logic failures rather than market failures. A typical arbitrage contract exposes one entry function that the bot calls with a route and a size. That function asks the lender for the loan and passes along the route as data. The lender transfers the funds and calls back into the contract. Inside the callback the contract performs the swaps, approves the lender to pull back principal plus premium, and finishes. The lender then checks its balance, and if the repayment is short, the entire transaction reverts.

Several design details separate robust contracts from fragile ones:

  • A profit floor. The contract should revert unless the final balance exceeds the debt by a minimum margin, so that a marginal trade never executes just because it breaks even.
  • Callback authentication. Only the lender should be able to trigger the callback, and only for loans your contract started. Missing checks have been exploited in the wild.
  • Token handling. Tokens that charge transfer fees or rebase can leave the contract short at repayment time.
  • Gas efficiency. Every wasted storage write adds to cost on every attempt, successful or not.
  • Upgrade and ownership controls. Who can withdraw profits or change the route logic is a security question as much as a convenience.

None of this appears on a marketing page, which is why audits, open code and test history are worth asking about when you assess a product. Our selection checklist turns these into questions you can put to a vendor, and the independent view on what can go wrong more generally is in arbitrage bot risks.

Build, buy or avoid

Writing your own flash loan contract demands Solidity skill, careful testing and auditing. Buying software shifts the work but adds vendor risk. The trade-offs are laid out in build or buy an arbitrage bot. If you are considering the Ethereum-specific product, the vendor’s Ethereum arbitrage bot page lists its scanning, simulation and Flashbots features alongside its stated prices.

Summary

Flash loan arbitrage swaps capital requirements for fees, complexity and competition. It is powerful as a mechanism and unforgiving as a business. Check current protocol terms, test with simulations and small amounts, and never assume that the absence of principal risk means the absence of loss. This is not financial advice.

Frequently asked questions

What is flash loan arbitrage?

It is arbitrage funded by a flash loan: the contract borrows assets, trades them across pools and repays the loan plus a fee, all inside a single transaction.

Do flash loans need collateral?

No, because the loan must be repaid within the same transaction or the whole transaction reverts.

Can I lose money on a flash loan?

Yes. You pay gas even if the transaction reverts after being mined, and bugs or fees can cause losses. You do not owe the borrowed principal if the transaction reverts.

Do flash loans remove the need for capital?

They remove the need for trading capital, but you still need ETH for gas and any fee.

Sources