Skip to content

Commit

Permalink
fix(fee_ticker): do not retrieve market volume for RBTC, RDOC, USDRIF
Browse files Browse the repository at this point in the history
  • Loading branch information
antomor committed Oct 20, 2023
1 parent 9769cf1 commit 8ef8150
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion core/bin/zksync_api/src/fee_ticker/validator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use std::{
use bigdecimal::BigDecimal;
use chrono::Utc;

use itertools::Itertools;
// Workspace uses
use zksync_types::{
tokens::{Token, TokenLike, TokenMarketVolume},
Expand Down Expand Up @@ -73,10 +74,19 @@ impl<W: TokenWatcher> MarketUpdater<W> {
pub async fn keep_updated(mut self, duration_secs: u64) {
let mut error_counter = 0;

// Market volume is not available for these tokens and
// we don't need it because they're added among the unconditionally_valid_tokens
let unavailable_market_volume_tokens = ["RDOC", "RBTC", "USDRIF"];
loop {
let tokens = self.tokens_cache.get_all_tokens().await;
let result = match tokens {
Ok(tokens) => self.update_all_tokens(tokens).await,
Ok(tokens) => self.update_all_tokens(
tokens
.into_iter()
.filter(|token|
!unavailable_market_volume_tokens.contains(&token.symbol.as_str())
).collect_vec(),
).await,
Err(e) => Err(e),
};

Expand Down

0 comments on commit 8ef8150

Please sign in to comment.