Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Mark price

Parcl V4 uses multiple price references for different purposes. The price shown in the UI ("mark price") may not match the price used for liquidation checks, and the price used for funding rate calculation may differ from both. This separation prevents orderbook manipulation from triggering forced liquidations or distorting funding.

The exact routing depends on asset class because the threats and tradeoffs are different for daily-cadence real estate indices vs. continuously-traded commodities.

Price references

NameDefinitionAlways available?
Oracle priceLatest signed price from the external oracle feedWhen fresh; may go Stale during venue closures
Impact midDepth-weighted VWAP midpoint of the orderbookWhen the book has sufficient depth
Last tradeMost recent trade price on this marketWhen recent trades exist
Median markmedian(oracle, impact mid, last trade) — robust to one bad sourceWhenever any two of the three are valid

Mark price by asset class

Asset classMark price methodWhy
Real estateImpact midDaily oracle has no intraday signal; orderbook is the only intraday reference
CommoditiesMedian markMedian is robust to single-source failure (stale oracle, manipulated book, weird trade)

Why the median for continuous markets

The median property requires two of three sources to be wrong before it can be pushed. Concrete examples:

Normal trading. Oracle $102.30, impact mid $102.32, last trade $102.31 → median $102.31. Tracks oracle, which tracks the real market.

Manipulation attempt. Attacker pushes orderbook to skew impact mid to $115. Oracle $102.30, impact mid $115, last trade $102.30 → median $102.30. Manipulation rejected.

Off-hours (ICE closed). Oracle frozen at $102.20 (external feed stopped publishing), impact mid $103.05 (orderbook drifted), last trade $103.10 (recent fills moved). Median $103.05 — tracks reality, ignores stale oracle. Liquidations and stops still fire correctly.

The median lets us run perps 24/7 even when the underlying venue is closed, which is the entire UX promise of crypto-native perp DEXs.

Impact mid

The impact mid is a depth-weighted midpoint that resists manipulation by small orders. Instead of taking the simple midpoint of best bid and best ask, it walks each side of the orderbook, accumulating notional value up to a configured threshold, and computes the volume-weighted average price (VWAP) for each side. The impact mid is the midpoint of the two VWAPs.

Depth thresholds:
Asset classThreshold
Real estate$5,000
Commodities$25,000

A single dust order at the top of book cannot move the impact mid. To move it by 1% on a real estate market, an attacker would need approximately $5,000 of capital positioned in the book; on a commodity market, $25,000.

Fallback behavior:
  • If either side of the book has insufficient depth to reach the threshold, impact mid falls back to the oracle price.
  • If the depth threshold is set to 0, impact mid degrades to the simple midpoint (best bid + best ask) / 2.

Which price is used where

For how the liquidation reference price plugs into the margin inequality, see Liquidations.

Real estate markets

PurposePrice referenceWhy
Displayed mark priceImpact midOnly intraday signal on daily-oracle markets
Unrealized PnLImpact midMatches displayed mark
Margin check (initial/maintenance)Impact mid
Liquidation checkOracle priceStrongest manipulation resistance for forced actions
TP/SL trigger evaluationOracle pricePrevents stop-hunting via orderbook manipulation
Funding rateImpact midFunding cares about book imbalance

TP/SL triggers and liquidations fire on the oracle price, not the displayed mark. Your stop-loss fires only when the underlying real estate index actually moves (once daily at the oracle update), not when someone moves the orderbook intraday. On thin real estate books, orderbook-based triggers are vulnerable to manipulation.

Commodity markets

PurposePrice referenceWhy
Displayed mark priceMedian markRobust real-time reference
Unrealized PnLMedian markMatches displayed mark
Margin check (initial/maintenance)Median mark
Liquidation checkMedian markStays enforceable 24/7 (falls back to orderbook when oracle stale)
TP/SL trigger evaluationMedian markMatches what traders see; resistant to single-source manipulation
Funding rateImpact midFunding cares about book imbalance

TP/SL triggers and liquidations on commodity markets fire when the median mark crosses the threshold, not when any single source crosses. This means your stop on Brent fires when our chain's median price hits your trigger — which closely tracks the actual market price, even when the oracle goes stale during ICE off-hours.

Funding rate premium

The funding rate uses the impact mid as its input regardless of asset class:

premium = (impact_mid - oracle_price) / oracle_price

The funding rate responds to real-time orderbook imbalance regardless of what the oracle says. This is the same on every asset class because funding's job is to anchor the book to the index, not to be the trigger price for forced actions.