flashloan sources a flow input by borrowing the amount from a flashloan provider instead of pulling it from the signer. The borrowed amount is made available to the flow as its input, so the rest of the flow can spend capital the user doesn’t hold upfront.
Because a flashloan must be repaid in the same transaction, a flow that borrows via this materialiser must settle the loan (principal + the provider’s fee) before it ends — typically with one or more lifi.flashloanRepay ops. If the loan isn’t repaid, simulation reverts.
Config:
| Field | Type | Notes |
|---|---|---|
providerKind | 'aave-v3' | 'erc3156' | 'balancer-v2' | 'morpho-blue' | Which flashloan provider to borrow from. Fees vary by provider (e.g. Aave V3 charges 5 bps; Balancer V2 charges none). |
amount | integer string | The amount to borrow, in the token’s smallest units. |
Example
Borrow USDC via an Aave V3 flashloan and settle it within the flow:aaveToMorphoDebtMigration.ts. For the minimal borrow-and-repay shape, see flashloanRepay.ts.
