ChainScore Labs
LABS
Guides

How DeFi Options Protocols Handle Settlement

Chainscore © 2025
core_concepts

Core Settlement Concepts in DeFi Options

The mechanisms for exercising and settling options contracts define protocol risk and capital efficiency. This section details the primary settlement models used in decentralized finance.

01

Physical Settlement

Physical delivery transfers the underlying asset upon exercise. The option writer must hold the asset in escrow.

  • Requires full collateralization of the underlying asset (e.g., 1 ETH call requires 1 ETH locked).
  • Common in protocols like Hegic and Opyn v1 for its straightforward payoff.
  • Creates capital inefficiency for writers but guarantees settlement certainty for holders.
02

Cash Settlement

Cash settlement pays the profit in the settlement currency, not the underlying asset. The payoff is the difference between spot and strike price.

  • Settles in a stablecoin like USDC, avoiding direct asset transfer.
  • Used by Deribit and many DeFi protocols for capital efficiency.
  • Relies on a trusted oracle (e.g., Chainlink) to determine the final settlement price.
03

European vs. American Exercise

Exercise style dictates when an option can be settled. European options are exercisable only at expiry, while American options can be exercised anytime before expiry.

  • European exercise simplifies pricing and settlement logic, used by Lyra.
  • American exercise provides flexibility for holders but requires more complex on-chain logic.
  • The style impacts liquidity provider risk models and hedging strategies.
04

Automatic Exercise

Automatic exercise is a protocol-level rule that settles in-the-money options at expiry without holder action.

  • Eliminates holder gas costs and risk of forgetting to exercise.
  • Requires the protocol to automatically calculate payouts using an oracle.
  • Common in DeFi to improve UX, but introduces small oracle dependency risk at expiry.
05

Settlement Oracles

Settlement oracles provide the final reference price (e.g., TWAP) to determine if an option is in-the-money for cash settlement.

  • Protocols use decentralized oracle networks like Chainlink or Uniswap V3 TWAPs.
  • Oracle manipulation at expiry is a key systemic risk.
  • Some protocols use a dispute period or multiple oracle sources to enhance security.
06

Partial Collateralization

Partial collateralization allows writers to post less than 100% of the max loss, improving capital efficiency. Settlement may involve liquidation.

  • Used in peer-to-pool models like Dopex, backed by a shared liquidity pool.
  • If a writer is undercollateralized at exercise, the pool covers the shortfall.
  • Requires robust risk engines and liquidation mechanisms to ensure solvency.

The Standard On-Chain Settlement Flow

Process overview for automated option exercise and settlement.

1

Expiry and Exercise Window

Triggering the settlement process at maturity.

Detailed Instructions

At the option's expiry timestamp, the contract enters a predefined exercise window. This is the period during which the option holder can call the exercise function. For European-style options, this window is often the block containing the expiry time itself. For American-style options, the window is the entire period from listing to expiry. The protocol's oracle (e.g., Chainlink) is queried to obtain the final settlement price of the underlying asset. This price is compared to the option's strike price to determine if it is in-the-money (ITM). The settlement logic is typically permissionless, meaning any external actor can trigger it to collect a reward.

  • Sub-step 1: Monitor the blockchain for the expiry block.
  • Sub-step 2: The settlement function checks block.timestamp >= expiryTime.
  • Sub-step 3: Fetch the oracle price via priceFeed.latestAnswer().
solidity
// Example check for expiry require(block.timestamp >= expiryTimestamp, "Option not expired"); uint256 settlementPrice = oracle.getPrice(underlyingAsset); bool isITM = (optionType == OptionType.Call) ? settlementPrice > strikePrice : settlementPrice < strikePrice;

Tip: The exercise window may have a buffer (e.g., 1 hour) after expiry to account for oracle latency or network congestion.

2

ITM Determination and Payout Calculation

Computing the profit for the option holder.

Detailed Instructions

Using the fetched settlement price, the contract calculates the intrinsic value of the option. For a call option, the payout is max(0, settlementPrice - strikePrice). For a put option, it's max(0, strikePrice - settlementPrice). This value is then multiplied by the option size (e.g., number of tokens per contract) to determine the total payout in the quote currency (e.g., USDC). Protocols must handle precision and decimal differences between assets. The calculation is performed on-chain, and the result is stored in the option's state. This step also validates that the option holder has sufficient collateral locked in the protocol's vault to cover the payout.

  • Sub-step 1: Calculate raw payout: (settlementPrice - strikePrice) * optionSize.
  • Sub-step 2: Apply max(0, payout) to ensure no negative value.
  • Sub-step 3: Adjust for decimals: payout * 10^(quoteDecimals) / 10^(priceFeedDecimals).
solidity
// Payout calculation for a call uint256 payoutRaw = (settlementPrice - strikePrice) * optionSize; uint256 payout = payoutRaw > 0 ? payoutRaw : 0; // Scale to quote token decimals (e.g., USDC has 6) uint256 finalPayout = payout * (10**6) / (10**oracleDecimals);

Tip: Use fixed-point math libraries (like PRBMath) to avoid overflow and precision loss in these calculations.

3

Collateral Transfer and Option Burn

Executing the value transfer and retiring the option NFT.

Detailed Instructions

The calculated payout is transferred from the protocol's collateral vault to the option holder's address. The vault must be pre-funded by the option writer (seller). The transfer is typically done via the ERC-20 transfer function. Concurrently, the option's NFT representation (ERC-721 or ERC-1155) is burned by calling _burn(tokenId), permanently removing it from circulation and marking the contract as settled. This burn operation is critical to prevent re-entrancy or double-spend attacks. The contract state is updated to reflect the settled status, often by setting a flag like isSettled[tokenId] = true. Gas costs for this step are usually borne by the entity triggering the settlement.

  • Sub-step 1: Check vault balance: vault.balanceOf(quoteToken) >= finalPayout.
  • Sub-step 2: Execute transfer: quoteToken.safeTransfer(holder, finalPayout).
  • Sub-step 3: Burn the option token: _burn(tokenId).
solidity
// Transfer and burn sequence require(quoteToken.balanceOf(vaultAddress) >= payoutAmount, "Insufficient vault collateral"); quoteToken.safeTransferFrom(vaultAddress, optionOwner, payoutAmount); _burn(optionId); isSettled[optionId] = true;

Tip: Use Checks-Effects-Interactions pattern: update state (isSettled) before external calls to prevent reentrancy.

4

Settlement Finalization and Fee Distribution

Completing the cycle and distributing protocol fees.

Detailed Instructions

After the payout, the protocol often takes a settlement fee, which is a percentage of the intrinsic value or a fixed amount. This fee is transferred to the protocol's treasury or fee distributor contract. The remaining collateral (for ITM options) or the full collateral (for OTM options) is released back to the option writer. An expiry event is emitted, logging key details like tokenId, settlementPrice, and payout. For OTM options, the settlement is a no-op where the NFT is burned, and the writer's collateral is unlocked without any payout. The contract's global accounting is updated to reflect the reduced active obligations.

  • Sub-step 1: Calculate protocol fee: payout * protocolFeeBps / 10000.
  • Sub-step 2: Transfer fee to treasury: quoteToken.transfer(treasury, feeAmount).
  • Sub-step 3: Emit event: emit OptionSettled(tokenId, holder, settlementPrice, payout).
solidity
// Fee calculation and event emission uint256 fee = (payout * PROTOCOL_FEE_BPS) / 10000; uint256 holderPayout = payout - fee; if(fee > 0) { quoteToken.transfer(treasury, fee); } emit Settled( tokenId, msg.sender, settlementPrice, holderPayout, fee );

Tip: Store fee parameters (like PROTOCOL_FEE_BPS) as immutable variables to reduce gas costs and ensure consistency.

Settlement Mechanisms Across Major Protocols

Comparison of settlement execution, finality, and cost structures.

Settlement FeatureLyra (Optimism)Dopex (Arbitrum)Premia (Ethereum L1)

Settlement Trigger

Automated on-chain oracle price at expiry

Manual exercise by option holder post-expiry

Automated via AMM pool liquidity at any time

Finality Time

~1 minute (Optimism block time)

~0.26 seconds (Arbitrum block time)

~12 seconds (Ethereum block time)

Primary Gas Cost

~0.001-0.005 ETH (L2 gas)

~0.0001-0.0005 ETH (L2 gas)

~0.02-0.1 ETH (L1 gas)

Exercise Window

1-hour grace period post-expiry

Indefinite post-expiry (requires manual action)

Anytime before expiry (European-style)

Settlement Asset

Quote asset (e.g., sUSD, USDC) from pool

Base asset (e.g., WETH) transferred between parties

Collateral (USDC, WETH) released from vault

Price Oracle

Chainlink on Optimism with 1-hour TWAP

Chainlink on Arbitrum with spot price

Internal AMM pool price (acts as oracle)

Dispute Mechanism

None (fully automated, trustless settlement)

Multi-sig admin can pause in emergency

Governance can upgrade oracle module

Architectural Models for Settlement

Direct Contract Execution

On-chain settlement is the most common model where the option's payoff is calculated and executed directly within a smart contract on the same blockchain. This model prioritizes self-custody and transparency, as all logic and funds are managed by immutable code.

Key Characteristics

  • Atomic Execution: The entire process of exercise and payout occurs in a single transaction, eliminating counterparty risk during settlement.
  • Capital Efficiency: Requires collateral to be locked in the smart contract for the duration of the option, which can be significant for sellers.
  • Protocol Examples: Hegic and Opyn v1 (now Squeeth) utilize this model. In Hegic, liquidity providers deposit funds into pools that are used to underwrite options, with payouts deducted directly from these pools upon exercise.

Trade-offs

While secure and trustless, this model is constrained by blockchain throughput and gas costs, making frequent settlement of small-value options economically unviable. It also places the burden of oracle reliability on the protocol, as price feeds must be highly secure to trigger accurate settlements.

key_components

Critical Technical Components

The settlement layer is the core engine of any DeFi options protocol, determining how obligations are resolved and value is transferred. This section details the key technical systems that enable secure, efficient, and trustless execution of option contracts.

01

Settlement Oracle

Price oracles are critical for determining the final settlement price of an option at expiry. They aggregate data from multiple decentralized sources to provide a manipulation-resistant price feed.

  • Uses time-weighted average prices (TWAP) from major DEXs to smooth volatility.
  • Implements a decentralized network of node operators for data submission and validation.
  • Why this matters: A reliable oracle prevents settlement disputes and ensures payouts are fair and accurate for all counterparties.
02

Collateral Vaults

Collateral management systems lock and programmatically release assets based on contract outcomes. These are typically non-custodial smart contracts that hold the underlying or strike assets.

  • Automatically liquidates collateral if a position falls below maintenance margin.
  • Supports multiple asset types (e.g., ETH, stablecoins) as collateral for different option series.
  • Why this matters: It ensures solvency, eliminates counterparty risk, and enables the creation of fully collateralized options.
03

Exercise & Assignment Engine

This automated logic handles the process of option exercise (for buyers) and assignment (for sellers) at expiry or early. It's a core state-transition mechanism within the protocol's smart contracts.

  • For American options, allows exercise at any time before expiry, triggering a payout calculation.
  • Randomly or pro-rata assigns exercised put/call obligations to writers in the pool.
  • Why this matters: It enforces contract terms autonomously, removing manual processes and central intermediaries from settlement.
04

Payout Module

The payout function calculates the final profit or loss for each party after settlement. This on-chain computation uses the oracle price, strike price, and contract size to determine net transfer amounts.

  • For a settled call option: payout = max(0, settlement price - strike price) * size.
  • Transfers the calculated amount from the collateral vault to the winning party's address.
  • Why this matters: It executes the core financial promise of the option, finalizing the economic outcome trustlessly.
05

Dispute Resolution Mechanism

A fallback system for handling challenges to settlement results, often involving a decentralized oracle or governance layer. This is a safety mechanism for edge cases or suspected oracle failure.

  • Initiates a challenge period where node operators can vote on the correct price.
  • Can slash malicious actors and correct settlement payouts via a multi-sig or DAO vote.
  • Why this matters: It adds a layer of security and social consensus to protect users from technical failures or manipulation attempts.
06

Position Tokenization

The representation of options and vault shares as ERC-20 or ERC-721 tokens. This transforms options positions into transferable, composable assets that can be integrated with other DeFi protocols.

  • An option buyer holds a long option token representing the right to exercise.
  • An LP holds a vault share token representing a claim on the collateral pool's fees and liabilities.
  • Why this matters: Enables secondary market trading, use as collateral elsewhere, and improves liquidity and capital efficiency for users.

Settlement Challenges and Solutions

On-chain settlement introduces several key risks. Counterparty risk is reduced but not eliminated, as smart contract bugs or exploits can prevent proper execution. Oracle risk is critical, as settlement prices depend on external data feeds that can be manipulated or delayed. Network congestion can cause settlement transactions to be delayed or fail, potentially leaving positions in a vulnerable state. For example, during periods of high gas fees on Ethereum, a settlement transaction costing 100+ gwei may become economically unviable for small option positions, leading to failed exercises.