ClearingHouse
receives Oracle Price updates via a dedicated channel, which in turn triggers a recalculation of the Mark Price.MarkPriceCalculator
is the component responsible for this vital calculation.
Component 1: Adjusted Oracle Price
calculate
function within the MarkPriceCalculator
computes these three components, sorts them, and selects the median value. The result is a scaled Decimal
that represents the final, robust Mark Price. The implementation includes sensible fallbacks, such as using the Smoothed Local Price (Component 3), to avoid using volatile data in the case of thin order books.
Whenever the MarkPriceCalculator
computes a new Mark Price, it is immediately sent back to the ClearingHouse
, ensuring the central risk engine always has the latest and most accurate price for all its calculations.