project screenshot 1
project screenshot 2
project screenshot 3

Optionism

Optionism is a permissionless platform to write or buy options of derivatives based on a wide range of assets market, like equities, commodities, fx. It uses PythNetwork Pull oracle prices + Gelato Web3 Function to cash-settle option contracts on derivatives products.

Optionism

Created At

Superhack 2024

Winner of

Blockscout - Use Blockscout Block Explorer!

Prize Pool

Pyth - Most Innovative use of Pyth pull oracle (Price Feeds) 2nd place

Project Description

This project is a decentralized options trading platform that allows users to write and subscribe to options contracts based on the price movements of various assets, similar to traditional finance (TradFi) options. This target two kind of user:

  • The writer ( Who publish the option )
  • The buyer ( Who buy a share of the option contract )

Writers can create call or put options, selecting a strike price and other parameters, while buyers can subscribe by paying a premium. Upon expiration, a Gelato Web3 function automatically resolves the contract by pulling price data from Pyth (off-chain) via the Hermes REST API. The outcome is determined based on the direction of the option (call or put) and the final price of the asset. Only cash settlements are made, as the platform deals solely with derivatives and not the underlying assets themselves. This is helpful if you have no easy access to options in the real world.

Thanks to Pyth Network, Optionism can access pulled data from a wide range of categories: crypto, equities, commodities, forex, rates, metals in the most accurate way.

How it's Made

The core of Optionism is its smart contract, where all key operations take place. Publishers can write options by depositing collateral to cover potential losses, and buyers can subscribe to them directly on-chain by paying the Premium Cost. When a share is purchased it mints a 1155 token to the buyer allowing shares for secondary trades.

However, to automate the process, the platform leverages the Gelato Network's Web3 functions to constantly monitor and handle options that have just expired on contract and need for a price update. Gelato pulls off-chain price data from Pyth Network API, processes it, and sends the valid input to the gelatoCallback() function within the smart contract. This function then updates the Pyth's prices on-chain, resolving the option by comparing the current price with the previously established strike price. If strike price isnt met the stake is returned to the writer, otherwise the gains are calculated by the ratio and made claimable to the subscribers.

The application is built using Next.js. Additionally, a dedicated Subgraph is integrated to facilitate seamless data retrieval.

What could i do as an addition:

Locking big amount of money for a long period of time isnt' worth it. If i had more time i would have integrated a way to invest these money into some protocol to extract value from long term options.

background image mobile

Join the mailing list

Get the latest news and updates