Skip to content

feat: oracle configuration card on the V3 reserve page - #3214

Open
mgrabina wants to merge 14 commits into
mainfrom
aavev3-189-oracle-data
Open

mgrabina wants to merge 14 commits into
mainfrom
aavev3-189-oracle-data

Conversation

@mgrabina

@mgrabina mgrabina commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Context: folds in #3215, #3216. Pins SDK preview 0.0.0-preview-20261202151459; swap for the aave/aave-sdk#190 release before merge, once prod serves Reserve.oracle.

Now: an Oracle Configuration card on reserve pages, GHO too: prices, freshness, contract, heartbeat, provider, admin and PT maturity, plus a table for multi-feed or capped oracles.

Decisions:

  • (implicit) Poll every 60s, paused when hidden, none on error
  • Header icon scrolls to the card; explorer link moves to contract row
  • (implicit) No table for one feed, no sorting
  • (implicit) Figma spacing, V3 tokens, v4's dot pulse and ratio format

Checked: 11 jest tests, tsc on the SDK preview, one request a minute, 25 states, 1440 and 375px.

API schema: none; reads V3 Reserve.oracle from aave/backend#1837 (additive, on staging).

Skip src/locales/*, public/icons/*. 1,054 logic lines, over limit by choice.

Full schema diff (from aave/aave-sdk#190)
--- a/packages/graphql/schema.graphql
+++ b/packages/graphql/schema.graphql
@@ -1336,6 +1336,9 @@ type Reserve {
 
   """Get the user state on the reserve"""
   userState: ReserveUserState
+
+  """Null when the reserve has no price source yet."""
+  oracle: ReserveOracle
 }
 
 type ReserveBorrowInfo {
@@ -1443,6 +1446,182 @@ type ReserveIsolationModeConfig {
   totalBorrows: TokenAmount! @deprecated(reason: "Deprecated in v3.7+: use the selected eMode category's `isolated` flag instead")
 }
 
+type ReserveOracle {
+  """The reserve's price source contract (adapter)."""
+  address: EvmAddress!
+  kind: ReserveOracleKind!
+  description: String
+
+  """The oracle's own answer in USD. Null when inputs are missing."""
+  price: DecimalValue
+
+  """
+  Oldest feed update, or for MANUAL the last time an admin set the price. Null for FIXED or when a feed never answered.
+  """
+  lastUpdatedAt: DateTime
+
+  """When the Pendle principal token this oracle prices matures. Null otherwise."""
+  maturity: DateTime
+
+  """
+  First time a curated market's oracle named this address as a reserve's price source on this chain.
+  """
+  createdAt: DateTime!
+
+  """Null until a backfill fills old rows."""
+  creationTx: TxHash
+
+  """
+  Chainlink proxies, aggregators or sinks behind the source. Empty for FIXED.
+  """
+  feeds: [ReserveOracleFeed!]!
+
+  """
+  The exchange rates the price multiplies its feeds by, such as `wstETH / stETH` for a capped
+  liquid staking token, each read from its token contract and held under a cap. Null for an
+  oracle with none.
+  """
+  cappedRates: [ReserveOracleCappedRate!]
+
+  """
+  Who operates the oracle. Chainlink when every feed is a Chainlink feed, a reviewed name
+  otherwise, and null when neither is known.
+  """
+  provider: ReserveOracleProvider
+
+  """
+  Who can change the oracle contract: its owner, or a name such as `Aave governance`. Null when
+  nobody can, or when its owner has not been read yet.
+  """
+  administration: ReserveOracleAdministration
+
+  """
+  What CoinGecko reports the reserve's underlying token trades at, to set beside `price`.
+  Null on testnets, for a token CoinGecko does not list, and before its first read.
+  """
+  marketPrice: ReserveOracleMarketPrice
+}
+
+type ReserveOracleAdministration {
+  """
+  A name for the administrator, such as `Aave governance`. Null when `owner` is set.
+  """
+  label: String
+
+  """The account that owns the contract. Null when `label` is set."""
+  owner: EvmAddress
+
+  """
+  What kind of account `owner` is. Null when `label` is set, and for an owner not read yet.
+  """
+  ownerKind: ReserveOracleOwnerKind
+
+  """
+  How many of `signers` must approve a transaction. Null unless `owner` is a Safe.
+  """
+  threshold: Int
+
+  """The Safe's signers, newest first. Null unless `owner` is a Safe."""
+  signers: [EvmAddress!]
+}
+
+"""
+An exchange rate a reserve's oracle reads from a token contract, such as stETH per wstETH, and
+the cap the oracle holds it under.
+"""
+type ReserveOracleCappedRate {
+  """The contract the rate is read from, such as the wstETH token."""
+  address: EvmAddress!
+
+  """
+  The pair the rate converts, such as `wstETH / stETH`. Null when the oracle does not name it.
+  """
+  description: String
+
+  """The latest rate read, sampled every few minutes."""
+  rate: DecimalValue!
+
+  """
+  The highest rate the oracle accepts right now. Above it, the price uses this instead.
+  """
+  maxRate: DecimalValue!
+
+  """How fast the cap grows, per year."""
+  maxYearlyGrowth: PercentValue!
+
+  """
+  When the rate last changed, to within a few minutes. Null when it has not changed in the
+  last 30 days.
+  """
+  lastChangedAt: DateTime
+}
+
+type ReserveOracleFeed {
+  address: EvmAddress!
+  description: String
+  lastUpdatedAt: DateTime
+
+  """
+  The feed's latest answer in its own units, such as BTC per WBTC for `WBTC / BTC` or USD for
+  `ETH / USD`. A relay sink answers in the units of the price it relays. Null before its first.
+  """
+  answer: DecimalValue
+
+  """
+  The longest the feed goes without an update, in seconds, as its Chainlink configuration sets
+  it. Null for a feed with no Chainlink configuration.
+  """
+  heartbeatSeconds: Int
+
+  """
+  How far the price moves before the feed updates ahead of its heartbeat, as its Chainlink
+  configuration sets it. Null for a feed with no Chainlink configuration, and for one that
+  updates on its heartbeat alone.
+  """
+  deviationThreshold: PercentValue
+
+  """
+  Who can change the feed contract: its owner, or a reviewed name. Null when nobody can, or
+  when its owner has not been read yet.
+  """
+  administration: ReserveOracleAdministration
+}
+
+enum ReserveOracleKind {
+  MARKET
+  FIXED
+  MANUAL
+}
+
+type ReserveOracleMarketPrice {
+  """The price in USD."""
+  price: BigDecimal!
+
+  """
+  When CoinGecko computed the price, which can trail the request by minutes.
+  """
+  lastUpdatedAt: DateTime!
+}
+
+enum ReserveOracleOwnerKind {
+  """A Safe multisig."""
+  SAFE
+
+  """An externally owned account, with no code."""
+  EOA
+
+  """A contract that is not a Safe."""
+  CONTRACT
+}
+
+type ReserveOracleProvider {
+  """The provider's name, such as `Chainlink`."""
+  name: String!
+
+  """The provider's website. Null when none is set."""
+  url: String
+}
+
 input ReserveRequest {
   """The pool address for the market"""
   market: EvmAddress!
Decision details
  • Poll 60s, retry: 1, no polling while the query errors. Why: feeds update on heartbeats of minutes to hours. Accepts: 60 requests per open tab per hour; header and card share one query, so a page sends one a minute, none while hidden and one on return (local, mocked answers, also at 4x CPU). Rejected: no refresh, where a page left open turns amber on old data.
  • Header icon: without oracle data it keeps today's explorer link. Accepts: no Oracle Price event once the card has data.
  • Feeds table: one feed repeats the card. Rejected: Figma's sort arrows, v4's sortable table. Five equal columns as in Figma; rows stack as cards below 760px, where a provider logo and link overflow a column.
  • Ratios at 4 decimals, 4 significant digits below 1 (LDO / ETH: 0.0001432). Sibling cards' 10px radius.
  • States checked: 11 mocked and 14 real reserves (local backend, staging data), light and dark, 1440, 761 and 375px, against Figma.

Review in order:

  1. oracleUtils.ts, useReserveOracle.ts
  2. ReserveOracleCard/index.tsx, OracleParts.tsx
  3. OraclePriceFeeds.tsx, ReserveTopDetails.tsx

Closes AAVEV3-173
Part of AAVEV3-189

Adds useReserveOracle, which reads Reserve.oracle from the V3 API every 60s,
and the helpers the oracle card needs: freshness against each feed's heartbeat,
age, heartbeat and price formatting, and the administrations to show.
Shows the reserve's oracle price, its freshness against each feed's heartbeat,
market price, contract, heartbeat and deviation, provider, source date, creation
tx and administration, read from the V3 API's Reserve.oracle every 60s. The
header's oracle price icon now scrolls to the card.
Lists each feed of an oracle with more than one feed or a capped rate: name,
provider, heartbeat and deviation, last answer in its quote's units, and its
freshness. Capped rate rows show the rate used, the cap and the yearly growth.
@vercel

vercel Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
interface Ready Ready Preview Dec 3, 2026 10:54am UTC

Request Review

@linear-code

linear-code Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

AAVEV3-189

AAVEV3-173

@mgrabina

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 734ef9e7fc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T15:28:01.153397Z dfeb6e7 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Rates show up to five decimals so a rate just under its cap reads apart from
it, and the Capped tooltip names the rate the token reports. The table switches
to cards at the shared list breakpoint, and a feed answer's pair wraps instead
of running into the next column.
@mgrabina
mgrabina added this pull request to stack #3217 November 30, 2026 22:07
Before the API serves Reserve.oracle the card is empty, so the icon opens the
oracle contract on the explorer and sends the Oracle Price event as it does
today. It scrolls to the card once the oracle loads.
Labels and status use the 14/18 base type, the dot is 8px with a 4px halo and pulses while fresh,
stale and outdated use the health-factor yellow and red, detail rows keep 18px with icons, and the
prices stack on narrow screens so the divider no longer hangs.
# Conflicts:
#	src/modules/reserve-overview/ReserveOracleCard/OracleParts.tsx
Title, header and row heights, 16px edges and type follow the Figma table.
Columns are equal width and the table turns into cards below sm, where a
provider logo and link no longer fit a fifth of the row.
LDO / ETH answers 0.000143 and showed as 0.0001; v4 shows 0.0001432.
@mgrabina
mgrabina marked this pull request as ready for review December 2, 2026 12:53
@mgrabina
mgrabina removed this pull request from stack #3217 December 2, 2026 13:39
@mgrabina mgrabina changed the title feat: reserve oracle query and freshness helpers feat: oracle configuration card on the V3 reserve page Dec 2, 2026
@mgrabina

mgrabina commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 8fd98d522f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@aave/graphql and @aave/react 0.0.0-preview-20261202151459 carry the oracle query and hook. Swap for the aave-sdk#190 release before merge.
@mgrabina

mgrabina commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: dfeb6e7fc1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

📦 Next.js Bundle Analysis for aave-ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

📦 Next.js Bundle Analysis for aave-ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

This branch was successfully deployed

1 active deployment
Preview — 109ea424 Deployed Dec 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants