> For the complete documentation index, see [llms.txt](https://docs.usegimbal.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.usegimbal.app/risk/pricing.md).

# Pricing, sessions and the price checks

PriceSentinel is the one contract that turns a Chainlink answer into a price the desk and the auction will act on, after classifying the trading session and checking for a stale, paused or out-of-line

Neither the desk nor the collateral auction calls Chainlink directly. Both ask `PriceSentinel`, which reads the feed, classifies the session, runs the checks and returns a quote with flags. A stale or paused market does not make a quote revert; the flags report it and the caller decides.

## What comes back in a quote

`quote(collateralToken)` returns the price in loan-token units with `updatedAt`, the session, `stale`, `paused`, the ERC-8056 multiplier and `sequencerGrace`. `refresh` returns the same quote and writes a move-cap checkpoint. `feedConfig`, `checkpoint` and `hasStream` expose a token's configuration, its last checkpoint and pause flag, and whether a Data Streams adapter is attached. The Explorer and Telemetry show these readouts live for each collateral token.

## Four inputs

| Input                                       | Model                                                                                                                                                      | Where it is used                                                                                                                                                    |
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Chainlink **Data Feeds**, 24/5              | Push. Updated on chain on deviation or heartbeat.                                                                                                          | Origination LTV, the health factor, warnings.                                                                                                                       |
| Chainlink **Data Streams** (RWA schema v11) | Pull. The auction buyer submits a signed report, which the stream adapter verifies on chain through the VerifierProxy. The report includes `marketStatus`. | The price a liquidation auction settles at.                                                                                                                         |
| Chainlink **Sequencer Uptime Feed**         | Push.                                                                                                                                                      | The post-outage grace period, covered in [When the sequencer stops](/risk/sequencer.md).                                                                            |
| ERC-8056 `uiMultiplier()`                   | Read from the Stock Token contract itself.                                                                                                                 | Share-denominated accounting and the Explorer display. Chainlink's answer already has the multiplier folded in, so `PriceSentinel` reports it and never applies it. |

Feeds and Streams cross-check each other for free: a stream report more than the tolerance (2% as deployed) from the feed is rejected and the purchase reverts.

## Regular, extended and closed

Regular trading on a stock exchange adds up to about 32 hours per week, a little more with extended hours; the market is shut otherwise. `PriceSentinel` labels each quote **regular**, **extended** or **closed**. With a market-status source configured, the label follows Chainlink's codes: 5 is closed, 2 is extended, anything else is regular. Without one, a clock schedule applies: weekends closed, weekdays regular from 14:30 to 21:00 UTC and extended from 09:00 to 01:00 the next day. The clock cannot see exchange holidays, so a production token always carries a status source.

Each session has its own staleness bound. As deployed:

| Session  | Staleness bound | What changes                                                                       |
| -------- | --------------- | ---------------------------------------------------------------------------------- |
| Regular  | 1 hour          | Tier LTVs apply unchanged.                                                         |
| Extended | 2 hours         | Tier LTVs apply unchanged.                                                         |
| Closed   | 4 days          | Both the max LTV and the liquidation LTV drop by the tier's closed-market haircut. |

The haircut exists because Monday's open can sit a long way from Friday's close. Since the liquidation LTV drops too, a position that looks fine on Friday afternoon needs extra room for the weekend. The platform warns a borrower near the limit before the market shuts, not after it reopens.

## The checks, and what each one blocks

| Condition                                                                                                             | What happens                                                                                                                                                              |
| --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The answer is zero or negative, its timestamp zero or in the future, or the price rescales to zero                    | `quote` reverts.                                                                                                                                                          |
| `updatedAt` is beyond the staleness bound during regular or extended hours                                            | Origination reverts and no auction can open. The health factor applies the closed-market haircut.                                                                         |
| `updatedAt` is beyond the staleness bound while the market is closed                                                  | Expected. Origination proceeds under the haircut, the health factor applies it, and the auction floor uses the closed-session ratio.                                      |
| A `refresh` finds the price more than the 25% cap away from a checkpoint written within the last hour                 | The market is paused. Origination and auction opening stop until governance calls `resume` after review. Repayment never reads a price, so it keeps working.              |
| The token reports `oraclePaused()`, or governance has called `pause`                                                  | The market is paused while the flag is set; on the token side that normally means a corporate action is under way. Origination and liquidation stop; repayment continues. |
| A stream report sits outside the tolerance from the feed, or carries a timestamp beyond the session's staleness bound | The auction purchase reverts.                                                                                                                                             |

## Only the token in escrow

For every market, the configuration names the feed of the precise token held in escrow. Wrappers, vault shares and cross-token exchange rates are never sources. The rule answers Edel Finance's wGOOGLx loss of July 2026: the underlying's oracle was right, but a wrapper's rate had been pushed 78 times higher and counted as collateral value. [Four precedents the design answers](/risk/precedents.md) has the detail.

## Changing a feed

`configureFeed` sets, for one collateral token, the feed, the loan token, the three staleness bounds, the move cap and its window, the stream tolerance, and the optional status, pause, multiplier and stream sources. Only the PolicyBoard's owner may call it, and each call emits `FeedConfigured`. Like any risk parameter, a feed change is published with its rationale in the governance log.


---

# 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.usegimbal.app/risk/pricing.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.
