Flash Loan
Borrow and repay liquidity within a single Sui programmable transaction block.
Overview
During an Optimize migration, a flash loan can cover the old debt while collateral moves. The funds and fee must be returned in the same Sui programmable transaction block (PTB). If repayment fails, the transaction reverts.
Flash loan config
Check the flash loan API for eligible assets, amounts and fees. The SDK configuration example shows how to look up a single coin.
Execution flow
- Resolve the current lending package and pool for the asset.
- Call the applicable Move entrypoint to receive the balance and receipt.
- Use the balance for the intended operations in the PTB.
- Pass the receipt and repayment balance to the corresponding repayment function before the transaction ends.
Getting started
Refer to the NAVI Lending SDK and Sui PTB guide when constructing the transaction.