Oracle Price
The oracle price is the external spot reference for each asset, sourced from Pyth. Pyth pushes low-latency, real-time prices in a distributed manner directly to the BULK Network, providing a manipulation-resistant benchmark decoupled from BULK’s internal order book. Oracle price updates flow into the executor viaPythOracle actions, where they pass through a price filter (volatility guard against stale or spurious updates) before being accepted.
Mark Price
The mark price is the reference price used for PnL, liquidation triggers, and conditional order activation. BULK computes it using a robust model, a composite of three components that adapts to market conditions.Component 1: Premium-Adjusted Oracle Price
Starts with the Pyth oracle price and subtracts a 150-second EMA of the premium between the oracle and the depth-weighted order book mid-price. This allows the mark price to track persistent premiums or discounts on BULK without being swayed by temporary noise.Component 2: Depth-Weighted Book Price (Denoised)
A depth-weighted mid-price from BULK’s order book, passed through a rolling median filter to remove outlier ticks. The size-weighted mid accounts for the actual liquidity at each level rather than just the top-of-book.Component 3: Smoothed Book Price
A 30-second EMA of the denoised book price. Acts as a stabilizing factor that dampens short-term fluctuations.Final Calculation
In normal conditions, the three components are sorted and the median is selected: Volatility override: When instantaneous volatility (measured via Hawkes IRV or stdev, whichever is larger) exceeds a configurable threshold, the model bypasses the median smoothing and uses the raw depth-weighted book price directly. This ensures the mark price stays reactive during fast-moving markets.Stale-Book Oracle Bias
If the order book has not been updated for an extended period, the mark price biases toward the oracle price on a sigmoid curve: Where the bias factor is 0 when book age is under 1 (fresh book), and when age reaches or exceeds 1: Andage is the book staleness relative to the decay window (in minutes). As the book grows stale, rises from 0 toward 1 on a sigmoid curve, and the mark price converges smoothly to the oracle, ensuring fair pricing even in low-liquidity conditions.
Margin calculations use the mark price for notional values and PnL, but maintenance margin requirements are driven by lambda surfaces that depend on the volatility regime, not the mark price directly. See Margin for how regimes affect margin requirements.
Entry Price
The entry price represents the volume-weighted average price (VWAP) at which your current position was established. It is computed and stored by the clearing engine on every fill:- Position increase: VWAP is updated to blend the existing entry price with the new fill price, weighted by size
- Position decrease: Entry price stays the same (only realized PnL is booked)
- Position flip (e.g. long to short): Entry price resets to the fill price of the new direction
u64) internally to avoid floating-point drift.