Flash Loans
Flash Loans
Flash loans allow borrowing without collateral, provided the borrowed amount is returned within the same transaction. They enable advanced DeFi strategies like arbitrage, liquidations, and collateral swaps.
What Are Flash Loans?
Flash loans are uncollateralized loans that must be repaid in the same transaction they're borrowed. If the loan isn't repaid, the entire transaction reverts as if it never happened.
How it works in a single transaction:
Borrow - Take $1M USDC from the pool
Use Funds - Execute your strategy (arbitrage, swap, etc.)
Return - Pay back $1M + fee
Complete - Transaction succeeds
⚠️ If Step 3 fails, the entire transaction reverts and Steps 1-2 are undone.
Key Properties
No Collateral
Borrow without locking assets
Same Transaction
Borrow and repay atomically
All or Nothing
Fails completely if not repaid
Any Amount
Borrow up to available liquidity
Small Fee
Fixed percentage (0.09%)
Traditional Loan vs Flash Loan
Traditional Loan: Collateral → Borrow → Time passes → Repay
Flash Loan: Borrow → Use → Repay → All in ~1 second
No time = No risk to lender = No collateral needed
Use Cases
1. Arbitrage
Profit from price differences across exchanges.
Example:
DEX A: 1 ETH = $1,950
DEX B: 1 ETH = $2,000
Spread: $50 per ETH
Execution:
Flash borrow $195,000 USDC
Buy 100 ETH on DEX A ($195,000)
Sell 100 ETH on DEX B ($200,000)
Repay $195,000 + $175 fee
Keep profit: ~$4,825
2. Liquidations
Liquidate underwater positions without holding capital.
Example - Underwater Position:
Collateral: 1 wcBTC ($8,500)
Debt: $7,000 USDC
Health Factor: 0.97 (liquidatable)
Execution:
Flash borrow $3,500 USDC
Liquidate position (repay $3,500 debt)
Receive $3,850 worth of wcBTC (10% bonus)
Sell wcBTC for $3,850 USDC
Repay $3,500 + $3 fee
Keep profit: ~$347
3. Collateral Swap
Change collateral type without closing position.
Example - Current Position:
Collateral: $10,000 wcBTC
Debt: $5,000 USDC
Goal: Switch collateral from wcBTC to ETH
Execution:
Flash borrow $5,000 USDC
Repay full debt, freeing wcBTC collateral
Withdraw wcBTC
Swap wcBTC for ETH
Deposit ETH as new collateral
Borrow $5,000 USDC against ETH
Repay flash loan + fee
Result: Same debt, different collateral, one transaction
4. Self-Liquidation
Voluntarily close underwater position efficiently.
Without flash loan:
Find USDC to repay debt
Repay debt
Withdraw collateral
Sell collateral to recover USDC
With flash loan:
Flash borrow USDC
Repay debt
Withdraw collateral
Sell collateral
Repay flash loan
All in one transaction, no external capital needed.
Technical Details
Fee Structure
Flash Loan Fee
0.09%
Fee Recipient
Protocol reserves (→ stakers)
Fee Calculation:
Available Liquidity
You can flash borrow up to the total available liquidity in each pool:
Risks & Considerations
For Flash Loan Users
Execution Risk
Complex logic may fail
Gas Costs
Failed transactions still cost gas
Competition
Others may front-run profitable opportunities
Complexity
Requires smart contract development skills
For the Protocol
Atomic Execution
No risk of non-repayment
Fee Collection
Guaranteed rewards on success
No Bad Debt
Failed loans revert completely
Flash Loan vs Regular Borrow
Collateral
None required
Required
Duration
1 transaction
Unlimited
Repayment
Mandatory, immediate
Flexible timing
Fee
0.09% flat
Variable APY
Use Case
Arbitrage, liquidation
Long-term positions
Skill Level
Advanced (needs code)
Beginner friendly
FAQ
Q: Can anyone use flash loans? Flash loans require writing smart contracts. They're primarily for developers and sophisticated users with coding knowledge.
Q: What happens if I can't repay? The entire transaction reverts. It's as if the loan never happened. You only lose gas fees.
Q: Is there a limit to how much I can borrow? You can borrow up to the available liquidity in the pool.
Q: Can I flash borrow multiple assets? Yes, flash loans support borrowing multiple assets in a single transaction.
Q: Where do flash loan fees go? Fees go to protocol reserves and ultimately benefit ZNT stakers.
Last updated