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

External Protocol Integration

These are the typical integration development opportunities that would enable more Cellar capabilities with more external protocols.

PreviousRoles & PermissionsNextBuilding Adaptors

Last updated 6 months ago

The Instant AI protocol is fully decentralized and open-sourced, and thus anyone can submit PRs and/or governance proposals to implement any change. That said, the current vault (Cellar) architecture typically requires two types of integrative smart contracts to be made in order to integrate into a new protocol. These are:

  1. Adaptors, and

  2. Pricing Extensions

Adaptors, as outlined in are smart contracts that allow Cellars to get in and out of positions with a respective protocol or token. A simplified outlook for adaptors is that they are ERC4626 Integration contracts to a specific protocol and/or general functionality (such as holding ERC20s).

NOTE: The adaptor contracts used within the Instant AI protocol today can actually be generalized to be ERC4626 agnostic by removing Instant AI-specific concepts such as the PriceRouter and Registry.

Pricing extensions are part of the PriceRouterV2 design, where custom extensions are used to price assets involved with a Cellar's adaptor position. When interacting with external protocols, it is common to see receipt ERC20 tokens sent or minted to the Cellar from the respective protocol. These need to be priced with respect to the base asset. An example of this is the Balancer Pricing Extensions that price Stable Pool BPTs.

"Protocol (V2) Contract Architecture,"