-
Notifications
You must be signed in to change notification settings - Fork 218
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
[TWAP] Update Hermes binary response format, add TwapMessage parsing to price-service-sdk #2158
Conversation
…sing to price-service-sdk
…b/price-service-sdk/add-twap-parsing
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
|
||
test("Parse TWAP message", () => { | ||
// Sample data from the Hermes latest TWAP endpoint. | ||
const test_accumulator_data_twap = |
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.
I'd use camelcase or caps here
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.
woops, too much python & rust
); | ||
expect(twapMessage1.cumulativePrice.toString()).toBe("1760238576144013"); | ||
expect(twapMessage1.cumulativeConf.toString()).toBe("5113466755162"); | ||
expect(twapMessage1.numDownSlots.toString()).toBe("72037403"); |
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.
big numDownSlots
here since stocks stop trading every night
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.
LGTM!
…to price-service-sdk (pyth-network#2158) * feat: change hermes twap binary response, add twap data model and parsing to price-service-sdk * feat: reexport parseTwapMessage * test: add parse twap msg test * test: update parse twap test * refactor: pack both start & end updatedatas into a single binaryupdate * refactor: snake -> camel case
Update the Hermes binary output for the
/twap/:window_seconds/latest
endpoint for better efficiency and usability.Add TwapMessage parsing support to the Price Service SDK. This will be used by the Solana Receiver SDK when handling binary TwapMessages from Hermes, similar to how PriceFeedMessages are currently being parsed and used.