Having a trust-minimized and liquid options market is an essential lego for DeFi. Options are an important tool to hedge against present biases and insure against future uncertainties.
What it does
Allows anyone to issue a call or a put option. A call option is simply "I would like to have the option, but not the obligation, to buy asset X at price Y on this future date". A counterparty replies "sure I will grant you that option if you pay me today W fee". A put option is similar, except it gives the right to sell the asset, and hence the counterparty agrees to buy it in the future, and again charging a fee for that privilege.
How we built it
Put/call options are issued thru UMA protocol: a factory contract creates an expanded ERC20 contract representing the option. We used 0x protocol to create a DEX that lists this token for sale. We adapted a 0x relayer backend to list the token and a front end to view the order book and buy/sell these option tokens. We integrated the
strikePrice into UMA's derivative contract's margin maintenance/liquidation calculation by subtracting it from current price given by the price feed oracle. strikePrice is the price at which the put/call option is executed at the expiry date.
Challenges we ran into
NodeJS versioning issues. Everything being on a different TestNet!
Accomplishments that we are proud of
We managed to put many moving and disparate parts together. We herded test nets like cats, and mostly it all worked. We did a lot of work modifying the various protocol contracts to fit our project.
What we learned
DeFi is more like building a rocket because it requires expertise from disparate domains
What's next for Muh Options
Instead of the issuing party waiting for a counterparty to show up, we would like to create a liquidity pool that options traders can issue/trade against. Liquidity providers collect fees.