Skip to content

Conversation

@Riateche
Copy link
Contributor

@Riateche Riateche commented Aug 7, 2025

Summary

Some improvements for pyth-lazer-protocol crate. Commit-by-commit reading is recommended.

  • Make Price and Rate method names more verbose. Replace trait implementations with methods where the semantics of trait implementations are ambiguous.
  • Support proper (non-inverted) exponent values in Price and Rate APIs. Change exponent type to i16. Implement operations with positive exponents (we don't really need them but why not).
  • Add some tests for Price and Rate.
  • Restructure modules:
    • Move Price and Rate to separate modules and reexport them at crate root.
    • Merge api, router, subscription modules into api. Rename subscription::{Request, Response} to api::{WsRequest, WsResponse}.
    • Move PublisherId, PriceFeedId, ChannelId, PriceFeedProperty to crate root. They are not bound to a particular API.
    • Move FixedRate to time module.
  • Some comments and small improvements.

Rationale

Code quality improvement.

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

@vercel
Copy link

vercel bot commented Aug 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2025 4:05pm
component-library ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2025 4:05pm
developer-hub ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2025 4:05pm
entropy-debugger ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2025 4:05pm
entropy-explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2025 4:05pm
insights ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2025 4:05pm
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2025 4:05pm
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2025 4:05pm

@Riateche Riateche merged commit 1101ad2 into main Aug 8, 2025
11 checks passed
@Riateche Riateche deleted the price-improve branch August 8, 2025 09:35
danimhr added a commit that referenced this pull request Aug 12, 2025
danimhr added a commit that referenced this pull request Aug 12, 2025
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.

3 participants