Skip to content

Conversation

@CryptoFewka
Copy link
Contributor

@CryptoFewka CryptoFewka commented May 6, 2025

Description

The Pyth Price Pusher is currently configured to push updates every 30 seconds. This PR would make the following changes:

  • Support additional pairs
  • Update all pairs if
    • any pair's price moves 0.9%, or 0.4% for BTC
    • every 10 minutes

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:

  • BTC/USD has a value of $95,000 on chain, and was last updated 5 minutes ago
  • At minute 6, Pyth price data for BTC/USD indicates that the current value is 95,200. The price would not be updated.
  • At minute 7, Pyth price data for BTC/USD indicates that the current value is 95,475. The price for all pairs would be updated.

Is this deployed somewhere outside of the CI/CD process already, and if so, where?

  • Developnet
  • Athens-Validators
  • Mainnet-Validators

How Has This Been Tested?

Checklist:

  • I have performed a self-review of my code
  • My changes generate no new warnings

Summary by CodeRabbit

  • New Features
    • Added multiple new price feeds, expanding coverage beyond BTC/USD to include assets such as ARB, AVAX, BNB, ETH, SOL, and more.
  • Refactor
    • Standardized update parameters across all price feeds for improved consistency.
    • Adjusted thresholds for time difference and price deviation to tighter, more uniform values.
    • Simplified early update triggers by focusing on price deviation only.

@coderabbitai
Copy link

coderabbitai bot commented May 6, 2025

📝 Walkthrough

Walkthrough

The 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

File(s) Change Summary
mainnet/pyth-price-pusher-config.yaml Expanded from a single BTC/USD feed to multiple asset feeds; standardized time_difference to 600 seconds; unified price_deviation mostly to 0.9% except 0.4% for BTC/USD and CBBTC/USD; set confidence_ratio to 1 for all; replaced complex early_update parameters with simplified price_deviation-only triggers at 0.5%, with BTC/USD at 0.2%; reordered feeds including moving ZETA/USD to last position.

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
Loading

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca211c9 and f52527b.

📒 Files selected for processing (1)
  • mainnet/pyth-price-pusher-config.yaml (1 hunks)
🔇 Additional comments (3)
mainnet/pyth-price-pusher-config.yaml (3)

3-8: Default anchor correctly defines shared update thresholds.
Consolidates the 10 min interval (time_difference: 600), 0.9 % deviation (price_deviation: 0.9), confidence ratio (confidence_ratio: 1), and the 0.5 % early‐update trigger into a reusable anchor, reducing repetition and matching the PR’s objectives.


10-15: BTC‐specific anchor tightens thresholds as intended.
The btc_defaults anchor applies a 0.4 % main deviation with a 0.2 % early‐update trigger for BTC‐related feeds, correctly implementing the PR’s requirement for Bitcoin assets.


17-81: Price feeds list leverages anchors for consistency and maintainability.
Each feed entry cleanly merges either defaults or btc_defaults, ensuring uniform thresholds across all assets. The list is alphabetically ordered and includes the newly added pairs as specified by the PR.


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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@CryptoFewka CryptoFewka marked this pull request as ready for review May 6, 2025 19:58
@CryptoFewka CryptoFewka requested a review from a team as a code owner May 6, 2025 19:58
Copy link

@coderabbitai coderabbitai bot left a 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, and confidence_ratio fields 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_deviation is narrowed to 0.4 for BTC/USD (lines 17–21) and CBBTC/USD (lines 22–26), diverging from the standard 0.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

📥 Commits

Reviewing files that changed from the base of the PR and between 62db803 and fa8e7ca.

📒 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 of early_update for stablecoins.

The previous early_update parameters for USDC/USD and USDT/USD have 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 minimal early_update setting.

… price has moved 0.9% or we've reached the 10 minute trigger
Copy link

@coderabbitai coderabbitai bot left a 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.
The time_difference, price_deviation, confidence_ratio, and early_update entries 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"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa8e7ca and d715736.

📒 Files selected for processing (1)
  • mainnet/pyth-price-pusher-config.yaml (1 hunks)

CryptoFewka and others added 3 commits May 12, 2025 18:07
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link

@coderabbitai coderabbitai bot left a 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 only alias, 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1050ad7 and c7a7c1b.

📒 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 apply time_difference: 600, appropriate price_deviation (0.9 for most, 0.4 for BTC), confidence_ratio: 1, and an early_update with 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

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.

4 participants