Diffusal
Protocol

Options Creation

How option series are created and validated in the Diffusal protocol

This document explains how option series are created on-demand through lazy registration.


Design Principles

The options creation system follows these core principles:

PrincipleDescription
Lazy RegistrationSeries are created on-demand when first traded (no upfront admin setup)
Freeform ParametersAny strike price and expiry timestamp is valid
Minimum ExpirySeries must expire at least 1 hour in the future
PermissionlessAnyone can create series by initiating the first trade

Series Identification

Each option series is uniquely identified by a deterministic hash:

seriesId=keccak256(pairId,strike,expiry,isCall)\text{seriesId} = \text{keccak256}(\text{pairId}, \text{strike}, \text{expiry}, \text{isCall})
ComponentDescription
pairIdTrading pair identifier (e.g., ETH-USD)
strikeStrike price in WAD (1e18 = $1.00)
expiryUnix timestamp of expiration
isCalltrue for call, false for put

Series Lifecycle

1. Creation (Lazy Registration)

Series are not pre-registered. They are created automatically on first interaction.

When a mint or trade references a seriesId, the SeriesRegistry checks if the series exists. If yes, it validates the series is not expired and proceeds. If no, it decodes and validates the parameters (verifying the hash matches seriesId, pairId is registered, expiry is at least 1 hour in the future, and strike > 0), then registers the series and proceeds.

Typical flows: Minting is the first interaction that triggers series creation:

  • RFQ flow: Minting happens on-demand when filling an RFQ. The market maker signs a quote, and upon fill, the system mints a short to the market maker and a long to the buyer, with the buyer paying the premium.
  • Limit order flow: The MMM pre-mints pairs to have inventory for selling longs via limit orders on the order book.

2. Trading Phase

During the trading phase (block.timestamp < expiry):

  • Orders can be placed and filled
  • Positions can be opened and closed
  • Mark price uses Black-Scholes for margin calculations
  • Premium flows between buyers and sellers

Validation Rules

Series Creation Validation

When a series is first referenced, the following validations occur:

ValidationRule
ID Matchkeccak256(pairId, strike, expiry, isCall) == seriesId
Valid PairpairId must be registered in the Oracle
Minimum Expiryexpiry >= block.timestamp + 1 hour
Positive Strikestrike > 0

Trade Validation

Before any trade executes:

ValidationRule
Series ExistsSeries must be registered
Not Expiredblock.timestamp < expiry
Not SettledSeries must not be marked as settled

Integration with Order Book

Order Structure

Orders reference series by their deterministic ID. An order contains the maker address, seriesId, isBuy flag, price, size, nonce, and order expiry (not option expiry).

When filling an order for a new series, the taker also provides series parameters: pairId, strike, optionExpiry, and isCall.

Fill Order Flow

When filling an order for a new series:

  1. Validate/Create Series - SeriesRegistry validates parameters and creates series if new
  2. Check Trading Allowed - Verify series is not expired and not settled
  3. Execute Fill - Normal order book fill logic proceeds

Security Considerations

Parameter Validation

  • All series parameters are validated on first interaction
  • Invalid parameters cause transaction revert
  • Hash verification ensures parameters match seriesId

Minimum Expiry Enforcement

The 1-hour minimum expiry requirement ensures:

  • Sufficient time for TWAP price accumulation before settlement
  • Protection against last-minute series creation attacks
  • Adequate trading window for price discovery

Summary

AspectDescription
Creation TriggerFirst mint or trade with a seriesId
ValidationAutomatic parameter validation on creation
ID GenerationDeterministic hash of (pairId, strike, expiry, isCall)
Minimum ExpiryAt least 1 hour from creation time
PermissionlessAnyone can create series through trading

For settlement of expired options using TWAP pricing, see Options Settlement.

On this page