Architecture

The MYSO v3 architecture is optimized for permissionless and customizable on-chain settlement of covered calls and cash-secured puts. The protocol consists of two core contracts—the Router and Escrow implementation—along with modular peripheral smart contracts, i.e., the Oracle Adapter and Fee Handler.

Core Contracts

1. Router

The Router contract is the primary interface for users to interact with the MYSO v3 protocol. It handles:

  • OTC/RFQ Matching: Allows for OTC and RFQ matchmaking.

  • Auction Creation: Deploys an escrow contract to store underlying tokens and initiates a Dutch auction.

  • Bidding on Auctions: Allows users to bid on live auctions, determining the premium price dynamically, using oracles.

  • Exercising Options: Handles option execution based on market conditions and oracle data.

  • Borrowing and Repaying: Enables users to borrow against locked collateral and repay to retrieve collateral.

  • Swappings: Allows swapping of option tokens and generic ERC20 tokens.

  • Fee Handling: Routes fees to the designated FeeHandler contract for revenue distribution.

Key Features:

  • Deploys new Escrow contract instances using OpenZeppelin's Clones.

  • Implements anti-replay mechanisms by tracking used quotes and swap signatures.

  • Supports EIP-1271 signature verification for -chain signed quotes.

2. Escrow

The Escrow contract is a minimal proxy instance deployed by the Router for each auction or RFQ match. It:

  • Mints Option Tokens: Mints option tokens to trading firms, representing calls or puts.

  • Handles Option Settlements: Manages option exercise and facilitates underlying token transfers.

  • Supports Borrowing: As an optional features, allows borrowing against locked collateral tokens with predefined limits.

  • Access Control: Escrow contracts are Ownable, with the option writer designated as the initial owner. The escrow owner can transfer ownership to third parties and withdraw any tokens from the escrow (including airdrops) once the option has expired.

  • Implements Governance Hooks: Supports voting delegation for governance tokens.

Key Features:

  • Implements Dutch auction pricing via time-based decay of premiums.

  • Uses a modular oracle system for dynamic settlement calculations.

  • Supports on-chain and off-chain voting delegation for governance participation while coins are used for option writing.

Peripheral Contracts

3. FeeHandler

The FeeHandler contract manages fee collection and distribution. It:

  • Collects fees from option matches, exercising, and borrowing.

  • Distributes fees to protocol stakeholders and referral partners.

4. Oracle Adapter

The OracleAdapter module provides real-time price feeds for:

  • Auction settlement pricing.

  • Exercise price validation.

The protocol uses RedStone Oracles as the primary solution for crypto assets pricing. RedStone is a Modular Oracle that delivers frequently updated, reliable, and diverse data feeds in a few models.

Last updated