Introducing ohmydai

writing and selling put options on chain is now possible

ohmydai
Published in
6 min readNov 22, 2019

--

TL;DR

  • ohmydai is a tool that allows you to bet on, or protect against, the volatility in Multi Collateral DAI.
  • By limiting the choices to either selling or buying a put option, this tool is testing concepts explored in the Convexity Protocol's first example (credits to Zubin Koticha).
  • The tool can be configured to allow trading options of any asset (ERC-20 or synthetic) and we intend to implement more possibilities in the near future.

Overview

If you're part of the DeFi community you probably have an opinion about Multi Collateral DAI. And it's probably safe to say that, at this moment, you either own DAI or USDC, amongst other cryptos.

What if you could trade your predictions about Multi Collateral DAI? In other words, what if you could accept some risk and bet on that perception or buy a protection?

There are many ways of trading one’s perception about an event, one instrument used for that in traditional markets is options trading.

Putting aside all the complexity around pricing options, buying an option basically means to acquire the right of buying or selling the underlying asset to the seller in the future. The seller, on the other hand, charges a premium for proving that right to the buyer.

ohmydai is a tool to allow the user to do that: buy the right to sell assets for a price in the future, by paying a premium upfront.

There are two basic types of options: calls and puts. A call is the option to buy the underlying asset, at the strike price. A put is the option to sell the underlying asset, at the strike price. From those types, one could put together several structures, figures, strategies, investments and so on.

An option can also be seen as a contract that represents either an obligation or a right. If the user sells an option, it has an obligation. And, on the other hand, if the user buys an option, it acquires the right to exercise it at some point in the future.

an option is a contract that represents either an obligation or a right.

But for our experiment, we decided to focus on only one type of option: puts. More specifically, we are starting with only one pair of underlying asset and strike asset (DAI:USDC).

So, at this point, ohmydai can only allow people to write puts with DAI as the underlying asset and USDC as the strike and collateral asset. The strike price is fixed to 1 USDC which means that the buyer of this option has the right to sell 1 unit of DAI for 1 USDC when it chooses to (if the maturity period has not elapsed) — this is called “exercising an option”.

Furthermore, there are two commonly used types of options. With “American options”, the option can be exercised at any time, event before maturity is reached. “European options” however, must be executed at the maturity date. For our puts, we are using American options, meaning they can be executed at any moment by the buyer.

To simplify things, our options are built with physical settlement. That means we don't need a price oracle to evaluate an option's intrinsic value and estimate the amount of collateral that should be exchanged in the exercise.

Explored solution

At a high-level: we’re allowing an USDC holder to sell an American put option where the underlying asset is DAI, strike price is 1 USDC and the maturity is fixed.

Writing a put option, in blockchain terms, is equivalent to locking collateral in a contract, minting tokens and selling it on Uniswap for the premium's current market price. To mint a token, the seller has to lock up as much collateral as tokens that it wants to mint, keeping a parity of 1:1 (for every 1 put option token, there is 1 USDC locked in collateral).We call those tokens ohtokens.

Mechanics of ohmydai.

for every ohtoken, there's 1 USDC locked in collateral.

Locking collateral in the contract works as a margin, required when you're trading futures or swaps. In the specific case of selling puts, the total amount of margin that could ever be required is limited to the amount of units of ohtokens one's minted (the worst case scenario happens if the underlying asset price goes to zero, even then, the seller would have enough funds to cover the exercise).

On the buyer side, it's as simple as typing the amount of DAI units they want to be able to sell in the future, each for the price of 1 USDC. The premium for the required option size is going to be calculated based on Uniswap's supply and demand levels. If the DAI holder wants to buy protection, he has to pay the premium in USDC upfront. Then he will get the ohtokens into his wallet address and the deal is done.

After the buyer has bought the ohtokens, it can exercise the option at any moment until the expiration is reached.
If, for instance, the price of DAI is 0.8 USDC, we say that the option is trading in-the-money and it is very likely that the buyer will exercise it. To exercise its ohtokens, the buyer has to send ohtokens plus the amount of units of DAI it wants to exercise. With that, the contract will access the seller's collateral and will hand the equivalent USDC funds to the buyer.

On the seller side, there is no way of undoing the contract once a buyer bought the tokens. But, what a seller could do to reduce or net its total exposure is to buy the equivalent amount of ohtokens from another seller. This way, the seller would hold two opposite positions and the net value of them can be close to zero. It all depends on the premium it sold the ohtokens for compared to the premium it had to pay for the opposite position.

Alice and Bob

Let's imagine Alice believes the new DAI peg will work just fine. And she's currently holding funds in USDC. However, she noticed that her colleague Bob is not so optimistic and would be interested in buying a protection to a potential peg volatility. Alice tells Bob all about options and they decided to exchange their risks. Alice can enter ohmydai's website, connect with MetaMask and mint ohtokens. Bob, on the other side of this trade, will enter the website, connect MetaMask and will buy ohtokens for its current market premium.

If Alice is right, she'll make a profit on day one and will be able to reinvest the premium somewhere else (hopefully the premium she got is higher than the total accrued interest she'd get if she had served the USDC collateral in a lending protocol, such as Compound). If time passes and Bob turns out to be right and decides to exercise its option, Alice will have to buy DAI from Bob at 1 USDC, regardless of the price DAI is trading in the market.

Coming next

We chose to keep the base use case super restrict to test our first version and iterate from your feedback. But it is our intention to implement other possibilities soon. Let us know your thoughts, suggestions and doubts.

To learn more about ohmydai

--

--