Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Hermes price streaming mode using Server-Sent Events (SSE), selectable via a new PRICE_FETCHING_METHOD config value, and refactors shared Hermes response parsing into a utility.
Changes:
- Introduces
priceSSEStream()to consume/v2/updates/price/streamand yieldPriceUpdates with retry/reconnect handling. - Adds
PRICE_FETCHING_METHOD(polling|sse) to CLI config parsing and documents it in the README. - Refactors Hermes response parsing into
parsePriceUpdate()and reuses it in both polling and SSE streams.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/price-stream/utils.ts | Adds shared Hermes HermesResponse → PriceUpdate parsing helper. |
| src/price-stream/price-sse-stream/price-sse-stream.ts | Implements SSE-based price stream with retry and Last-Event-ID support. |
| src/price-stream/price-sse-stream/price-sse-stream.test.ts | Adds comprehensive unit tests for SSE stream behavior. |
| src/price-stream/polling-price-stream/polling-price-stream.ts | Reuses shared parsing and improves JSON parse error handling; removes console noise. |
| src/price-stream/polling-price-stream/polling-price-stream.test.ts | Updates imports and removes log-detail test tied to removed logging. |
| src/hermes-client.ts | Adds logging for received price updates (applies to both polling and SSE). |
| src/cli-commands/command-config.ts | Adds PRICE_FETCHING_METHOD and switches producer factory based on it. |
| package.json / package-lock.json | Adds fetch-event-stream dependency for SSE parsing. |
| README.md | Documents PRICE_FETCHING_METHOD. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1d3bd64 to
d6fa9d1
Compare
baktun14
approved these changes
Mar 27, 2026
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.
Why
Ref AKA-175
What
PRICE_FETCHING_METHODvariable