basiliskawakens.xyz

What Is a Flash Loan and How to Spot One in an Explorer

A flash loan is an uncollateralized loan that must be borrowed and repaid within a single blockchain transaction. If the loan is not repaid by the end of that transaction, the entire transaction is reversed as if it never happened. You can spot a flash loan in a block explorer by looking for a transaction that calls a lending protocol like Aave or dYdX, borrows a large amount of tokens, performs several swaps or arbitrage trades, then repays the loan - all inside one transaction hash.

How flash loans work

Flash loans rely on the atomicity of blockchain transactions. Atomicity means that either every instruction in a transaction succeeds, or none of them do. A flash loan contract checks at the end of the transaction whether the borrowed amount plus a fee has been returned. If it has not, the contract reverts the entire transaction.

The borrower does not need to provide collateral. Instead, the trust mechanism is the transaction itself: if the borrower fails to repay, the blockchain state never changes. This makes flash loans useful for arbitrage, liquidations, collateral swaps, and sometimes for attacks.

Why flash loans are important to spot

Flash loans are not inherently malicious. Many legitimate traders and bots use them to profit from price differences across exchanges or to liquidate undercollateralized positions. However, flash loans are also a common component of exploits. Attackers often use flash loans to borrow large amounts of capital without putting up their own money, then manipulate prices or drain protocols.

Being able to identify a flash loan in a block explorer helps you distinguish between normal trading activity and potential attacks. It also helps you understand how a protocol was exploited if you are investigating a past incident.

How to Spot a Flash Loan on Etherscan

You do not need special tools. A standard block explorer like Etherscan shows everything you need.

Step 1: Open the Transaction

Find the transaction hash you want to inspect. On Etherscan, open the data/simulate-transaction-before-signing/">transaction details page.

Step 2: Check the Internal Transactions Tab

Flash loans almost always involve calls to multiple contracts. The internal transactions tab shows every contract call that happened within the transaction, including calls to lending pools and DEXes.

Look for a call to a flash loan provider. Common flash loan contracts include:

If you see a call to one of these contracts where the value transferred is very large - often millions of dollars worth of tokens - that is likely a flash loan borrow.

Step 3: Follow the Borrow and Repay

In the internal transactions list, find the call where tokens leave the lending pool. Note the amount. Then scroll further down in the same list. You should see a later internal transaction where a similar or slightly larger amount of tokens returns to the same pool.

The difference between the borrowed amount and the repaid amount is the flash loan fee. On Aave, for example, the fee is typically 0.09% of the borrowed amount.

Step 4: Look for the Arbitrage or Attack Logic

Between the borrow and the repay, you will see a series of swaps, transfers, or other contract interactions. This is where the borrower uses the borrowed capital.

Common patterns:

If the transaction ends with the borrowed amount returned and no obvious profit destination, it may have failed. If it ends with a profit sent to an external wallet, it was a successful arbitrage or liquidation. If the profit goes to a contract that then drains other funds, it is likely an exploit.

Example: What a Flash Loan Looks Like in the Explorer

A typical flash loan transaction on Etherscan will show:

If you see a transaction with many internal calls and a very large token movement at the start and end, it is almost certainly a flash loan.

How to Confirm It Is a Flash Loan and Not Just a Large Swap

A large swap alone does not involve a loan. In a normal swap, you send tokens to a DEX and receive different tokens back. In a flash loan transaction, the borrowed tokens come from a lending pool, not from your own wallet. Check the sender of the first large token transfer in the internal transactions. If the sender is a lending pool contract, it is a flash loan.

Tools that make flash loan detection easier

If you want to automate or simplify the process, some tools highlight flash loan activity:

For most manual investigations, the internal transactions tab on Etherscan is sufficient.

Key Takeaway

A flash loan is a single-transaction loan that must be repaid within that same transaction. You spot one by opening the internal transactions tab, finding a large borrow from a known lending pool, then confirming the repayment later in the same list. The middle of the transaction shows what the borrower did with the capital. This pattern is the same whether the transaction is a legitimate arbitrage or part of an exploit.

Not financial advice. basiliskawakens.xyz publishes market data and general information about digital assets. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.

Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.

Back to on-chain data