OpEx

Option Trading platform powered by Limit Order Protocol and Pyth Network

OpEx

Created At

ETHGlobal New Delhi

Project Description

Our project is a decentralized Options Trading Protocol built on top of the 1inch Limit Order Protocol with price feeds provided by the Pyth Network. It enables users to create, trade, and exercise on-chain options in a fully permissionless way.

At the core of the protocol, we’ve designed three smart contracts that together form the trading and settlement engine:

  • OptionsNFT – This contract is responsible for minting NFTs that represent individual options. Each NFT encodes the parameters of an option (underlying asset, strike price, expiry date, etc.) and acts as a transferable proof of ownership.

  • Option Engine – The central contract that manages the lifecycle of options. It owns the OptionsNFT contract and handles the creation, validation, and settlement of options. When a user creates a new option, the Option Engine mints an NFT that represents it.

  • Option Hook – This contract integrates directly with the 1inch Limit Order Protocol by implementing its PreInteraction and PostInteraction interfaces. It allows option positions to be listed, matched, and traded on-chain using the existing liquidity and order-matching infrastructure of 1inch.

For pricing, we use the Heston stochastic volatility model, which provides a more realistic options premium than the standard Black–Scholes model by accounting for volatility clustering. Market data (spot prices, volatility inputs, etc.) are fetched securely from the Pyth oracle network, ensuring real-time and reliable inputs for valuation.

The result is a fully decentralized options platform where:

Any user can create their own options on supported underlying assets.

These options can be traded freely as NFTs on secondary markets or via the Limit Order Protocol.

Option holders can exercise their rights after the expiry date, ensuring proper settlement of in-the-money positions.

This design makes options trading transparent, composable, and accessible. Instead of being confined to centralized exchanges, options can now exist as on-chain primitives, integrated into the wider DeFi ecosystem.

How it's Made

We built our protocol as a set of modular smart contracts, designed to be composable with existing DeFi infrastructure. The core architecture consists of three contracts: OptionsNFT, Option Engine, and Option Hook.

OptionsNFT was implemented as an ERC-721 contract to represent each option as a unique, tradable NFT. The metadata encodes the option parameters (underlying, strike, expiry, option type) so that every token carries the full description of the financial derivative it represents.

Option Engine acts as the main controller. It owns the OptionsNFT contract and exposes the methods for creating and exercising options. When a user creates an option, the engine calculates the fair premium using the Heston stochastic volatility model. We implemented this in Python first (for accuracy and speed of iteration) and then built a lightweight pricing service that feeds the result into the contract. The Engine contract interacts with the NFT contract to mint the tokenized representation of the option, and also handles settlement at expiry.

Option Hook is where the integration with the 1inch Limit Order Protocol happens. We implemented both the PreInteraction and PostInteraction interfaces so that options can be seamlessly listed and matched through the existing 1inch order flow. This lets us leverage their battle-tested matching engine and liquidity, instead of reinventing an orderbook.

For underlying asset pricing, we used the Pyth Network oracle. Pyth provides real-time, reliable price feeds for crypto assets, which are critical for both pricing the option and determining settlement conditions at expiry. Without it, our Heston model inputs wouldn’t be trustworthy.

The Heston model implementation was one of the more “hacky” parts: since it’s computationally heavy, we didn’t run it directly on-chain. Instead, we set up an off-chain pricing microservice that continuously fetches data from Pyth, computes the option premium using Heston dynamics, and pushes the results back to the blockchain through signed messages. The contracts then verify and use these signed values. This hybrid approach gave us both mathematical rigor and gas efficiency.

background image mobile

Join the mailing list

Get the latest news and updates