Smart Contract Architecture

TLDR

  • Each underlying asset (currency pair) has a separate liquidity pool for put options and a separate pool for call options.

  • Call options are denominated in base tokens (ETH in case of ETH/USDC) and put options in quote tokens (USDC in case of ETH/USDC). This means that to:

    • to trade put options, you need the quote tokens to pay premia or put up collateral

    • to trade call options, you need base tokens to pay premia (if you're buying the options) or put up collateral (if you're selling the options)

  • All capital is held by the AMM and allocated through internal accounting. Options and LP tokens themselves are not in possession of any other ERC20 tokens such as ETH or USDC.

  • Options are ERC20 tokens representing a right or obligation to trade. The obligation is enforced by locking in capital at the moment of trade.

  • Closing position and making opposite position are not equivalent. First actually closes position (burns option token) and releases capital. Second mints new option token, so the user is net 0, but his/her locked capital was not released.

  • Price changes by change in price of underlying asset or by trading options. First is external variable that we take from oracles. Second is based on realized supply/demand (actual trading) and it is done through changing the volatility parameter.

Architecture

The governance contract is the admin of all other contracts – LP tokens, option tokens, etc. Only the governance contract can upgrade the other contracts.

The governance can also upgrade itself if a proposal is passed in a vote.

The AMM holds all capital and distributes Option tokens and LP tokens for users who trade or stake, respectively.

Please refer to our GitHub for source code and details. The code is well-commented, but if anything is unclear, you're welcome to ask in the #development channel on our Discord.

Last updated