From 235a205f6a880bb4b0c9266fc0b492f77c9154ac Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 21:24:46 +0000 Subject: [PATCH 1/8] feat: add configurable priority fee multiplier Co-Authored-By: Jayant Krishnamurthy --- apps/fortuna/src/chain/eth_gas_oracle.rs | 67 ++++++++++++++++++++---- apps/fortuna/src/chain/ethereum.rs | 3 +- apps/fortuna/src/config.rs | 8 +++ apps/fortuna/src/keeper.rs | 13 +++-- 4 files changed, 76 insertions(+), 15 deletions(-) diff --git a/apps/fortuna/src/chain/eth_gas_oracle.rs b/apps/fortuna/src/chain/eth_gas_oracle.rs index 869c00eab7..9249aaddae 100644 --- a/apps/fortuna/src/chain/eth_gas_oracle.rs +++ b/apps/fortuna/src/chain/eth_gas_oracle.rs @@ -39,11 +39,47 @@ pub const EIP1559_FEE_ESTIMATION_THRESHOLD_MAX_CHANGE: i64 = 200; #[must_use] pub struct EthProviderOracle { provider: M, + priority_fee_multiplier_pct: u64, } impl EthProviderOracle { - pub fn new(provider: M) -> Self { - Self { provider } + pub fn new(provider: M, priority_fee_multiplier_pct: u64) -> Self { + Self { + provider, + priority_fee_multiplier_pct, + } + } + + /// The default EIP-1559 fee estimator which is based on the work by [MyCrypto](https://github.com/MyCryptoHQ/MyCrypto/blob/master/src/services/ApiService/Gas/eip1559.ts) + pub fn eip1559_default_estimator( + &self, + base_fee_per_gas: U256, + rewards: Vec>, + ) -> (U256, U256) { + let max_priority_fee_per_gas = + if base_fee_per_gas < U256::from(EIP1559_FEE_ESTIMATION_PRIORITY_FEE_TRIGGER) { + U256::from(EIP1559_FEE_ESTIMATION_DEFAULT_PRIORITY_FEE) + } else { + std::cmp::max( + estimate_priority_fee(rewards), + U256::from(EIP1559_FEE_ESTIMATION_DEFAULT_PRIORITY_FEE), + ) + }; + + // Apply the multiplier to max_priority_fee_per_gas + let max_priority_fee_per_gas = max_priority_fee_per_gas + .checked_mul(U256::from(self.priority_fee_multiplier_pct)) + .unwrap_or(max_priority_fee_per_gas) + .checked_div(U256::from(100)) + .unwrap_or(max_priority_fee_per_gas); + + let potential_max_fee = base_fee_surged(base_fee_per_gas); + let max_fee_per_gas = if max_priority_fee_per_gas > potential_max_fee { + max_priority_fee_per_gas + potential_max_fee + } else { + potential_max_fee + }; + (max_fee_per_gas, max_priority_fee_per_gas) } } @@ -61,17 +97,29 @@ where } async fn estimate_eip1559_fees(&self) -> Result<(U256, U256)> { - self.provider - .estimate_eip1559_fees(Some(eip1559_default_estimator)) + let (max_fee_per_gas, max_priority_fee_per_gas) = self + .provider + .estimate_eip1559_fees(Some(estimate_base_fees)) .await - .map_err(|err| GasOracleError::ProviderError(Box::new(err))) + .map_err(|err| GasOracleError::ProviderError(Box::new(err)))?; + + // Apply the multiplier to max_priority_fee_per_gas + let max_priority_fee_per_gas = max_priority_fee_per_gas + .checked_mul(U256::from(self.priority_fee_multiplier_pct)) + .unwrap_or(max_priority_fee_per_gas) + .checked_div(U256::from(100)) + .unwrap_or(max_priority_fee_per_gas); + + // Recalculate max_fee_per_gas with the new priority fee + let max_fee_per_gas = std::cmp::max(max_fee_per_gas, max_priority_fee_per_gas); + + Ok((max_fee_per_gas, max_priority_fee_per_gas)) } } -/// The default EIP-1559 fee estimator which is based on the work by [MyCrypto](https://github.com/MyCryptoHQ/MyCrypto/blob/master/src/services/ApiService/Gas/eip1559.ts) -pub fn eip1559_default_estimator(base_fee_per_gas: U256, rewards: Vec>) -> (U256, U256) { +fn estimate_base_fees(base_fee: U256, rewards: Vec>) -> (U256, U256) { let max_priority_fee_per_gas = - if base_fee_per_gas < U256::from(EIP1559_FEE_ESTIMATION_PRIORITY_FEE_TRIGGER) { + if base_fee < U256::from(EIP1559_FEE_ESTIMATION_PRIORITY_FEE_TRIGGER) { U256::from(EIP1559_FEE_ESTIMATION_DEFAULT_PRIORITY_FEE) } else { std::cmp::max( @@ -79,7 +127,8 @@ pub fn eip1559_default_estimator(base_fee_per_gas: U256, rewards: Vec> U256::from(EIP1559_FEE_ESTIMATION_DEFAULT_PRIORITY_FEE), ) }; - let potential_max_fee = base_fee_surged(base_fee_per_gas); + + let potential_max_fee = base_fee_surged(base_fee); let max_fee_per_gas = if max_priority_fee_per_gas > potential_max_fee { max_priority_fee_per_gas + potential_max_fee } else { diff --git a/apps/fortuna/src/chain/ethereum.rs b/apps/fortuna/src/chain/ethereum.rs index f4f97a07df..be626523f0 100644 --- a/apps/fortuna/src/chain/ethereum.rs +++ b/apps/fortuna/src/chain/ethereum.rs @@ -211,7 +211,8 @@ impl SignablePythContractInner { provider: Provider, ) -> Result> { let chain_id = provider.get_chainid().await?; - let gas_oracle = EthProviderOracle::new(provider.clone()); + let gas_oracle = + EthProviderOracle::new(provider.clone(), chain_config.priority_fee_multiplier_pct); let wallet__ = private_key .parse::()? .with_chain_id(chain_id.as_u64()); diff --git a/apps/fortuna/src/config.rs b/apps/fortuna/src/config.rs index 87707aee20..45bf8569a0 100644 --- a/apps/fortuna/src/config.rs +++ b/apps/fortuna/src/config.rs @@ -166,6 +166,10 @@ pub struct EthereumConfig { /// Maximum number of hashes to record in a request. /// This should be set according to the maximum gas limit the provider supports for callbacks. pub max_num_hashes: Option, + + /// The percentage multiplier to apply to the priority fee (100 = no change, e.g. 150 = 150% of base fee) + #[serde(default = "default_priority_fee_multiplier_pct")] + pub priority_fee_multiplier_pct: u64, } /// A commitment that the provider used to generate random numbers at some point in the past. @@ -215,6 +219,10 @@ fn default_chain_sample_interval() -> u64 { 1 } +fn default_priority_fee_multiplier_pct() -> u64 { + 100 +} + /// Configuration values for the keeper service that are shared across chains. #[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] pub struct KeeperConfig { diff --git a/apps/fortuna/src/keeper.rs b/apps/fortuna/src/keeper.rs index b091d94fa8..4958d17661 100644 --- a/apps/fortuna/src/keeper.rs +++ b/apps/fortuna/src/keeper.rs @@ -2,7 +2,7 @@ use { crate::{ api::{self, BlockchainState, ChainId}, chain::{ - eth_gas_oracle::eip1559_default_estimator, + eth_gas_oracle::EthProviderOracle, ethereum::{ InstrumentedPythContract, InstrumentedSignablePythContract, PythContractCall, }, @@ -14,6 +14,7 @@ use { anyhow::{anyhow, Result}, backoff::ExponentialBackoff, ethers::{ + prelude::GasOracle, providers::{Middleware, Provider, Ws}, signers::Signer, types::{Address, U256}, @@ -1208,11 +1209,13 @@ pub async fn estimate_tx_cost( .try_into() .map_err(|e| anyhow!("gas price doesn't fit into 128 bits. error: {:?}", e))? } else { - let (max_fee_per_gas, max_priority_fee_per_gas) = middleware - .estimate_eip1559_fees(Some(eip1559_default_estimator)) - .await?; + let gas_oracle = EthProviderOracle::new(middleware.clone(), 100); + let (max_fee_per_gas, _) = gas_oracle + .estimate_eip1559_fees() + .await + .map_err(|e| anyhow!("Failed to estimate gas price: {}", e))?; - (max_fee_per_gas + max_priority_fee_per_gas) + max_fee_per_gas .try_into() .map_err(|e| anyhow!("gas price doesn't fit into 128 bits. error: {:?}", e))? }; From fbcac3791c7bccee8ea40111d66a1b9ccfb01dbf Mon Sep 17 00:00:00 2001 From: Jayant Krishnamurthy Date: Thu, 12 Dec 2024 14:25:27 -0800 Subject: [PATCH 2/8] hm --- apps/fortuna/src/chain/eth_gas_oracle.rs | 18 +++++------------- apps/fortuna/src/keeper.rs | 8 +++++--- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/apps/fortuna/src/chain/eth_gas_oracle.rs b/apps/fortuna/src/chain/eth_gas_oracle.rs index 9249aaddae..95712abebf 100644 --- a/apps/fortuna/src/chain/eth_gas_oracle.rs +++ b/apps/fortuna/src/chain/eth_gas_oracle.rs @@ -51,6 +51,7 @@ impl EthProviderOracle { } /// The default EIP-1559 fee estimator which is based on the work by [MyCrypto](https://github.com/MyCryptoHQ/MyCrypto/blob/master/src/services/ApiService/Gas/eip1559.ts) + /// with a configurable priority fee multiplier. pub fn eip1559_default_estimator( &self, base_fee_per_gas: U256, @@ -69,16 +70,17 @@ impl EthProviderOracle { // Apply the multiplier to max_priority_fee_per_gas let max_priority_fee_per_gas = max_priority_fee_per_gas .checked_mul(U256::from(self.priority_fee_multiplier_pct)) - .unwrap_or(max_priority_fee_per_gas) - .checked_div(U256::from(100)) + .and_then(|x| x.checked_div(U256::from(100))) .unwrap_or(max_priority_fee_per_gas); + // TODO: what does this logic do? let potential_max_fee = base_fee_surged(base_fee_per_gas); let max_fee_per_gas = if max_priority_fee_per_gas > potential_max_fee { max_priority_fee_per_gas + potential_max_fee } else { potential_max_fee }; + (max_fee_per_gas, max_priority_fee_per_gas) } } @@ -99,20 +101,10 @@ where async fn estimate_eip1559_fees(&self) -> Result<(U256, U256)> { let (max_fee_per_gas, max_priority_fee_per_gas) = self .provider - .estimate_eip1559_fees(Some(estimate_base_fees)) + .estimate_eip1559_fees(Some(|x, y| self.eip1559_default_estimator(x, y))) .await .map_err(|err| GasOracleError::ProviderError(Box::new(err)))?; - // Apply the multiplier to max_priority_fee_per_gas - let max_priority_fee_per_gas = max_priority_fee_per_gas - .checked_mul(U256::from(self.priority_fee_multiplier_pct)) - .unwrap_or(max_priority_fee_per_gas) - .checked_div(U256::from(100)) - .unwrap_or(max_priority_fee_per_gas); - - // Recalculate max_fee_per_gas with the new priority fee - let max_fee_per_gas = std::cmp::max(max_fee_per_gas, max_priority_fee_per_gas); - Ok((max_fee_per_gas, max_priority_fee_per_gas)) } } diff --git a/apps/fortuna/src/keeper.rs b/apps/fortuna/src/keeper.rs index 4958d17661..4eb21be717 100644 --- a/apps/fortuna/src/keeper.rs +++ b/apps/fortuna/src/keeper.rs @@ -1209,9 +1209,11 @@ pub async fn estimate_tx_cost( .try_into() .map_err(|e| anyhow!("gas price doesn't fit into 128 bits. error: {:?}", e))? } else { - let gas_oracle = EthProviderOracle::new(middleware.clone(), 100); - let (max_fee_per_gas, _) = gas_oracle - .estimate_eip1559_fees() + // This is not obvious but the implementation of estimate_eip1559_fees in ethers.rs + // for a middleware that has a GasOracleMiddleware inside is to ignore the passed-in callback + // and use whatever the gas oracle returns. + let (max_fee_per_gas, _) = middleware + .estimate_eip1559_fees(None) .await .map_err(|e| anyhow!("Failed to estimate gas price: {}", e))?; From 43bbc7a95db007e8dab167f450247a333535331e Mon Sep 17 00:00:00 2001 From: Jayant Krishnamurthy Date: Thu, 12 Dec 2024 14:32:04 -0800 Subject: [PATCH 3/8] fix this up a bit --- apps/fortuna/Cargo.lock | 2 +- apps/fortuna/Cargo.toml | 2 +- apps/fortuna/src/chain/eth_gas_oracle.rs | 52 +++++++----------------- apps/fortuna/src/keeper.rs | 2 - 4 files changed, 16 insertions(+), 42 deletions(-) diff --git a/apps/fortuna/Cargo.lock b/apps/fortuna/Cargo.lock index 941437cfdf..dcb4180ec8 100644 --- a/apps/fortuna/Cargo.lock +++ b/apps/fortuna/Cargo.lock @@ -1503,7 +1503,7 @@ dependencies = [ [[package]] name = "fortuna" -version = "6.5.5" +version = "6.6.0" dependencies = [ "anyhow", "axum", diff --git a/apps/fortuna/Cargo.toml b/apps/fortuna/Cargo.toml index ab898b4864..4a99a676c0 100644 --- a/apps/fortuna/Cargo.toml +++ b/apps/fortuna/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fortuna" -version = "6.5.5" +version = "6.6.0" edition = "2021" [dependencies] diff --git a/apps/fortuna/src/chain/eth_gas_oracle.rs b/apps/fortuna/src/chain/eth_gas_oracle.rs index 95712abebf..a72ea1e17d 100644 --- a/apps/fortuna/src/chain/eth_gas_oracle.rs +++ b/apps/fortuna/src/chain/eth_gas_oracle.rs @@ -49,40 +49,6 @@ impl EthProviderOracle { priority_fee_multiplier_pct, } } - - /// The default EIP-1559 fee estimator which is based on the work by [MyCrypto](https://github.com/MyCryptoHQ/MyCrypto/blob/master/src/services/ApiService/Gas/eip1559.ts) - /// with a configurable priority fee multiplier. - pub fn eip1559_default_estimator( - &self, - base_fee_per_gas: U256, - rewards: Vec>, - ) -> (U256, U256) { - let max_priority_fee_per_gas = - if base_fee_per_gas < U256::from(EIP1559_FEE_ESTIMATION_PRIORITY_FEE_TRIGGER) { - U256::from(EIP1559_FEE_ESTIMATION_DEFAULT_PRIORITY_FEE) - } else { - std::cmp::max( - estimate_priority_fee(rewards), - U256::from(EIP1559_FEE_ESTIMATION_DEFAULT_PRIORITY_FEE), - ) - }; - - // Apply the multiplier to max_priority_fee_per_gas - let max_priority_fee_per_gas = max_priority_fee_per_gas - .checked_mul(U256::from(self.priority_fee_multiplier_pct)) - .and_then(|x| x.checked_div(U256::from(100))) - .unwrap_or(max_priority_fee_per_gas); - - // TODO: what does this logic do? - let potential_max_fee = base_fee_surged(base_fee_per_gas); - let max_fee_per_gas = if max_priority_fee_per_gas > potential_max_fee { - max_priority_fee_per_gas + potential_max_fee - } else { - potential_max_fee - }; - - (max_fee_per_gas, max_priority_fee_per_gas) - } } #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] @@ -101,17 +67,25 @@ where async fn estimate_eip1559_fees(&self) -> Result<(U256, U256)> { let (max_fee_per_gas, max_priority_fee_per_gas) = self .provider - .estimate_eip1559_fees(Some(|x, y| self.eip1559_default_estimator(x, y))) + .estimate_eip1559_fees(Some(eip1559_default_estimator)) .await .map_err(|err| GasOracleError::ProviderError(Box::new(err)))?; + // Apply the multiplier to max_priority_fee_per_gas + let max_priority_fee_per_gas = max_priority_fee_per_gas + .checked_mul(U256::from(self.priority_fee_multiplier_pct)) + .and_then(|x| x.checked_div(U256::from(100))) + .unwrap_or(max_priority_fee_per_gas); + Ok((max_fee_per_gas, max_priority_fee_per_gas)) } } -fn estimate_base_fees(base_fee: U256, rewards: Vec>) -> (U256, U256) { +/// The default EIP-1559 fee estimator which is based on the work by [MyCrypto](https://github.com/MyCryptoHQ/MyCrypto/blob/master/src/services/ApiService/Gas/eip1559.ts) +/// with a configurable priority fee multiplier. +pub fn eip1559_default_estimator(base_fee_per_gas: U256, rewards: Vec>) -> (U256, U256) { let max_priority_fee_per_gas = - if base_fee < U256::from(EIP1559_FEE_ESTIMATION_PRIORITY_FEE_TRIGGER) { + if base_fee_per_gas < U256::from(EIP1559_FEE_ESTIMATION_PRIORITY_FEE_TRIGGER) { U256::from(EIP1559_FEE_ESTIMATION_DEFAULT_PRIORITY_FEE) } else { std::cmp::max( @@ -120,12 +94,14 @@ fn estimate_base_fees(base_fee: U256, rewards: Vec>) -> (U256, U256) { ) }; - let potential_max_fee = base_fee_surged(base_fee); + // TODO: what does this logic do? + let potential_max_fee = base_fee_surged(base_fee_per_gas); let max_fee_per_gas = if max_priority_fee_per_gas > potential_max_fee { max_priority_fee_per_gas + potential_max_fee } else { potential_max_fee }; + (max_fee_per_gas, max_priority_fee_per_gas) } diff --git a/apps/fortuna/src/keeper.rs b/apps/fortuna/src/keeper.rs index 4eb21be717..c71d72e958 100644 --- a/apps/fortuna/src/keeper.rs +++ b/apps/fortuna/src/keeper.rs @@ -2,7 +2,6 @@ use { crate::{ api::{self, BlockchainState, ChainId}, chain::{ - eth_gas_oracle::EthProviderOracle, ethereum::{ InstrumentedPythContract, InstrumentedSignablePythContract, PythContractCall, }, @@ -14,7 +13,6 @@ use { anyhow::{anyhow, Result}, backoff::ExponentialBackoff, ethers::{ - prelude::GasOracle, providers::{Middleware, Provider, Ws}, signers::Signer, types::{Address, U256}, From 20e96cbda534f520687984c8f8860fe36fa3cf14 Mon Sep 17 00:00:00 2001 From: Jayant Krishnamurthy Date: Thu, 12 Dec 2024 14:33:29 -0800 Subject: [PATCH 4/8] fix this up a bit --- apps/fortuna/src/chain/eth_gas_oracle.rs | 2 -- apps/fortuna/src/keeper.rs | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/fortuna/src/chain/eth_gas_oracle.rs b/apps/fortuna/src/chain/eth_gas_oracle.rs index a72ea1e17d..4035f99b0b 100644 --- a/apps/fortuna/src/chain/eth_gas_oracle.rs +++ b/apps/fortuna/src/chain/eth_gas_oracle.rs @@ -82,7 +82,6 @@ where } /// The default EIP-1559 fee estimator which is based on the work by [MyCrypto](https://github.com/MyCryptoHQ/MyCrypto/blob/master/src/services/ApiService/Gas/eip1559.ts) -/// with a configurable priority fee multiplier. pub fn eip1559_default_estimator(base_fee_per_gas: U256, rewards: Vec>) -> (U256, U256) { let max_priority_fee_per_gas = if base_fee_per_gas < U256::from(EIP1559_FEE_ESTIMATION_PRIORITY_FEE_TRIGGER) { @@ -94,7 +93,6 @@ pub fn eip1559_default_estimator(base_fee_per_gas: U256, rewards: Vec> ) }; - // TODO: what does this logic do? let potential_max_fee = base_fee_surged(base_fee_per_gas); let max_fee_per_gas = if max_priority_fee_per_gas > potential_max_fee { max_priority_fee_per_gas + potential_max_fee diff --git a/apps/fortuna/src/keeper.rs b/apps/fortuna/src/keeper.rs index c71d72e958..7c356b3423 100644 --- a/apps/fortuna/src/keeper.rs +++ b/apps/fortuna/src/keeper.rs @@ -1210,12 +1210,12 @@ pub async fn estimate_tx_cost( // This is not obvious but the implementation of estimate_eip1559_fees in ethers.rs // for a middleware that has a GasOracleMiddleware inside is to ignore the passed-in callback // and use whatever the gas oracle returns. - let (max_fee_per_gas, _) = middleware + let (max_fee_per_gas, max_priority_fee_per_gas) = middleware .estimate_eip1559_fees(None) .await .map_err(|e| anyhow!("Failed to estimate gas price: {}", e))?; - max_fee_per_gas + (max_fee_per_gas + max_priority_fee_per_gas) .try_into() .map_err(|e| anyhow!("gas price doesn't fit into 128 bits. error: {:?}", e))? }; From d43a9521ab21036a67d254b2dcb66e8d306bbfb4 Mon Sep 17 00:00:00 2001 From: Jayant Krishnamurthy Date: Thu, 12 Dec 2024 14:34:13 -0800 Subject: [PATCH 5/8] fix this up a bit --- apps/fortuna/src/keeper.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/fortuna/src/keeper.rs b/apps/fortuna/src/keeper.rs index 7c356b3423..3370b4b48b 100644 --- a/apps/fortuna/src/keeper.rs +++ b/apps/fortuna/src/keeper.rs @@ -1212,8 +1212,7 @@ pub async fn estimate_tx_cost( // and use whatever the gas oracle returns. let (max_fee_per_gas, max_priority_fee_per_gas) = middleware .estimate_eip1559_fees(None) - .await - .map_err(|e| anyhow!("Failed to estimate gas price: {}", e))?; + .await? (max_fee_per_gas + max_priority_fee_per_gas) .try_into() From 09c7656a2cc484dadfb7c930aa9f9d0f32bdcc3e Mon Sep 17 00:00:00 2001 From: Jayant Krishnamurthy Date: Thu, 12 Dec 2024 14:37:15 -0800 Subject: [PATCH 6/8] fix this up a bit --- apps/fortuna/src/keeper.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/fortuna/src/keeper.rs b/apps/fortuna/src/keeper.rs index 3370b4b48b..33004f1b5b 100644 --- a/apps/fortuna/src/keeper.rs +++ b/apps/fortuna/src/keeper.rs @@ -1212,7 +1212,7 @@ pub async fn estimate_tx_cost( // and use whatever the gas oracle returns. let (max_fee_per_gas, max_priority_fee_per_gas) = middleware .estimate_eip1559_fees(None) - .await? + .await?; (max_fee_per_gas + max_priority_fee_per_gas) .try_into() From d8c1862f25c41b69d61c74c21c78beba7db3c958 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 22:47:45 +0000 Subject: [PATCH 7/8] chore: fix rust formatting Co-Authored-By: Jayant Krishnamurthy --- apps/fortuna/src/keeper.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/fortuna/src/keeper.rs b/apps/fortuna/src/keeper.rs index 33004f1b5b..172012b2c6 100644 --- a/apps/fortuna/src/keeper.rs +++ b/apps/fortuna/src/keeper.rs @@ -1210,9 +1210,8 @@ pub async fn estimate_tx_cost( // This is not obvious but the implementation of estimate_eip1559_fees in ethers.rs // for a middleware that has a GasOracleMiddleware inside is to ignore the passed-in callback // and use whatever the gas oracle returns. - let (max_fee_per_gas, max_priority_fee_per_gas) = middleware - .estimate_eip1559_fees(None) - .await?; + let (max_fee_per_gas, max_priority_fee_per_gas) = + middleware.estimate_eip1559_fees(None).await?; (max_fee_per_gas + max_priority_fee_per_gas) .try_into() From 14e0ca0dde5c479bc7d58e8944fda3e14b862977 Mon Sep 17 00:00:00 2001 From: Jayant Krishnamurthy Date: Thu, 12 Dec 2024 20:05:57 -0800 Subject: [PATCH 8/8] sample --- apps/fortuna/config.sample.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/fortuna/config.sample.yaml b/apps/fortuna/config.sample.yaml index 74231be6a9..73ffe3da5a 100644 --- a/apps/fortuna/config.sample.yaml +++ b/apps/fortuna/config.sample.yaml @@ -12,6 +12,10 @@ chains: # How much to charge in fees fee: 1500000000000000 + # Multiplier for the priority fee estimate, as a percentage (i.e., 100 = no change). + # Defaults to 100 if the field is omitted. + priority_fee_multiplier_pct: 100 + # Configuration for dynamic fees under high gas prices. The keeper will set # on-chain fees to make between [min_profit_pct, max_profit_pct] of the max callback # cost in profit per transaction.