-
Notifications
You must be signed in to change notification settings - Fork 305
feat(pyth-evm-js): add transaction filler for automatic Pyth price data bundling #2808
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
Closed
devin-ai-integration
wants to merge
4
commits into
main
from
devin/1750843777-pyth-transaction-filling
Closed
feat(pyth-evm-js): add transaction filler for automatic Pyth price data bundling #2808
devin-ai-integration
wants to merge
4
commits into
main
from
devin/1750843777-pyth-transaction-filling
Conversation
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
…ta bundling - Add TransactionFiller class and fillTransactionWithPythData function - Support automatic detection of Pyth getPrice* method calls via transaction tracing - Extract price feed IDs from trace results and fetch updates from Hermes - Bundle price updates with original transaction using multicall - Iterative approach to handle nested price feed dependencies - Include comprehensive example and documentation - Bump package version to 1.84.0 Co-Authored-By: Ali <[email protected]>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 8 Skipped Deployments
|
This fixes CI failures caused by outdated lockfile that was missing the viem dependency added to the pyth-evm-js package.json Co-Authored-By: Ali <[email protected]>
This fixes CI test failures caused by formatting issues in: - src/TransactionFiller.ts - src/examples/TransactionFillerExample.ts Co-Authored-By: Ali <[email protected]>
…e feed detection - Fix mock trace implementation to detect accountLiquidity transactions (0xa824bf67) - Simulate realistic nested calls to Pyth contract with multiple price feeds - Remove request method from mock client to use fallback trace logic - Now correctly detects 3 price feeds instead of 0 in example Co-Authored-By: Ali <[email protected]>
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.
Add Transaction Filler for Automatic Pyth Price Data Bundling
Summary
This PR extends the Pyth EVM JS SDK to support automatic transaction filling with Pyth price data. The new functionality detects Pyth
getPrice*method calls in transactions using trace calls, extracts price feed IDs, fetches updates from the Hermes price service, and bundles them with the original transaction using multicall.Key Features
debug_traceCallto detect Pyth price feed usage in transactionsgetPrice*method callsfillTransactionWithPythData) and class-based (TransactionFiller) approachesDetected Methods
The implementation automatically detects these Pyth methods:
getPrice(bytes32 id)getPriceUnsafe(bytes32 id)getPriceNoOlderThan(bytes32 id, uint256 age)getEmaPrice(bytes32 id)getEmaPriceUnsafe(bytes32 id)getEmaPriceNoOlderThan(bytes32 id, uint256 age)Usage Example
Files Added/Modified
src/TransactionFiller.ts- Main implementation with TransactionFiller class and utility functionssrc/examples/TransactionFillerExample.ts- Comprehensive example demonstrating usagesrc/index.ts- Export new functionalitypackage.json- Add viem dependency and example script, bump version to 1.84.0README_TRANSACTION_FILLER.md- Detailed documentationTesting Transparency
What I Actually Checked
✅ Lint and Format: All ESLint warnings fixed, pre-commit hooks pass
✅ Build Success: TypeScript compilation successful with
pnpm run build✅ Example Execution: Successfully ran
pnpm run example-transaction-filler✅ Mock Trace Logic: Verified trace parsing and price feed extraction logic
✅ API Consistency: Both functional and class-based APIs work correctly
✅ Error Handling: Graceful handling of failed trace calls and missing price feeds
What I Did Not Check
❌ Real Network Integration: Did not test with actual blockchain trace calls (used mock implementation)
❌ Hermes Service Integration: Did not test actual price update fetching from live Hermes endpoint
❌ Multicall Contract Interaction: Did not verify actual multicall transaction execution
❌ Edge Cases: Did not test with complex nested transaction scenarios
❌ Performance: Did not test with large numbers of price feeds or iterations
Implementation Notes
Reviewer Checklist
pnpm run example-transaction-fillerpnpm run fix:lintpnpm run buildLink to Devin run: https://app.devin.ai/sessions/13fbfcfa51014db0ac022798616aaf67
Requested by: Ali ([email protected])