-
Notifications
You must be signed in to change notification settings - Fork 6
Proposal: Move Pyth network updates to trigger on price movement rather than time #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe mainnet Pyth price pusher configuration YAML was comprehensively revised. Multiple new price feeds were added, parameters were standardized across feeds, and early update settings were simplified. Uniform time difference and price deviation thresholds were established, with minor exceptions for specific assets, and early_update sections were added with only price_deviation criteria. Changes
Sequence Diagram(s)sequenceDiagram
participant Config as pyth-price-pusher-config.yaml
participant Pusher as Price Pusher Service
participant Feeds as Price Feeds
Config->>Pusher: Load configuration (multiple feeds, uniform parameters)
loop For each feed
Pusher->>Feeds: Request price data
Feeds-->>Pusher: Return price, confidence, timestamp
Pusher->>Pusher: Evaluate time_difference, price_deviation, confidence_ratio
alt Criteria met or early_update triggered
Pusher->>Feeds: Push update
else Criteria not met
Pusher->>Feeds: Skip update
end
end
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
mainnet/pyth-price-pusher-config.yaml (2)
2-81: DRY the configuration with YAML anchors to reduce duplication.The
time_difference,price_deviation, andconfidence_ratiofields are identical across most of the 16 feed entries. This repetition increases maintenance burden and risk of drift. Consider extracting the common settings into a YAML anchor (or multiple anchors) and merging them into each feed. For example:defaults: &feed_defaults time_difference: 600 price_deviation: 0.9 confidence_ratio: 1 feeds: - alias: ARB/USD id: "0x3fa4…" <<: *feed_defaults - alias: BTC/USD id: "0xe62d…" price_deviation: 0.4 # override default <<: *feed_defaults # …repeat for other feeds
17-26: Document the tighter deviation thresholds for BTC and CBBTC.The
price_deviationis narrowed to0.4forBTC/USD(lines 17–21) andCBBTC/USD(lines 22–26), diverging from the standard0.9. Please add an inline comment clarifying this exception, e.g.:price_deviation: 0.4 # BTC-specific tighter threshold per Pyth spec
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
mainnet/pyth-price-pusher-config.yaml(1 hunks)
🔇 Additional comments (1)
mainnet/pyth-price-pusher-config.yaml (1)
67-75: Confirm removal ofearly_updatefor stablecoins.The previous
early_updateparameters forUSDC/USDandUSDT/USDhave been dropped in the new block (lines 67–75). Ensure this change is intentional and doesn’t compromise stablecoin price freshness. If you still need rapid updates for these pairs, consider restoring a minimalearly_updatesetting.
… price has moved 0.9% or we've reached the 10 minute trigger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (1)
mainnet/pyth-price-pusher-config.yaml (1)
2-8: Consolidate repeated configuration using YAML anchors for maintainability.
Thetime_difference,price_deviation,confidence_ratio, andearly_updateentries are identical across feeds; consider defining a shared anchor (e.g.,default_push) and merging it in each feed to reduce duplication and minimize errors.# Example using YAML anchors defaults: &default_push time_difference: 600 price_deviation: 0.9 confidence_ratio: 1 early_update: price_deviation: 0.5 feeds: - alias: ARB/USD <<: *default_push id: "0x3fa4252848f9f0a1480be62745a4629d9eb1322aebab8a791e344b3b9c1adcf5"
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…network-config into 20250506-pyth-config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
mainnet/pyth-price-pusher-config.yaml (1)
1-1: Consider DRYing common parameters with YAML anchors
There’s extensive duplication across feed entries. Define a base anchor immediately after the---marker for shared fields (time_difference,price_deviation,confidence_ratio,early_update) and merge it into each feed, overriding onlyalias,id, and asset-specific thresholds. This will simplify maintenance and reduce copy-paste errors.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
mainnet/pyth-price-pusher-config.yaml(1 hunks)
🔇 Additional comments (1)
mainnet/pyth-price-pusher-config.yaml (1)
2-8: Feed definitions uniformly configured
All entries consistently applytime_difference: 600, appropriateprice_deviation(0.9 for most, 0.4 for BTC),confidence_ratio: 1, and anearly_updatewith a lower deviation threshold (0.5 or 0.2). This aligns precisely with the PR objective to trigger on significant price movements or at least every ten minutes.Also applies to: 9-15, 16-22, 23-29, 37-43, 44-50, 51-57, 58-64, 65-71, 72-78, 79-85, 86-92, 93-99, 100-106, 107-113
Description
The Pyth Price Pusher is currently configured to push updates every 30 seconds. This PR would make the following changes:
This ensures that prices are at least from within the last ~10 minutes, and have not shifted more than 1%.
Groups which require more consistent pricing would benefit from implementing the Pull Oracle model Pyth encourages, described here: https://docs.pyth.network/price-feeds/pull-updates
Example:
Is this deployed somewhere outside of the CI/CD process already, and if so, where?
How Has This Been Tested?
Checklist:
Summary by CodeRabbit