Flash loans on Aave V3, from a contract you own
The contract pattern
Each client engagement produces one single-purpose contract implementing Aave V3's flash-loan receiver interface. The Pool transfers the asset in, calls executeOperation, and expects principal plus premium approved back before the callback returns. The premium is not hard-coded; the contract reads it from the Pool at execution time.
// Repayment inside executeOperation (Solidity, abridged)
uint256 totalOwed = amount + premium;
// ... strategy ...
require(IERC20(asset).balanceOf(address(this)) >= totalOwed, "insufficient to repay");
IERC20(asset).approve(address(POOL), totalOwed);
return true;
The sequence inside one transaction:
- Request. The contract calls the Pool for the asset and amount. The Pool transfers the asset in and calls back.
- Strategy. The client's logic runs inside the callback: a swap route, a liquidation, a collateral rotation, a refinance. This is the only part that differs per client.
- Repay. Before the callback returns, the contract approves principal plus premium back to the Pool.
- Settle or revert. Repayment succeeds and surplus stays in the contract, or the whole transaction reverts and no balance anywhere changes. There is no partial state.
Ownership and control
- The contract is deployed to Base mainnet with the owner set to the client's address at handoff.
- UnyKorn LLC holds no key to the contract after handoff and is not in the execution path.
- Source is verified on the block explorer; the client receives the ABI, the deployment transaction, and the ownership-transfer transaction.
Reference deployment
| Item | Value |
|---|---|
| Network | Base mainnet, chain id 8453 |
| Reference contract | 0x13ED5bB77711A6cdd3B0963c2D97A185f7E6879C |
| Bytecode | 3,306 bytes, SHA-256 4df724cbc83fd69d3e3253a5093e493affb43c4c7bb1ec15c3d590163e24d7ae |
| Aave V3 Pool | 0xA238Dd80C259a72e81d7e4664a9801593F98d1c5 |
| Flash premium | 5 basis points (FLASHLOAN_PREMIUM_TOTAL(), read 2026-09-04) |
| Assets quoted | USDC, WETH, cbETH, cbBTC (token and aToken addresses derived from the Pool's own reserve list on 2026-09-04) |
Check the contract yourself with eth_getCode against any Base node and compare the SHA-256 of the returned bytes.
Cost estimator
Protocol fee is notional multiplied by the premium in basis points, divided by 10,000. Break-even is fee plus gas plus any other stated cost. For a 1,000,000 USDC loan at 5 basis points, the protocol fee is 500 USDC before gas, swaps, slippage, and strategy costs.
The estimator on the site prints the exact premium source it used: a live read from the Pool with block number and timestamp when the API is reachable, otherwise the last verified value with its date. Gas and other costs are the user's inputs, not measurements. The estimator does not account for liquidity depth, slippage, MEV, route failure, or whether any strategy is profitable, and it is not an execution quote.
Quote endpoint
GET /v1/quote/aave?chain=base&asset=USDC&amount=250000 reads the Pool's available liquidity and premium from a Base node and returns the premium amount, total to repay, available liquidity, and a depth check. The quote is refused with 422 depth_insufficient when available liquidity is under 1.5 times the requested amount, because a loan at the edge of depth fails on the next block's activity. Nothing is signed or sent.
Simulation before broadcast
Every strategy is simulated on a fork before it is broadcast. The client sees the trace, the gas estimate, and the revert reason if there is one. No mainnet transaction is sent from a strategy that has not passed simulation, and the client signs off in writing before any mainnet action.
What is not offered
Multi-provider routing across Aave V3, Balancer V2, Uniswap V3, and MakerDAO exists as code in the repository. It is not deployed to any public mainnet and has no completed audit. It is not part of any engagement until both change, and the status table will not say REAL until it is.
Boundaries
We do not hold the owner key, run the strategy for the client on mainnet, promise a profit, or size a loan above the depth check. We do not build anything that displays a balance which does not exist on-chain.