Divergence Protocol
  • OVERVIEW
    • Divergence Protocol
    • Protocol Basics
      • Digital Options
      • Triangular Swaps
      • Convertible Liquidity
      • Options Specs
      • Fees
      • Glossary
      • References
  • User Guide
    • 📈Long Options
      • 🔥Open Longs
      • 🌊Close Longs
      • 👨‍🌾Exercise Options
    • 📉Short Options
      • 💧Open Shorts
      • 🔚Finalize Shorts
      • 📥Close Shorts
      • ⏰Expiry Withdrawal
    • 🍸Dive Bar
  • Technical Reference
    • Smart Contract Architecture
      • Deployment addresses
    • Core
      • Arena
      • Battle
      • Oracle
      • Utils
      • SToken
      • Interface
      • Libraries
        • DiverSqrtPriceMath
        • Position
        • Tick
        • TickMath
        • TradeMath
      • Params
      • Types
    • Periphery
      • Manager
      • Base
      • Interface
      • Quoter
      • Libraries
      • Params
      • Types
    • Audit Reports
  • DIVER Token
    • 🌝Tokenomics
      • Token Distribution
    • 🎃DIVΞR NFT Collections
  • Legal
    • Terms of Service
    • Risk Disclosure
  • MISC. INFO
    • 🔗Official Links
    • 🙌Media Kit
    • 🚢Ditanic Test Coins
Powered by GitBook
On this page
  • Core
  • Periphery

Was this helpful?

  1. Technical Reference

Smart Contract Architecture

Previous🍸Dive BarNextDeployment addresses

Last updated 1 year ago

Was this helpful?

The Divergence smart contracts system includes core contracts and periphery contracts. Below are a brief overview of the contract functionalities:


Core

The core contract functionalities provide the foundation for options market creation, automatic market-making and peer-to-pool interactions.

Deploys pools, i.e. Battles, for options tokens of specific underlying, collateral, fees and other deployment parameters.

Each options AMM pool is contained in a Battle contract. Battle contracts contain the core functionalities including minting and burning liquidity, trading options tokens, settling pools and claiming proceeds. The onlyManager functions are called via the Manager contract in the Periphery contracts.

Collects and updates underlying asset prices used for settling options. It retrieves asset prices and supplies them to all contracts that use them.

Implements digital call and put options as Spear and Shield tokens.


Periphery

Periphery contracts contain methods of interacting with core contracts. Periphery interfaces are the main handler of external calls.

Mints LP liquidity positions as non-fungible tokens. Handles the logic of adding and withdrawing liquidity. Provides functionalities that enable LPs to redeem or withdraw obligatory collateral reserves for settlement. It also facilitates trade functionalities.

Arena
Battle
Oracle
sToken
Manager