-
Notifications
You must be signed in to change notification settings - Fork 277
feat(pyth-lazer-protocol): add price request #2444
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
@@ -236,6 +243,17 @@ mod channel_ids { | |||
pub const FIXED_RATE_200: ChannelId = ChannelId(3); | |||
} | |||
|
|||
impl Display for Channel { |
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.
You could probably just use serde to serialize it as a string, which gets you the same result without a duplicate implementation.
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 looked into it but couldn't find a good way of handling it. If you want please give it a try and let me know if it worked.
@@ -21,6 +21,22 @@ pub struct LatestPriceRequest { | |||
pub channel: Channel, | |||
} | |||
|
|||
#[derive(Debug, Clone, Serialize, Deserialize)] | |||
#[serde(rename_all = "camelCase")] | |||
pub struct PriceRequest { |
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.
How is this API different from the LatestPrice API that router already has? Can we just extend it instead? Granted this is a little late to say it, but I am confused on the positioning of this API.
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.
Ah ok I see. We take in a timestamp to fetch the price for. Theoretically we could unify them but I guess that's not a big deal right now.
Summary
Changes needed to support price request (historical prices with signatures)
Rationale
Our users need this api
How has this been tested?
Manually tested the api