Skip to main content
Early termination allows a position owner to close their position before the maturity date. Instead of waiting for the fixing price at settlement, the position is closed at the current forward price for its fixing timestamp. This gives traders the ability to lock in profits, cut losses, or free up margin for other uses at any time before maturity.

How It Works

When a trader calls early termination, the position is settled immediately using the live forward price rather than waiting for the fixing price at maturity. The settlement mechanics (PnL computation, fee collection, USDC distribution) follow the same internal flow as maturity settlement, but with a different price source. Function: SettlementEngine.closePosition(uint256 positionId) CloseReason: EARLY_TERMINATION

Preconditions

Three conditions must be met for early termination:
ConditionError on Failure
Position status is OPENPositionNotOpen
Position is not liquidatable (equity >= MM threshold)EarlyTerminationNotAllowed
Caller is the position ownerNotPositionOwner
Liquidatable positions cannot be closed through early termination. If a position’s equity has dropped below the maintenance margin threshold, it must go through the liquidation path instead. This ensures the liquidation penalty fee is collected on distressed positions.

Termination Flow

1

Owner Calls closePosition

The position owner submits a transaction to SettlementEngine.closePosition(positionId). Only the owner can initiate early termination — unlike settlement and liquidation, this is not a permissionless operation.
2

Validate Preconditions

The contract verifies the position is OPEN, the caller is the owner, and the position is not liquidatable. The liquidation check fetches the current forward price and computes equity.
3

Get Forward Price

The current forward price for the position’s fixing timestamp is fetched via OracleModule.getForward(pairId, fixingTimestamp). An oracle fee is collected from the trader’s collateral.
4

Compute PnL

PnL is computed against the forward price:
  • LONG: pnl = notional * (forwardPrice - entryStrike) / PRICE_PRECISION
  • SHORT: pnl = notional * (entryStrike - forwardPrice) / PRICE_PRECISION
Both realizedPnl (capped at margin) and marketPnl (uncapped) are recorded.
5

Collect Fee

The trading fee is calculated using the snapshotted rate:
fee = notional * snapshotTradingFeeBps / 10000
No liquidation penalty is applied. The fee is capped at available margin after PnL settlement.
6

Settle and Close

USDC flows are distributed (pool pays profits / receives losses), fees go to fee destinations (30% treasury, 70% pool), and the position is closed with CloseReason.EARLY_TERMINATION. Events PositionClosed and PositionClosedEarly are emitted.

Why Close Early?

Lock In Profits

If the forward price has moved in your favor, close early to realize the gain instead of risking a reversal before maturity.

Cut Losses

If the position is losing value but not yet liquidatable, close early to preserve remaining margin rather than waiting for a potential further decline.

Free Up Margin

Closing a position unlocks the margin, making it available as free collateral for new positions or withdrawal.

Forward Price vs Fixing Price

The key difference between early termination and maturity settlement is the price used:
Uses the live forward price for the position’s fixing timestamp. The forward price is published by the authorized publisher and includes time-value adjustments based on the interest rate differential. As the position approaches maturity, the forward price converges toward the spot price, but until maturity it may include a premium or discount reflecting the time remaining.The forward price can be fetched at any time and changes with every publisher update cycle (approximately every 30 seconds).
Because the forward price includes a time-value component, early termination may result in a slightly different outcome than what maturity settlement would have yielded. For short-duration positions close to maturity, the difference is typically small. For longer-duration positions terminated well before maturity, the forward premium or discount can be more significant.

Fee Comparison

Early termination charges only the standard trading fee. There is no liquidation penalty:
Close PathTrading FeeLiquidation PenaltyTotal
Early Terminationnotional * snapshotTradingFeeBps / 10000NoneTrading fee only
Maturity Settlementnotional * snapshotTradingFeeBps / 10000NoneTrading fee only
Liquidationnotional * snapshotTradingFeeBps / 10000notional * snapshotLiquidationPenaltyBps / 10000Both fees combined
Early termination and maturity settlement have the same fee structure. The only close path with an additional fee is liquidation, which adds the liquidation penalty. This means there is no fee penalty for closing early — the decision should be based on price expectations, not fee avoidance.

Mode Restrictions

Early termination is allowed in NORMAL, DEGRADED, and REDUCE_ONLY modes. It is only blocked in PAUSED mode. This is intentional — even when the protocol restricts new position openings (DEGRADED, REDUCE_ONLY), traders can still close their existing positions to manage risk.
ModeEarly Termination
NORMALAllowed
DEGRADEDAllowed
REDUCE_ONLYAllowed
PAUSEDBlocked