Flash Loan

NAVI Flash Loans are an innovative financial tool exclusive to the blockchain domain, enabling users to borrow assets without providing upfront collateral. These loans, also known as One-Block Borrows, must be initiated and fully settled within the same blockchain block. Their success relies on the execution of predefined conditions within this strict timeframe.

Overview

Flash loans allow users to access liquidity from a pool for a single transaction, either by:

  • Borrowing and repaying the loan plus fees immediately, or

  • Opening a debt position if permitted by the pool.

NAVI Protocol offers two options for flash loans:

  • flashloan:

    • Liquidity is borrowed from the pool.

    • Both the borrowed funds and the debt receipt are sent to the address that initiates the transaction.

  • flashloan_with_AccountCap:

    • Borrowed funds are sent to a predefined account cap address, while the debt receipt is sent to the transaction initializer.

    • The initializer must destroy the receipt by the end of the block for the transaction to succeed.

Flash Loan Config

Live fees and pool parameters can be found in SDK docsarrow-up-right.

  • Availability: Enabled for all pools, with initial borrowing caps per pool.

  • Adjustments: NAVI regularly evaluates risk and may update borrowing limits.

Execution Flow

For SUI developers, a helpful model to consider when developing your solution:

  1. Initialize all the parameters required in a PTB (Programmable Transaction Block)arrow-up-right

  2. Your contract calls the pool::lending::flash_loan_with_ctx

    contract, requesting a Flash Loan of a certain amount(s) of pool(s)

  3. After some sanity checks, the Lending Contract transfers the requested amounts of the coins to your contract, then issue receipt to receiver address.

  4. Your contract, now holding the flash loaned amount(s), executes any arbitrary operation in the ptb.

  5. Call pool::lending::flash_repay_with_ctx and send the borrowed money plus fee as an object to the contract.

All steps occur within a single PTB transaction, i.e., a single SUI block.

Getting Started

You may refer NAVI-Developer Docarrow-up-right or navi-sdkarrow-up-right for efficient development.

Last updated