Inspiration

Decentralized derivatives platforms are the next step in the evolution of the decentralized finance and cryptocurrency space. Current protocols that enable users to buy options contracts on-chain are inefficient from a liquidity perspective. Current options contracts platforms are based on either peer-to-peer trading (inefficient) or peer-to-pool (risky for liquidity providers) models. Our platform combines aspects from the traditional finance world with blockchain and smart contracts to create a best of both worlds scenario without sacrificing decentralization.

What it does

Our platform is a decentralized options contract protocol for any ERC-20 token that has sufficient liquidity on Uniswap V3, V2, or Curve. Users can choose from any pair of ERC-20 tokens. Instead of having to find a willing seller of an option contract, a user can replicate the payoff of the given option contract they would like to buy. This is done through a process known as delta hedging and option replication. A user can choose from a variety of option hedging models (currently Black Scholes & Jump Diffusion) to create the option contract of their choice. Additionally, users can set any arbitrary parameters of the option hedging models (strike price, volatility, risk-free rate, and time to expiry). On current defi options contract protocols, this is not possible.

What are options contracts? Options are financial derivatives that give buyers the right, but not the obligation, to buy or sell an underlying asset at an agreed-upon price and date.

What is option contract replication? Option contract replication is the process of delta hedging the underlying asset so that a user’s portfolio matches the payoff of the selected option contract.

How decentralized is the protocol that we built? The process of calculating the delta of the user-selected option contract is entirely computed on-chain and so is the process of delta hedging the underlying ERC20 token.

How we built it

We built the smart contracts by writing option pricing models in solidity. Currently, we have 3 option pricing models, Black Scholes Merton, Jump Diffusion Model, and Curved Options for Hedging IL on Uniswap V2. To test our hypotheses we wrote several jupyter notebooks in python. The front end is written in javascript and reactjs and uses tailwind css.

Challenges we ran into

Solidity does not support floating point arithmetic, so this was difficult initially to write option pricing models. However, after finding Paul Berg's math library, PRB-math, it became much easier to write these math-heavy option pricing models. Additionally, we had to do some digging in some low-level C++ and rust source code to find the implementation of functions like atan2 and the cumulative distribution function! This was pretty cool because in the process we created several math libraries in Solidity!

Accomplishments that we're proud of

We are super proud of the Solidity math libraries and research we have done regarding option contract replication. We want to keep working on the math libraries, primarily our statistics, complex number, and option pricing libraries.

What we learned

We learned a ton of math behind option pricing models. We also ended up learning a bit of react to create our simple front end. Also, we learned that not having floating point arithmetic support in Solidity isn't so bad after all.

What's next for Volatility-Smilers-Team (Decentralized Options Contracts)

We plan on building out the protocol and releasing it on Polygon. Option pricing is relatively computationally heavy (for the EVM), so this is why we want to release on Polygon first. We need to keep building out the logic of how a user begins option contract replication, and how another user can hedge the option contract of the first user. We have some preliminary code, however, it isn't finished. For the hackathon, we primarily focused on the math libraries, research, and the front end.

Built With

Share this project:

Updates