diff --git a/services/rfq/relayer/relconfig/config.go b/services/rfq/relayer/relconfig/config.go index b7b34552ba..36614772d0 100644 --- a/services/rfq/relayer/relconfig/config.go +++ b/services/rfq/relayer/relconfig/config.go @@ -95,9 +95,9 @@ type ChainConfig struct { // Note that this parameter is applied on a chain level and must be positive. QuoteWidthBps float64 `yaml:"quote_width_bps"` // QuoteFixedFeeMultiplier is the multiplier for the fixed fee, applied when generating quotes. - QuoteFixedFeeMultiplier float64 `yaml:"quote_fixed_fee_multiplier"` + QuoteFixedFeeMultiplier *float64 `yaml:"quote_fixed_fee_multiplier"` // RelayFixedFeeMultiplier is the multiplier for the fixed fee, applied when relaying. - RelayFixedFeeMultiplier float64 `yaml:"relay_fixed_fee_multiplier"` + RelayFixedFeeMultiplier *float64 `yaml:"relay_fixed_fee_multiplier"` // CCTP start block is the block at which the chain listener will listen for CCTP events. CCTPStartBlock uint64 `yaml:"cctp_start_block"` } diff --git a/services/rfq/relayer/relconfig/config_test.go b/services/rfq/relayer/relconfig/config_test.go index ecf0ce4d13..4fab53e556 100644 --- a/services/rfq/relayer/relconfig/config_test.go +++ b/services/rfq/relayer/relconfig/config_test.go @@ -33,7 +33,7 @@ func TestChainGetters(t *testing.T) { MinGasToken: "1000", QuotePct: relconfig.NewFloat64Pointer(0), QuoteWidthBps: 10, - QuoteFixedFeeMultiplier: 1.1, + QuoteFixedFeeMultiplier: relconfig.NewFloat64Pointer(1.1), }, }, BaseChainConfig: relconfig.ChainConfig{ @@ -51,7 +51,7 @@ func TestChainGetters(t *testing.T) { MinGasToken: "1001", QuotePct: relconfig.NewFloat64Pointer(51), QuoteWidthBps: 11, - QuoteFixedFeeMultiplier: 1.2, + QuoteFixedFeeMultiplier: relconfig.NewFloat64Pointer(1.2), }, } cfg := relconfig.Config{ @@ -71,7 +71,7 @@ func TestChainGetters(t *testing.T) { MinGasToken: "1000", QuotePct: relconfig.NewFloat64Pointer(50), QuoteWidthBps: 10, - QuoteFixedFeeMultiplier: 1.1, + QuoteFixedFeeMultiplier: relconfig.NewFloat64Pointer(1.1), Tokens: map[string]relconfig.TokenConfig{ "USDC": { Address: usdcAddr, @@ -282,15 +282,15 @@ func TestChainGetters(t *testing.T) { t.Run("GetQuoteFixedFeeMultiplier", func(t *testing.T) { defaultVal, err := cfg.GetQuoteFixedFeeMultiplier(badChainID) assert.NoError(t, err) - assert.Equal(t, defaultVal, relconfig.DefaultChainConfig.QuoteFixedFeeMultiplier) + assert.Equal(t, defaultVal, *relconfig.DefaultChainConfig.QuoteFixedFeeMultiplier) baseVal, err := cfgWithBase.GetQuoteFixedFeeMultiplier(badChainID) assert.NoError(t, err) - assert.Equal(t, baseVal, cfgWithBase.BaseChainConfig.QuoteFixedFeeMultiplier) + assert.Equal(t, baseVal, *cfgWithBase.BaseChainConfig.QuoteFixedFeeMultiplier) chainVal, err := cfgWithBase.GetQuoteFixedFeeMultiplier(chainID) assert.NoError(t, err) - assert.Equal(t, chainVal, cfgWithBase.Chains[chainID].QuoteFixedFeeMultiplier) + assert.Equal(t, chainVal, *cfgWithBase.Chains[chainID].QuoteFixedFeeMultiplier) }) t.Run("GetMaxRebalanceAmount", func(t *testing.T) { @@ -322,7 +322,7 @@ func TestGetQuoteOffset(t *testing.T) { MinGasToken: "1000", QuotePct: relconfig.NewFloat64Pointer(50), QuoteWidthBps: 10, - QuoteFixedFeeMultiplier: 1.1, + QuoteFixedFeeMultiplier: relconfig.NewFloat64Pointer(1.1), Tokens: map[string]relconfig.TokenConfig{ "USDC": { Address: usdcAddr, diff --git a/services/rfq/relayer/relconfig/getters.go b/services/rfq/relayer/relconfig/getters.go index 578fa741e6..818dd7fa85 100644 --- a/services/rfq/relayer/relconfig/getters.go +++ b/services/rfq/relayer/relconfig/getters.go @@ -19,8 +19,8 @@ var DefaultChainConfig = ChainConfig{ MinGasToken: "100000000000000000", // 1 ETH QuotePct: NewFloat64Pointer(100), QuoteWidthBps: 0, - QuoteFixedFeeMultiplier: 1, - RelayFixedFeeMultiplier: 1, + QuoteFixedFeeMultiplier: NewFloat64Pointer(1), + RelayFixedFeeMultiplier: NewFloat64Pointer(1), } // NewFloat64Pointer returns a pointer to a float64. @@ -344,7 +344,7 @@ func (c Config) GetQuoteFixedFeeMultiplier(chainID int) (value float64, err erro return value, fmt.Errorf("failed to cast QuoteFixedFeeMultiplier to int") } if value <= 0 { - value = DefaultChainConfig.QuoteFixedFeeMultiplier + value = *DefaultChainConfig.QuoteFixedFeeMultiplier } return value, nil }