Instant AI
  • INSTRUCTION
    • What is Instant AI
    • Tokenomics
    • Governance Process Overview
    • Become a Strategist
  • Smart Contracts
    • Protocol (V2) Contract Architecture
      • Smart Contract Architecture Walk-Through
    • Roles & Permissions
    • External Protocol Integration
      • Building Adaptors
        • BaseAdaptor
        • Protocol-Specific Functionality
        • Adaptor Configuration
        • Security Considerations
        • Debt Adaptors
        • Adaptor Uses to Keep in Mind
      • Building Pricing Extensions
    • Smart Contracts & Governance
    • Smart Contract Addresses
    • Advanced Smart Contracts
      • Registry Details
        • Registry.sol API
      • PriceRouter Details
        • Oracle Usage and Asset Pricing
        • PriceRouter.sol API
      • Cellars (aka ERC 4626 Vaults)
      • Adaptors
        • BaseAdaptor.sol API
      • Fees And Reserves
      • Portfolio (V1.5) Contract Architecture
  • Strategists
    • Overview
    • Protobuf
    • Requests
    • Adaptors
  • PROTOCOL
    • How does the protocol work?
    • Validators
    • Gravity Bridge
    • Steward
    • Auction module and participation
Powered by GitBook
On this page
  1. Smart Contracts
  2. Advanced Smart Contracts

Adaptors

A detailed breakdown of the BaseAdaptor.sol contract.

PreviousCellars (aka ERC 4626 Vaults)NextBaseAdaptor.sol API

Last updated 6 months ago

Adaptors

Adaptors are the mechanisms by which strategists can interact with external protocols and allocate Cellar assets. All adaptors inherit from , which spells out a number of requirements for an adaptor to be used with Cellars:

  • Each adaptor must have a unique identifier. Updated adaptors using the same protocol should increment a version number in their identifier.

  • Each adaptor should report its base asset, via assetOf, and any other assets used, with assetsUsed.

  • An adaptor should report whether or not it allows the Cellar to take on debt, via isDebt.

  • An adaptor should be able to report its own balance in terms of the assetOf asset, via the invocation of balanceOf.

  • An adaptor should contain deposit, withdraw, and withdrawableFrom functions that allow Cellars to move assets into and out of the position in response to user deposit/withdrawal requests. For adaptors that do not represent liquid positions (such as adaptors for debt positions, like the ), the implementor can have withdrawableFrom return 0.

For more information on adaptor architecture, see

See the next page for a current API for BaseAdaptor.sol.

BaseAdaptor
AaveDebtTokenAdaptor
"Building Adaptors."