Centuari Labs
  • Welcome to the Official Documentation of Centuari V1
  • Getting Started
    • Quickstart
    • Problems
  • Solutions
  • Primitive Lending
    • Flash Loan
    • Oracle
    • Liquidation
  • Currator
  • Basics
    • CLOB(deCentralized Lending Order Book)
    • Matching Transaction
    • Bond Token
    • Vault
  • Uncollateralized
    • Restaking
    • Underwriting
    • Assets Standardization
    • Slashing Mechanism
  • Resources
    • Contracts
    • Community
    • Further Update
  • Conclusion
    • Conclusion
Powered by GitBook
On this page
  • Implementing Centuari Flash Loan
  • Related Contract:
  1. Primitive Lending

Flash Loan

PreviousSolutionsNextOracle

Last updated 27 days ago

In the Centuari protocol, flash loans serve as a powerful utility mechanism to enable atomic, capital-efficient operations within a single transaction. Their primary use cases within Centuari include:

  1. Instant Arbitrage and Liquidation Flash loans allow actors to borrow liquidity from the lending pool without upfront collateral, execute profitable arbitrage or liquidation opportunities across CLOB markets or external venues, and repay the loan within the same transaction. This ensures market efficiency and liquidation integrity without requiring idle capital.

  2. Debt Refinancing and Position Restructuring Users can utilize flash loans to instantly repay existing loans, adjust leverage, or migrate positions between different lending pools or CLOB orderbooks without interrupting market exposure. This enhances composability and optimizes capital allocation.

  3. Collateral Swapping Flash loans enable users to atomically swap collateral assets backing their positions by borrowing liquidity, swapping assets, and repaying the loan — all in a single atomic transaction, eliminating multi-step execution risks.

  4. Protocol Maintenance Operations Governance-approved operators or keepers may leverage flash loans to perform batch operations such as clearing under-collateralized positions, rebalancing liquidity pools, or temporarily injecting liquidity for system-critical functions without requiring permanent capital deposits.


Implementing Centuari Flash Loan

  1. Use ICentuariFlashLoanCallbacks.sol for implement flash loan interface

  2. On related contract, use thisCentuariFlashLoan to handle the logic

  3. Callback function you must agree to a contract to claw back the loan amount

In essence, flash loans in Centuari act as a liquidity middleware layer that enhances operational flexibility, capital efficiency, and execution atomicity across lending and CLOB-based markets.

Related Contract:

Centuari.sol:

ICentuariCallbacks.sol:

BaseTest.sol:

flashloan
callbacks function
base testing