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:
| Principle | Description |
|---|---|
| Lazy Registration | Series are created on-demand when first traded (no upfront admin setup) |
| Freeform Parameters | Any strike price and expiry timestamp is valid |
| Minimum Expiry | Series must expire at least 1 hour in the future |
| Permissionless | Anyone can create series by initiating the first trade |
Series Identification
Each option series is uniquely identified by a deterministic hash:
| Component | Description |
|---|---|
pairId | Trading pair identifier (e.g., ETH-USD) |
strike | Strike price in WAD (1e18 = $1.00) |
expiry | Unix timestamp of expiration |
isCall | true 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:
| Validation | Rule |
|---|---|
| ID Match | keccak256(pairId, strike, expiry, isCall) == seriesId |
| Valid Pair | pairId must be registered in the Oracle |
| Minimum Expiry | expiry >= block.timestamp + 1 hour |
| Positive Strike | strike > 0 |
Trade Validation
Before any trade executes:
| Validation | Rule |
|---|---|
| Series Exists | Series must be registered |
| Not Expired | block.timestamp < expiry |
| Not Settled | Series 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:
- Validate/Create Series - SeriesRegistry validates parameters and creates series if new
- Check Trading Allowed - Verify series is not expired and not settled
- 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
| Aspect | Description |
|---|---|
| Creation Trigger | First mint or trade with a seriesId |
| Validation | Automatic parameter validation on creation |
| ID Generation | Deterministic hash of (pairId, strike, expiry, isCall) |
| Minimum Expiry | At least 1 hour from creation time |
| Permissionless | Anyone can create series through trading |
Related
For settlement of expired options using TWAP pricing, see Options Settlement.