Pricing and oracles

Collateral is valued at the lower of two moving averages, never the spot price. A native market reads only its own trades; an oracle-guided one lets one feed bend its curve within set limits.

Updated Nov 9, 2026

A native market never reads a price from outside itself; an oracle-guided market reads one configured feed and lets it bend the curve, within limits. Either way the program keeps a small set of internal observations and uses a different one for each job: the live curve to trade, smoothed prices and depth to lend, and cached references to settle.

The observations

ObservationWhat it isHalf-life
SpotThe curve's marginal price at the current reservesnone
Symmetric EMAA two-way exponential moving average of the spot priceConfigurable, one minute to twelve hours; one hour by default
Directional EMASnaps down to the spot on any fall, eases up on a riseConfigurable, one minute to twelve hours
Pessimistic priceThe lower of the two averagesderived
Depth EMAA moving average of observed curve depthConfigurable
Pessimistic depthThe lower of the observed depth and its averagederived
Centre EMAThe concentration centre the curve is built aroundConfigurable, typically hours
Settlement referenceA cached price the hLP vaults settle against, with a divergence guardcached
Oracle feedOracle-guided markets only: one external report, authenticated on every price-sensitive instructionMust be newer than its maximum age
  • Spot
  • Symmetric average · liquidations
  • Lower of the two averages · new borrows
Four sample hours of spot price.

The two averages do different jobs. The symmetric one resists manipulation: a spike must be held for a full half-life to move it even halfway, which costs the manipulator real inventory, and liquidation health uses it alone. The directional one protects lenders when they lend: it follows a real fall within seconds, and new borrows are sized on the lower of the two, a price that is slow to rise and quick to fall:

p^=min⁡(psymEMA, pdirEMA)\hat p = \min(p_{\text{symEMA}},\ p_{\text{dirEMA}})

Which price does what

JobPrice and depth used
Swaps and leverage entriesThe live curve at current reserves
Borrow admission and stored collateral factorsA shadow constant-product tail at p^\hat p, scaled to pessimistic depth
Lending liquidation eligibilityCollateral marked linearly at the symmetric EMA against the stored factor
Ordinary liquidationSymmetric-EMA eligibility; atomic collateral-for-fixed-payment settlement
Emergency liquidationSymmetric EMA and smoothed depth, separate from immediately manipulable spot reserves
hLP deposits and withdrawalsCached settlement references with a divergence guard, 5% by default

Admission, eligibility and recovery use different valuations on purpose.

Admission is conservative so a loan is never larger than a stressed sale could cover. Eligibility is a smooth mark so healthy positions are not liquidated by a wick. External recovery is the liquidator's fixed-payment route; the internal fallback reconstructs execution from EMA and smoothed depth.

Cached risk books

A risk check does not read the spot price of the same transaction. Observations are cached, and the averages are rolled forward from those cached values, so a borrow or a liquidation cannot be steered by a swap placed in the same instruction. The same idea applies to the hLP settlement reference: a deposit or withdrawal is rejected when the spot has diverged too far from the cached reference, and asked to wait for a settlement.

Oracle-guided markets

A market can opt into one external price feed at creation. Its provider and feed cannot be replaced later. Its oracle policy names the feed and how far to trust it:

SettingWhat it doesBounds
SourcePyth, or a provider's normalized report, as one feed for the pair or as a base and a quote feed taken as a ratioFixed accounts and feed IDs
Oracle weightHow far the curve's price moves toward the feedAbove zero and below 100%; zero is native pricing
Adjustment capThe furthest the feed can pull the price from the native curve, either wayAbove 1×; 1.25× allows 25% higher or 20% lower
Maximum ageHow old a report may be, in seconds and in slotsAbove zero
Maximum confidenceThe widest confidence band accepted, relative to the priceBelow 100%
Maximum publish skewHow far apart the base and quote reports may be publishedRatio sources only

Every price-sensitive instruction reads the feed accounts itself. It checks their owner, feed ID, age and confidence, and that the report is no older than the last one the market used, then prices on a guided curve. The guided marginal price is the native curve's price NN pulled toward the feed's price OO:

P=N⋅exp⁡ ⁣(clip⁡(λln⁡ON, −ln⁡M, ln⁡M))P = N \cdot \exp\!\Big(\operatorname{clip}\big(\lambda \ln \tfrac{O}{N},\ -\ln M,\ \ln M\big)\Big)

where λ\lambda is the oracle weight and MM the adjustment cap. Inside the cap that is a weighted geometric mean of the two prices, N1−λOλN^{1-\lambda} O^{\lambda}.

Guided price against the native curve, by where the feed sits
  • Guided price
  • The feed itself
  • Adjustment cap

Swaps, the moving averages, borrow admission, collateral values and hLP valuation all run on the guided curve, so the feed never values a loan on its own: it can move the curve's price only within the cap, and trades still pay price impact and fees along the curve's depth. A guided market's first deposit is priced at the feed rather than at a price the creator enters.

When a report is stale or fails a check, the instructions that depend on price fail with it: swaps, borrows, liquidity changes, collateral withdrawals, leverage actions and liquidations. Repayments and collateral top-ups keep working.

The provider and feed are creation-only. Operators cannot replace an unavailable source or use an oracle edit to bypass price checks.

What the market knows and what it does not

A native market knows its own trading history, and only that. An oracle-guided market also knows its feed, and inherits the feed's failure modes: a stale report stops price-sensitive actions until valid reports resume.

A thinly traded market has poorly informed averages; a brand-new market has averages equal to its opening price. Its accounting contains a loss inside the market that took the risk, but it cannot tell you the asset's fair value anywhere else, and it cannot promise that liquidity exists at a given price, only that the constant-product tail is never empty.

Choosing a half-life

The market creator sets the symmetric half-life from presets: seven minutes, thirty minutes, one hour or two hours, or any value between one minute and twelve hours in advanced mode. The effective lag before an average has caught up with a step change is roughly five to six half-lives. The operator or manager can announce changes later through the EMA half-lives family, subject to the full notice.