feat: aave v4 price feeds#199
Open
nikkaroraa wants to merge 5 commits into
Open
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
Verification Results
- Group ID: 7347dc76-c826-4537-9397-5b16ab179086
- Commit: 590c934
| Job | Result | VERIFIED |
|---|---|---|
| EtherFiSafe.… | ✅ | 14 |
| CashModuleCo… | ✅ | 2 |
There was a problem hiding this comment.
Verification Results
- Group ID: 8cf6e95e-3b27-4e53-8221-eb6ae2c454e8
- Commit: 5b63be6
| Job | Result | VERIFIED |
|---|---|---|
| EtherFiSafe.… | ✅ | 14 |
| CashModuleCo… | ✅ | 2 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 454f0c0. Configure here.
There was a problem hiding this comment.
Verification Results
- Group ID: e1bfa874-9247-4c7a-8581-c6d8312965e7
- Commit: 454f0c0
| Job | Result | VERIFIED |
|---|---|---|
| EtherFiSafe.… | ✅ | 14 |
| CashModuleCo… | ✅ | 2 |
Prices a token for the Aave v4 oracle from the OracleSink (the OP-side store of prices relayed from mainnet over LayerZero), one instance per token since the sink's latestRoundData is token-keyed. Enforces its own immutable staleness bound against the source-chain read time the relay stamped, so a delayed LayerZero delivery cannot present a stale price as fresh. Two modes like the sibling feeds: USD-quoted, or a rate composed on an underlying IAaveV4PriceFeed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Verification Results
- Group ID: 3b5fd14b-1f30-4fba-8df1-61a0d8d554ca
- Commit: 3c93207
| Job | Result | VERIFIED |
|---|---|---|
| EtherFiSafe.… | ✅ | 14 |
| CashModuleCo… | ✅ | 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
The four price feed contracts for the Aave v4 oracle, plus their tests:
ChainlinkPriceFeed,PythPriceFeed,VedaAccountantPriceFeed: one instance per token, each implementing the Aave v4 price-feed interface (IAaveV4PriceFeed). Each feed works in two modes: a USD-quoted source scaled to feed decimals, or a rate source (e.g. weETH/ETH) multiplied by any underlyingIAaveV4PriceFeed.StablePriceLib: shared snap of USD-stable prices to 1 USD.latestAnswerreverts on a stale, paused, non-positive, or reverting source.Why
Split out of #153 so a second auditor can audit the feed contracts in parallel with the rest of the lend logic. The files are verbatim from
feat/lend; #153 is now stacked on this branch and carries the wiring and consumers (the Aave v4 oracle setup and deploy scripts).Testing
Three fork test suites on Optimism (
test/price-provider/), running under the default profile in CI. They cover both modes per feed, staleness bounds, decimal normalization, and the fail-closed paths.Note
High Risk
These feeds directly determine collateral USD values for Aave v4; misconfiguration of staleness bounds, underlying feed wiring, or decimal composition could misprice assets or allow stale prices.
Overview
Adds Aave v4–compatible price feeds (
IAaveV4PriceFeed) so receipt and wrapped assets can be used as collateral, split from the broader lend stack for parallel audit.BaseAaveV4PriceFeedcentralizes USD composition: either scale a USD-quoted rate to feed decimals, or multiply a rate by an optional underlyingIAaveV4PriceFeed(composite feeds must be staleness-aware feeds, not raw Chainlink aggregators).StablePriceLibsnaps stablecoins to exactly $1 within a 1% band. All feeds fail closed—latestAnswerreverts on stale, zero/negative, paused, or missing data.Four source-specific implementations wrap Chainlink (
ChainlinkPriceFeed), LayerZero-relayedOracleSinkprices (OracleSinkPriceFeed, staleness on source-chainupdatedAt), Morpho Pyth pair adapters on OP (PythPriceFeed, direct Pyth publish-time checks), and Veda vault accountants (VedaAccountantPriceFeed). MIT interfaces mirror external ABIs without vendoring BUSL code.Fork and unit tests under
test/price-provider/cover both pricing modes, staleness edges, stable snapping, and revert paths on Optimism (and mocks for sink/Pyth).Reviewed by Cursor Bugbot for commit 3c93207. Bugbot is set up for automated code reviews on this repo. Configure here.