Options Creation
How option series are created and validated in the Diffusal protocol
This document explains how option series are created and managed by admin wallets in the Diffusal protocol.
Design Principles
The options creation system follows these core principles:
| Principle | Description |
|---|---|
| Admin-Controlled Creation | Series are created by admin wallets using canonical strikes from the strike ladder |
| Deterministic IDs | Series ID is a hash of (pairId, strike, expiry, isCall) |
| Minimum Expiry | Series must expire at least 1 hour in the future |
| Permissionless Trading | Anyone can trade once a series exists |
Series Identification
Each option series is uniquely identified by a deterministic hash:
| Component | Description |
|---|---|
pairId | Trading pair identifier (e.g., ETH-USDT) |
strike | Strike price in WAD (1e18 = $1.00) |
expiry | Unix timestamp of expiration |
isCall | true for call, false for put |
Series Lifecycle
1. Creation (Admin-Controlled)
Series are created by admin wallets via createSeries(). Only canonical strikes from the strike ladder algorithm are registered. Operator contracts (OrderBook, RFQ) use getSeries() to look up existing series during trades. For the full details on how expiry surfaces and strike ladders are generated, see Series Creation.
Typical flows:
- Series registration: Admin wallets create series with canonical strikes ahead of trading demand, or in response to market conditions.
- RFQ flow: Position creation happens when filling an RFQ against an existing series. The market maker signs a quote, and upon fill, the system creates a short for the market maker (with +premiumBalance) and a long for the buyer (with -premiumBalance).
- Limit order flow: Active market makers can place limit orders on the order book for existing series.
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
- premiumBalance updated for both parties (no premium transfer at trade time)
Validation Rules
Series Creation Validation
When an admin creates a new series via createSeries(), 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:
- Look Up Series - SeriesRegistry validates the series exists and is tradeable via
getSeries() - 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 | Admin-only via createSeries() with canonical strikes |
| Validation | Automatic parameter validation on creation |
| ID Generation | Deterministic hash of (pairId, strike, expiry, isCall) |
| Minimum Expiry | At least 1 hour from creation time |
| Trading | Permissionless once a series exists |
Related
Protocol Documentation
- Series Creation — Expiry surfaces, strike ladders, and on-chain series registration
- Options Settlement — Settlement of expired options using TWAP pricing
- Order Book — Limit order trading for options
- RFQ Flow — RFQ trading with market makers
Contract Documentation
- DiffusalOptionsSeriesRegistry — Series registration and validation
- DiffusalOptionsOrderBook — Order book integration
- DiffusalOptionsRFQ — RFQ integration