How a flashloan lets you trade without collateral.
You can borrow millions with nothing down, run a trade, and repay it — all inside a single transaction. It sounds like a trick. It is actually the safest kind of borrowing there is, and the reason is worth understanding before you build on it.
The first time someone explains a flashloan, it sounds like a scam. You can borrow ten million dollars with no collateral, no credit check, and no one asking who you are — and the lender is fine with it. Every instinct built by ordinary finance says that cannot be safe. The instinct is right about ordinary finance and wrong about this, and the gap between the two is one of the genuinely new things a public blockchain makes possible.
Here is the whole idea in one sentence: a flashloan is a loan that must be borrowed and repaid inside the same transaction, or it never happened at all.
To see why that is safe rather than reckless, you have to understand one property of how a blockchain settles work. A transaction on a chain like Ethereum is atomic — it either completes in full or it reverts in full. There is no halfway. If a transaction contains ten steps and the ninth step fails, the chain does not keep the first eight; it unwinds all of them and returns the world to exactly the state it was in before the transaction started, as though you had never acted. Atomicity is not a feature someone bolted on. It is the foundational guarantee the whole system is built on.
A flashloan is what you get when you point that guarantee at lending.
The mechanics, plainly. A lending protocol — Aave and Balancer are the established venues — exposes a function that says: I will hand you as much liquidity as I have in the pool, right now, with no collateral, on one condition. By the end of this transaction, the pool must be back to where it started, plus a small fee. Check the balance at the end. If it is short by a single wei, revert everything.
So the agent's transaction looks like this, and every step happens in the same atomic envelope:
1. Borrow. Take the flashloan. No collateral is posted, because the protocol is not trusting you across time — it is only trusting the transaction to balance before it ends. 2. Execute. Do the actual work with the borrowed liquidity — swap across two venues where the same asset is priced differently, unwind an arbitrage leg, rebalance a position. 3. Repay plus fee. Return the principal and the protocol's fee to the pool. 4. Settle or revert. The protocol checks its balance. If the loan is repaid, the transaction settles and everything that happened is real. If it is not — if the trade you attempted did not actually clear enough to repay the loan — the entire transaction reverts, the loan is unwound as if it was never taken, and the only thing you are out is the gas you spent trying.
That last point is the one that inverts the intuition. In ordinary lending, the danger is that the borrower takes the money and cannot pay it back. A flashloan makes that outcome structurally impossible. You cannot walk away with the money, because if the repayment does not land by the end of the transaction, the borrow is erased along with everything else. The lender is never exposed. There is no default risk, no collection, no counterparty gamble across time — because there is no time. It all happens in one block.
Why this is a real engineering tool and not a party trick. The honest use of a flashloan is capital efficiency. An arbitrage opportunity — the same asset trading cheaper on one venue than another — is real but usually small in percentage terms. To make it worth the gas, you need size. Flashloans let a strategy operate at size without the operator having to lock up millions in idle capital waiting for opportunities. You borrow the size for the exact moment you need it, capture the spread if it clears the loan and the fees, and repay — or the whole thing reverts and you have lost nothing but gas. That is the entire pitch, and it is a sound one.
We should be equally plain about the other side, because it is why "flashloan" sometimes appears in headlines next to the word "attack." A flashloan gives anyone temporary access to enormous capital, and if a protocol's own logic can be manipulated by someone wielding that much size for a moment — an oracle that can be pushed around, a pool that can be drained and refilled to trick a price — a flashloan is how an attacker assembles the ammunition. Note carefully what is being exploited in those cases: not the flashloan itself, but a vulnerability in some other contract that the flashloan made affordable to attack. This is exactly why, on the [blockchain pillar](/services/blockchain), we treat security as the whole job rather than the last step. If you are building a protocol, the flashloan is part of your threat model whether you use one or not, because your attacker can.
What this means for the agents we build. When we build an on-chain agent that uses flashloan financing, the atomic revert is the safety rail we design around, not around. The agent is written so that a trade which does not clear simply reverts — no partial fills left dangling, no debt carried, no position stuck open. The client posts no collateral for the borrowed leg, because the borrow only ever exists inside a transaction that also repays it. What the client funds, if anything, is gas and whatever base capital the strategy needs beyond the borrowed portion.
And here is the line we will not cross, stated as plainly as the mechanics: we build the machine; we do not promise what it earns. Whether a strategy clears a profit is a function of the market and the parameters the client sets — spreads that may or may not appear, gas that may or may not leave room, competition from every other agent watching the same pools. We make no performance claims, we do not manage anyone's money, and we never take custody of client capital. What we deliver is a correct, tested, adversarially-reviewed agent, its safety rails, and the documentation to reason about exactly what it does and does not do.
A flashloan is not a way to get money for free. It is a way to borrow without collateral because the loan cannot outlive the transaction that repays it. Understand that one property and the whole thing stops looking like a trick and starts looking like what it is: the cleanest form of borrowing that has ever existed, available only because the ledger it runs on refuses to remember anything that did not fully happen.
Written by David Billiot · RESILIENCE Agentic Solutions