> For the complete documentation index, see [llms.txt](https://docs.force.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.force.xyz/perp-mechanics/oracle-price.md).

# Oracle Price

The oracle price is the reference the market is funded and marked against. It is recomputed continuously and submitted to Hyperliquid roughly every three seconds.

It serves two functions:

1. It is the reference price for funding.
2. It is an input to the mark price.

The oracle keeps publishing whether or not anything underneath it is trading. It does that by running three [sessions](/perp-mechanics/sessions.md) and always using the most direct source available.

## Cash session

The oracle publishes the observed cash rate directly. No conversion, no modelling.

## Extended session: turning a futures price into a yield

The futures contract settles against real Treasury notes with somewhere between roughly nine and a half and ten years left to run, so it is not tied to one specific bond. It is quoted instead against a standardised one sitting in the middle of that range: a notional bond paying a 6% coupon with 9.75 years remaining. Turning its price into a yield is then a single expression.

$$
\text{translated} = \frac{C + (FV - P)/N}{(FV + P)/2} \times 100
$$

$$P$$ is the futures price, the only input that changes. $$C$$ is the coupon, 6%, and $$FV$$ the face value, 100: both are standard values written into the contract specification. $$N$$ is the years to maturity, taken as 9.75, the midpoint of the range the contract accepts for delivery.

This is a rough translation of price into yield rather than a precise valuation. The consequence is that the translated yield **tracks the shape of the real yield closely but sits at a slightly wrong level**. That turns out not to matter, because the level is exactly the part that can be measured and corrected. The offset is called the **basis**.

### The basis

While the cash market is open both numbers exist, so the system keeps a running average of the distance between them. It is an exponential average with a one hour time constant, which follows a genuine drift in the basis within a few hours while ignoring minute-to-minute noise.

$$
\text{basis}*t = w \cdot \text{basis}*{t-1} + (1 - w) \cdot (\text{cash}\_t - \text{translated}\_t)
$$

$$
w = \exp\left(-\frac{\min(\Delta t,; c\tau)}{\tau}\right), \qquad \tau = 1\ \text{hour}, \qquad c = 0.1
$$

The average advances only while a cash print is fresh. The moment the Cash session ends it **freezes**, and that frozen value is added to the translated yield for as long as Extended lasts.

$$
\text{aligned} = \text{translated} + \text{basis}
$$

The aligned yield is what gets published during Extended. The cap $$c$$ means a single update moves the basis at most $$1 - e^{-0.1} \approx 9.5%$$ of the way to the live spread, however long the gap since the previous update.

Because the basis is measured right up to the moment the cash market stops, the first aligned value published after it stops lands within a fraction of a basis point of the last cash value. The handover is not a visible event.

## Internal session

When no external market is available, the oracle advances by a continuous-time exponentially weighted moving average that adjusts the previous oracle price by a fraction of the **impact price difference**.

With oracle price $$S$$, the impact price difference is

$$
IPD = \max(P\_{\text{impactBid}} - S,; 0) - \max(S - P\_{\text{impactAsk}},; 0)
$$

where the impact bid and impact ask are the average execution prices to trade a configured notional on each side of the order book. The oracle then updates as

$$
S\_t = \beta\_t \cdot S\_{t^-} + (1 - \beta\_t)\left(S\_{t^-} + IPD\_t\right)
$$

$$
\beta\_t = \exp\left(-\frac{\min(\Delta t,; c\tau)}{\tau}\right), \qquad \tau = 30\ \text{minutes}, \qquad c = 0.1
$$

Three properties follow, and they are the point of the design.

* **It does not move while the price sits inside the book.** If the oracle is between the impact bid and the impact ask, $$IPD$$ is zero and the oracle is flat. It responds only once the whole book has moved away from it.
* **It moves slowly.** With a 30 minute time constant and a three second tick, one update covers a very small fraction of the distance to the target.
* **It cannot be jumped.** The cap means no single update moves the oracle more than about 9.5% of the way to the target, however long the gap since the last one.

Together these mean that moving the oracle during Internal requires holding the whole book away from it for a sustained period, which costs real money over hours. The lag against the book is not a defect to be tuned away; it is the property that makes the index expensive to push.

When external data becomes unavailable the internal mechanism initialises from the last external price. When external inputs resume, the oracle reverts to the external price on the next tick.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.force.xyz/perp-mechanics/oracle-price.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
