Architecture Overview
Smart contract structure within the Dopex platform
Dopex makes use of a number of existing protocols within it's architecture:
    1.
    Uniswap - To re-purchase assets for pools after each epoch.
    2.
    Chainlink - To retrieve last prices and IV data from external APIs.
    3.
    UMA - Synthetic derivatives minted on Dopex will be based on the UMA protocol.
The overall architecture and flow of smart contracts that make up the protocol is displayed below:
Dopex protocol architecture

Dopex

Main contract which contains a registry of all other contracts to be used by the Dopex protocol.

OptionPoolFactory

Factory contract to create option pool contracts and maintain a whitelist of option pool contracts.

OptionPool

Allows for passive participation in option liquidity pools for a specified base and quote asset pair (eg. ETH-USD) where users passively write options. Deposits (profits included) can be withdrawn at the end of an epoch for active pool participants.

OptionsFactory

Factory contract to create option contracts based on given base/quote asset, strike and expiry combination. This can only be called by the Broker contract.

OptionsContract

Stores collateral and allows for exercising of options by depositing underlying. Generates doTokens on addition of collateral. New options contracts can only be created by OptionsFactory.

OptionPoolBroker

Used for option purchases, exercises, swaps and liquidations across all option pools within the dopex protocol.

VolPool

Pool that holds funds prior to a global epoch allowing depositors to access an instant 5% discount on option purchases for that epoch across all dopex option pools.

Margin

Used to allow purchasers to borrow USD from margin pool deposits by using existing doTokens/rDPX as collateral. This would be used to leverage option positions in the future.

AssetSwapper

Asset swapper uses funds from option exercises and option sales in option pools to replenish base/quote assets required for option pools in whitelisted OptionPool contracts.

PriceOracle

Used to determine last price and implied volatility values via Chainlink adapters. These values are referred to throughout the protocol.

Synth

Used to generate whitelisted synths using DPX tokens as collateral. Contains mint and generation mechanisms by utilizing the UMA protocol.

DPXToken

Vanilla ERC20 representing the Dopex Governance token, DPX.

rDPXToken

Vanilla ERC20 representing the Dopex rebate token, rDPX.

OptionPoolRebates

Used to calculate and distribute rebates as rDPX claimable after epochs for whitelisted option pools.

OptionPoolRewards

Reward contract which distributes DPX tokens for function calls and actions performed within the protocol based on the token emission curve for all whitelisted option pools.

Governance

Used to vote on and pass proposals for the Dopex protocol using DPX tokens.
Last modified 6mo ago