-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat(api): add Raydium price fetcher cache warmup for symbols #390
Conversation
nft_ingester/src/api/service.rs
Outdated
@@ -111,6 +111,20 @@ pub async fn start_api( | |||
} | |||
|
|||
let addr = SocketAddr::from(([0, 0, 0, 0], port)); | |||
let token_price_fetcher = Arc::new(RaydiumTokenPriceFetcher::new( | |||
"https://api-v3.raydium.io".to_string(), |
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.
nit: I'd like to see it as a constant
c6c3a95
to
39c0457
Compare
pub async fn warmup(&self) -> Result<(), IngesterError> { | ||
#[derive(serde::Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
struct MintListItem { |
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.
Why do we want a declaration of structs inside a function? Does it do something useful?
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.
the struct is single-use and used to deserialize only one particular response for one particular function, to me it looks logical & so much better than .get("field")
used previously
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.
Left nit comments. CI is failing though. lgtm in general
ed93329
to
d8beac4
Compare
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.
looks good
No description provided.