I Got Options: Dopex Protocol Overview

Dopex is the premier on-chain options provider. The Arbitrum-native protocol has broken much ground for delivering decentralized, trustless options trading to the blockchain. This Dopex protocol overview article will dive into some of the technical details that make this protocol so special.

Fear not, there is no scary math ahead! Part of my reason for doing this overview is to get away from the prevailing options-heavy discussion of the protocol. Just like Dopex’s key innovation abstracts away the complexity of options, this overview of Dopex will abstract away the options and focus on the architecture.

Unfortunately, this is an options protocol, so we will have to touch on them just a little bit. Don’t worry, it’ll be over soon.

WTF is an Option?

Options are derivatives creating the right and corresponding obligation to transact in an asset (stocks, bonds, crypto tokens) at a pre-agreed price.

DeFi Education

Full disclaimer: I’m not an options trader. My knowledge of options extends as far as Investopedia. Many people more savvy than I am have written about options in general, and Dopex options in particular. I will refer you to some of these resources here. If you have no idea what an option is, please read them. I’m not going to go into any kind of detail about the options, but you should know a few basic terms since this is an options protocol after all.

A key concept for our architectural overview is the idea of the writer. An options writer is the one who is providing their capital. Purchasers, or people who want the option, pay premiums to the writer in exchange for the option. Exactly how much premium is the domain of a bunch of math that I’m not going to touch with a 10-foot pole.

What Products Does Dopex Offer?

Dopex offers an ever-expanding suite of products. They currently offer call options on DPX, rDPX, ETH, gOHM, GMX, BNB, and AVAX, and put options on BTC, ETH, DPX, rDPX, GMX, gOHM, LUNA, and CRV weekly. They also are beta-testing an OTC marketplace, and the TZWAP product for managing on-chain dollar-cost-average buys and sells. A new product category, Atlantic options, are coming soon also.

All of these options are based on one primary piece of technology. The backbone – and primary innovation – of the Dopex ecosystem is the Single Staking Options Vault.

What Is A Single Staking Options Vault?

The Single Staking Options Vault accepts deposits of a token and earns yield on them via writing options.

The Single Staking Options Vault (SSOV) is the heart of the Dopex protocol. A traditional single staking vault, like a Yearn vault or an Abracadabra Degenbox allows users to deposit a single underlying token, then deploys their capital and earns yield for them through a strategy or combination of strategies. The SSOV does this with options as the yield strategy.

The SSOV masks all the complexity of options underneath a very simple user interface. The system works on cycles called epochs (set to 1 month for month-end-expiry options). For each epoch, a set of strike prices are initialized, which are set to represent a few price scenarios spread around the current spot price.

Prior to the start of each epoch, these prices are publicized. Writers then deposit collateral into this vault at a selected strike price. When the epoch starts, this capital is locked in and cannot be withdrawn until the end of the cycle. During the epoch, option purchasers can purchase whichever strike prices they choose – as long as there is enough collateral assigned to that strike price by writers. If a writer’s collateral is used to write an option, they earn a premium.

At the end of the cycle, settlement takes place. Writers can collect their premiums and withdraw or redeploy their capital. Purchasers can exercise their options if they are in the money. Then, the next epoch begins.

How Does An SSOV Work?

Note: This overview is for the currently-prevailing V2 SSOVs. Dopex is in the process of releasing V3 SSOVs, which retain the core mechanics, but improve on these features and add flexibility. I will cover that technology at a later time.

At a high level, the SSOV needs a particular set of capabilities.

  • Deposit capital into the vault and attribute it to a particular strike price within a particular epoch
  • Purchase options at a particular strike price within a particular epoch
  • Calculate the premiums due to the writer when their option is purchased
  • Settling of options after an epoch expires

To handle deposits and purchases, the SSOV uses a neat trick of engineering. The contract has the ability to deploy new ERC-20 tokens. When a new epoch is initialized, a new token is created for each combination of epoch and strike price. For example, you will have ERC-20 tokens for DPX-CALL-1500-EPOCH-1, DPX-CALL-1700-EPOCH-1, etc.

Then, these ERC-20 tokens are minted to the SSOV’s address, proportional to the deposits for each strike.

When a purchaser buys an option, the SSOV sends them the tokens. This fungible token represents their option, and can be sold, lent, borrowed against, etc. as part of the broader DeFi ecosystem.

If the purchaser’s position is profitable, at the end of the epoch he can settle his position. This burns the option tokens, and sends the purchaser their profits. If the position is not profitable, nothing happens – the option has expired out of the money and the purchaser is left holding worthless option tokens.

How Are Fees And Premiums Calculated?

Much ink has been spilled on the subject of pricing options. It’s a complex topic, and critical to the profitability of the enterprise. It should come as little surprise, then, that it involves a lot of complex math. This math is not core to the SSOV functionality, so all that heavy lifting is delegated out to an external library contract.

The Options Pricing contract takes in the duration until expiry, the strike price of the option, the current spot price, and the prevailing volatility to calculate the premium required to purchase the option. This contract is a stateless library contract, meaning it can be used by multiple SSOVs. The SSOVs can also plug in different options pricing contracts, in the event that a bugfix or upgrade is required.

Similarly, the Fee Strategy contract handles the calculations of how much, if any, fee is owed to the protocol. Fees can be incurred on both the purchase of an option and the settlement of an option. It is also a stateless library contract, allowing governance to upgrade the fee model as needed.

Oracles

Price oracles are important. That much should be glaringly obvious to anyone who has spent more than 5 minutes in DeFi. As a reminder, oracles allow smart contracts to access information from off-chain sources – like trusted price feeds aggregated from multiple sources including CEXs.

Dopex is atypical in that it requires multiple oracles. In addition to knowing the current price of an asset, options pricing also requires knowledge of the asset’s price volatility. Dopex implements a Price Oracle and a Volatility Oracle to feed this information to its smart contracts.

The information from these oracles is then consumed by the options pricing contract to generate the premium for an option.

Dopex core Contracts Overview

We’ve now covered all the contracts that form the core unit of the Dopex offering. Each SSOV has an associated set of oracles and libraries, and its ever-expanding constellation of option tokens. Adding in governance, we get the fully functional SSOV core suite.

Governance has the ability to pause and unpause the contract, emergency withdraw the SSOV funds if it’s paused, update contract addresses the SSOV will call to, and initialize and start new epochs.

Dopex can expand its offering of call options by deploying another SSOV contract and its associated oracles (and optionally new pricing contracts). Each unit is self-contained and does not have any interaction with other SSOVs, except in an indirect fashion via the DPX and rDPX native tokens.

The Put SSOV

Previously we have discussed the call option SSOV. As a reminder, a call is the option to buy an asset at the strike price. A call writer is betting that the price at expiry will be below strike. The options purchaser is betting that the spot price will be above the strike price at expiry, allowing them to purchase at a discount to spot.

A put functions in the opposition direction, as the right to sell an asset at a given price. A put writer is betting that the spot price will be above strike at expiry. A put purchaser is betting that the spot price will be below strike at expiry, so they can buy at the market price and sell to the put writer for guaranteed . That’s about the extent of my options knowledge, here’s more info if you want it.

The Put SSOV (SSOV-p) functions largely the same as the Call SSOV (SSOV-c). The notable exception is that instead of involving a single token like the SSOV-c, the SSOV-p involves two tokens: The quote token (USDC/USDT Curve 2pool LP tokens) and the base token (DPX, rDPX, ETH, etc.).

Writers deposit their Curve 2pool tokens into the contract. These tokens are automatically staked in Curve by the SSOV-p contract, and the writer will continue to earn CRV staking yield on them. The purchaser has to pay the premium using Curve 2pool tokens, which will also be staked and accrue CRV yield to the writer. The base token is the asset whose price is being speculated on.

Key to note is that the transactions are all done in the quote token. None of the base token is handled by the SSOV-p. The basic flows are the same, with the exception that the tokens are staked and unstaked in the gauge as needed.

The purchaser interacts in the same way as previously, except everything is denominated in 2pool tokens.

Periphery Contract: Router

Periphery contracts are helpers or interfaces which are not strictly necessary for the protocol to function, but make it easier to interact with the core business contracts. We’ve previously discussed patterns like the Fuse Pool Lens, or the Uniswap V3 Router. Dopex uses one type of periphery contract: a swap router.

In particular, this contract functions as a zapper. Ordinarily, using DeFi requires you to hold the token you’re going to use prior to doing your staking/depositing/whatever. This extra step of “buy on Uniswap/Sushiswap/Matcha” in front of transactions adds friction and degrades user experience.

A zapper is a combination of a swap router and an onchain interface for a protocol. It allows you to “zap” or instantly convert any input asset into the output asset you need. It also allows you to seamlessly swap from any input asset and deposit or purchase an option in one transaction. I can start out with DAI in my wallet and seamlessly deposit DPX into the DPX call SSOV.

Wrapping Up

Dopex is a very innovative system with good smart contract engineering. The team continues to release improved versions of their existing products, and come up with new mechanisms. The SSOV in particular is a very strong piece of technology, with a lot of potential to still improve upon.

That’s all for this walkthrough. I hope this Dopex protocol overview was enlightening! If you have questions, shoot me a DM on Twitter.

Photo of author

Written By BowTiedPickle

Anonymous cartoon pickle inspired by BowTiedBull. Degen chemical engineer, moonlighting as a Solidity developer.

Disclosure

This article may contain links to third-party websites or other content for information purposes. BowTiedIsland may receive a commission at no cost to you if you purchase a product after clicking one of these links. The Third-Party Sites are not under the control of BowTiedIsland, and BowTiedIsland is not responsible for the content of any Third-Party Site. All information contained herein is the opinion of the writer and does not constitute financial advice. We aim to act as a neutral third party and aid in your research and analysis.


The Jungle


Crypto, Investing, and E-Commerce with BowTied Bull

The future is internet based, therefore we have a triangle based approach with crypto, e-commerce business making and Investing in traditional assets

Break Into a 6-Figure Wall Street Career

Learn how to efficiently break into investment banking and private equity. The Banker’s Bible is a definitive resource that offers an   A-Z blueprint and also gives you 24/7 access to real finance professionals. 

Fitness With BowTiedOx

BowTiedOx provides you a place to find all of his latest programs and guides.

Weekly newsletters that cover fitness, health, and mindset, all grounded in the fundamentals of physiology.

Media Production with BowTied Turkey and BowTied Tamarin

Video is no longer optional.

Don’t get left behind.

Your brand deserves professional videos to engage your audience.

Art & Graphic Design with BowTied Patriot

BowTied Patriot is a graphic artist who specializes in photography, mixed medium custom artwork, and NFT creation.

Join BowTiedPatriot as he dives into making Art in Web3.0 and The Metaverse.

Cooking with BowTiedOctopod

Learn secrets from a fine dining chef for maximum flavor and time-saving efficiency

Newsletters on Ingredients, Techniques and Flavor hacks that will have you eating better. We will never eat bugs!

Meme Warfare with DgenFren

Increase your online engagement, organically influence narratives, and build your online persona by using marketing that your target audience actually wants: memes.

Learn How to Sell with BowTiedSalesGuy

Sales is one of the most transferrable life skills, yet few know how to actually sell.

Traditional sales tactics don’t cut it in today’s hyper competitive world.

Learn the secrets from a Chad Salesman and change your Life forever.

Ecommerce with BowTiedOpossum

Learn the skills to start and build your first online business.

Want to build a business that travels with you?

Learn from an industry veteran that has worked on and with brands you already know.