Documentation Index
Fetch the complete documentation index at: https://cowswap-mintlify-seo-audit-1777280932.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Flash Loan Router employs a modular design separating routing logic, lender-specific adapters, and settlement execution. This enables support for multiple flash loan providers while preserving security and predictable execution.Components
The system consists of four main components:- Flash Loan Router - Core orchestrator for flash loans and settlement
- Borrower adapters - Lender-specific contracts handling protocol differences
- Flash loan lenders - External protocols (Aave, Maker) providing liquidity
- CoW Settlement - Target contract executing trades
Execution Flow
The system processes settlements through four phases: Phase 1: A solver callsflashLoanAndSettle() with loan specifications and settlement data.
Phase 2: The router requests loans sequentially from each borrower adapter, which triggers lender-specific callbacks.
Phase 3: Once all loans are received, the router executes the settlement contract with the provided data.
Phase 4: Lenders pull repayment from borrower contracts through ERC-20 transfers.
Core Security Guarantees
The router maintains these critical properties:- Only registered CoW Protocol solvers can call
flashLoanAndSettle() - Exactly one settlement call per loan request, using unmodified data
- Sequential loan processing prevents out-of-order execution
- Atomic execution — all operations succeed or fail together
Supported Lenders
- Aave V3 via AaveBorrower
- ERC-3156 compatible providers (including Maker) via ERC3156Borrower