Skip to content
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

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

armyhaylenko
Copy link
Collaborator

No description provided.

@@ -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(),
Copy link
Contributor

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

@armyhaylenko armyhaylenko force-pushed the feat/MTG-1257-add-raydium-cache-warmup branch from c6c3a95 to 39c0457 Compare January 28, 2025 12:52
pub async fn warmup(&self) -> Result<(), IngesterError> {
#[derive(serde::Deserialize)]
#[serde(rename_all = "camelCase")]
struct MintListItem {
Copy link
Contributor

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?

Copy link
Collaborator Author

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

Copy link
Contributor

@kstepanovdev kstepanovdev left a 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

@armyhaylenko armyhaylenko force-pushed the feat/MTG-1257-add-raydium-cache-warmup branch from ed93329 to d8beac4 Compare January 28, 2025 13:14
Copy link
Contributor

@andrii-kl andrii-kl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@armyhaylenko armyhaylenko merged commit e9777ab into main Jan 28, 2025
2 checks passed
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