diff --git a/core/bin/zksync_api/src/fee_ticker/mod.rs b/core/bin/zksync_api/src/fee_ticker/mod.rs index ff45889d9f..7f6dac0811 100644 --- a/core/bin/zksync_api/src/fee_ticker/mod.rs +++ b/core/bin/zksync_api/src/fee_ticker/mod.rs @@ -192,6 +192,7 @@ pub struct TickerConfig { gas_cost_tx: GasOperationsCost, tokens_risk_factors: HashMap>, not_subsidized_tokens: HashSet
, + scale_fee_coefficient: Ratio, } #[derive(Debug, PartialEq, Eq)] @@ -356,6 +357,10 @@ pub fn run_ticker_task( gas_cost_tx: GasOperationsCost::from_constants(config.ticker.fast_processing_coeff), tokens_risk_factors: HashMap::new(), not_subsidized_tokens: HashSet::from_iter(config.ticker.not_subsidized_tokens.clone()), + scale_fee_coefficient: Ratio::new( + BigUint::from(config.ticker.scale_fee_percent), + BigUint::from(100u32), + ), }; let cache = (db_pool.clone(), TokenDBCache::new()); @@ -538,6 +543,7 @@ impl FeeTicker FeeTicker TickerConfig { ] .into_iter() .collect(), + scale_fee_coefficient: Ratio::new(BigUint::from(150u32), BigUint::from(100u32)), } } diff --git a/core/lib/config/src/configs/ticker.rs b/core/lib/config/src/configs/ticker.rs index 3ccabe6dfb..7de6324846 100644 --- a/core/lib/config/src/configs/ticker.rs +++ b/core/lib/config/src/configs/ticker.rs @@ -24,6 +24,8 @@ pub struct TickerConfig { pub coinmarketcap_base_url: String, /// URL of CoinGecko API. Can be set to the mock server for local development. pub coingecko_base_url: String, + /// Coefficient for scaling all fees in percent. + pub scale_fee_percent: u32, /// Coefficient for the fee price for fast withdrawal requests. pub fast_processing_coeff: f64, /// Url to uniswap api @@ -90,6 +92,7 @@ mod tests { token_price_source: TokenPriceSource::CoinGecko, coinmarketcap_base_url: "http://127.0.0.1:9876".into(), coingecko_base_url: "http://127.0.0.1:9876".into(), + scale_fee_percent: 100, fast_processing_coeff: 10.0f64, uniswap_url: "http://127.0.0.1:9975/graphql".to_string(), liquidity_volume: 100.0, @@ -122,6 +125,7 @@ FEE_TICKER_LIQUIDITY_VOLUME=100 FEE_TICKER_NUMBER_OF_TICKER_ACTORS="4" FEE_TICKER_SUBSIDIZED_TOKENS="0x0bc529c00c6401aef6d220be8c6ea1667f6ad93e" FEE_TICKER_SUBSIDIZED_TOKENS_LIMITS=156 +FEE_TICKER_SCALE_FEE_PERCENT=100 "#; set_env(config); diff --git a/etc/env/base/fee_ticker.toml b/etc/env/base/fee_ticker.toml index 440b604739..7aee02faa0 100644 --- a/etc/env/base/fee_ticker.toml +++ b/etc/env/base/fee_ticker.toml @@ -29,3 +29,4 @@ not_subsidized_tokens=[ subsidized_tokens=[] subsidized_tokens_limits=[] +scale_fee_percent=100