code.vegaprotocol.io/vega@v0.79.0/core/integration/setup_test.go (about)

     1  // Copyright (C) 2023 Gobalsky Labs Limited
     2  //
     3  // This program is free software: you can redistribute it and/or modify
     4  // it under the terms of the GNU Affero General Public License as
     5  // published by the Free Software Foundation, either version 3 of the
     6  // License, or (at your option) any later version.
     7  //
     8  // This program is distributed in the hope that it will be useful,
     9  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    10  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    11  // GNU Affero General Public License for more details.
    12  //
    13  // You should have received a copy of the GNU Affero General Public License
    14  // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    15  
    16  package core_test
    17  
    18  import (
    19  	"context"
    20  	"fmt"
    21  	"os"
    22  
    23  	"code.vegaprotocol.io/vega/core/activitystreak"
    24  	"code.vegaprotocol.io/vega/core/banking"
    25  	bmocks "code.vegaprotocol.io/vega/core/broker/mocks"
    26  	"code.vegaprotocol.io/vega/core/collateral"
    27  	"code.vegaprotocol.io/vega/core/datasource/spec"
    28  	"code.vegaprotocol.io/vega/core/delegation"
    29  	"code.vegaprotocol.io/vega/core/epochtime"
    30  	"code.vegaprotocol.io/vega/core/evtforward"
    31  	"code.vegaprotocol.io/vega/core/execution"
    32  	"code.vegaprotocol.io/vega/core/execution/common"
    33  	"code.vegaprotocol.io/vega/core/integration/helpers"
    34  	"code.vegaprotocol.io/vega/core/integration/steps/market"
    35  	referralcfg "code.vegaprotocol.io/vega/core/integration/steps/referral"
    36  	"code.vegaprotocol.io/vega/core/integration/stubs"
    37  	"code.vegaprotocol.io/vega/core/netparams"
    38  	"code.vegaprotocol.io/vega/core/notary"
    39  	"code.vegaprotocol.io/vega/core/parties"
    40  	"code.vegaprotocol.io/vega/core/plugins"
    41  	"code.vegaprotocol.io/vega/core/referral"
    42  	"code.vegaprotocol.io/vega/core/rewards"
    43  	"code.vegaprotocol.io/vega/core/teams"
    44  	"code.vegaprotocol.io/vega/core/types"
    45  	"code.vegaprotocol.io/vega/core/validators"
    46  	"code.vegaprotocol.io/vega/core/vesting"
    47  	"code.vegaprotocol.io/vega/core/volumediscount"
    48  	"code.vegaprotocol.io/vega/core/volumerebate"
    49  	"code.vegaprotocol.io/vega/libs/num"
    50  	"code.vegaprotocol.io/vega/logging"
    51  	protos "code.vegaprotocol.io/vega/protos/vega"
    52  
    53  	"github.com/golang/mock/gomock"
    54  )
    55  
    56  var (
    57  	execsetup *executionTestSetup
    58  	reporter  tstReporter
    59  )
    60  
    61  type tstReporter struct {
    62  	scenario string
    63  }
    64  
    65  func (t tstReporter) Errorf(format string, args ...interface{}) {
    66  	fmt.Printf("%s ERROR: %s", t.scenario, fmt.Sprintf(format, args...))
    67  }
    68  
    69  func (t tstReporter) Fatalf(format string, args ...interface{}) {
    70  	fmt.Printf("%s FATAL: %s", t.scenario, fmt.Sprintf(format, args...))
    71  	os.Exit(1)
    72  }
    73  
    74  type DummyDelayTarget struct{}
    75  
    76  func (*DummyDelayTarget) MarketDelayRequiredUpdated(marketID string, required bool) {}
    77  
    78  type DummyASVM struct{}
    79  
    80  func (DummyASVM) GetRewardsVestingMultiplier(_ string) num.Decimal {
    81  	return num.MustDecimalFromString("0.01")
    82  }
    83  
    84  var (
    85  	marketConfig          = market.NewMarketConfig()
    86  	referralProgramConfig = referralcfg.NewReferralProgramConfig()
    87  	volumeDiscountTiers   = map[string][]*types.VolumeBenefitTier{}
    88  	volumeRebateTiers     = map[string][]*types.VolumeRebateBenefitTier{}
    89  )
    90  
    91  type executionTestSetup struct {
    92  	cfg              execution.Config
    93  	log              *logging.Logger
    94  	ctrl             *gomock.Controller
    95  	timeService      *stubs.TimeStub
    96  	broker           *stubs.BrokerStub
    97  	executionEngine  *exEng
    98  	collateralEngine *collateral.Engine
    99  	oracleEngine     *spec.Engine
   100  	builtinOracle    *spec.Builtin
   101  	epochEngine      *epochtime.Svc
   102  	delegationEngine *delegation.Engine
   103  	positionPlugin   *plugins.Positions
   104  	topology         *stubs.TopologyStub
   105  	stakingAccount   *stubs.StakingAccountStub
   106  	rewardsEngine    *rewards.Engine
   107  	assetsEngine     *stubs.AssetStub
   108  	banking          *banking.Engine
   109  
   110  	// save party accounts state
   111  	markets []types.Market
   112  
   113  	block *helpers.Block
   114  
   115  	netParams *netparams.Store
   116  
   117  	// keep track of net deposits/withdrawals (ignores asset type)
   118  	netDeposits *num.Uint
   119  
   120  	// record parts of state before each step
   121  	accountsBefore                []protos.Account
   122  	ledgerMovementsBefore         int
   123  	insurancePoolDepositsOverStep map[string]*num.Int
   124  	eventsBefore                  int
   125  
   126  	notary                *notary.SnapshotNotary
   127  	stateVarEngine        *stubs.StateVarStub
   128  	witness               *validators.Witness
   129  	teamsEngine           *teams.Engine
   130  	profilesEngine        *parties.Engine
   131  	referralProgram       *referral.Engine
   132  	activityStreak        *activitystreak.Engine
   133  	vesting               *vesting.Engine
   134  	volumeDiscountProgram *volumediscount.Engine
   135  	volumeRebateProgram   *volumerebate.Engine
   136  	marketActivityTracker *common.MarketActivityTracker
   137  }
   138  
   139  func newExecutionTestSetup() *executionTestSetup {
   140  	if execsetup != nil && execsetup.ctrl != nil {
   141  		execsetup.ctrl.Finish()
   142  	} else if execsetup == nil {
   143  		execsetup = &executionTestSetup{}
   144  	}
   145  
   146  	ctx := context.Background()
   147  
   148  	ctrl := gomock.NewController(&reporter)
   149  	execsetup.ctrl = ctrl
   150  	execsetup.cfg = execution.NewDefaultConfig()
   151  	execsetup.cfg.Position.StreamPositionVerbose = true
   152  	execsetup.cfg.Risk.StreamMarginLevelsVerbose = true
   153  
   154  	execsetup.netDeposits = num.UintZero()
   155  	execsetup.block = helpers.NewBlock()
   156  
   157  	execsetup.log = logging.NewTestLogger()
   158  
   159  	execsetup.broker = stubs.NewBrokerStub()
   160  	execsetup.positionPlugin = plugins.NewPositions(ctx)
   161  	execsetup.broker.Subscribe(execsetup.positionPlugin)
   162  
   163  	execsetup.timeService = stubs.NewTimeStub()
   164  	execsetup.epochEngine = epochtime.NewService(execsetup.log, epochtime.NewDefaultConfig(), execsetup.broker)
   165  
   166  	commander := stubs.NewCommanderStub()
   167  
   168  	execsetup.collateralEngine = collateral.New(execsetup.log, collateral.NewDefaultConfig(), execsetup.timeService, execsetup.broker)
   169  	enableAssets(ctx, execsetup.collateralEngine)
   170  	execsetup.epochEngine.NotifyOnEpoch(execsetup.collateralEngine.OnEpochEvent, execsetup.collateralEngine.OnEpochRestore)
   171  
   172  	execsetup.netParams = netparams.New(execsetup.log, netparams.NewDefaultConfig(), execsetup.broker)
   173  
   174  	execsetup.topology = stubs.NewTopologyStub("nodeID", execsetup.broker)
   175  
   176  	execsetup.witness = validators.NewWitness(ctx, execsetup.log, validators.NewDefaultConfig(), execsetup.topology, commander, execsetup.timeService)
   177  
   178  	eventHeartbeat := evtforward.NewTracker(execsetup.log, execsetup.witness, execsetup.timeService)
   179  
   180  	execsetup.oracleEngine = spec.NewEngine(execsetup.log, spec.NewDefaultConfig(), execsetup.timeService, execsetup.broker)
   181  	execsetup.builtinOracle = spec.NewBuiltin(execsetup.oracleEngine, execsetup.timeService)
   182  
   183  	execsetup.stakingAccount = stubs.NewStakingAccountStub()
   184  	execsetup.epochEngine.NotifyOnEpoch(execsetup.stakingAccount.OnEpochEvent, execsetup.stakingAccount.OnEpochRestore)
   185  
   186  	execsetup.teamsEngine = teams.NewEngine(execsetup.broker, execsetup.timeService)
   187  	execsetup.profilesEngine = parties.NewEngine(execsetup.broker)
   188  
   189  	execsetup.stateVarEngine = stubs.NewStateVar()
   190  	broker := bmocks.NewMockBroker(ctrl)
   191  	broker.EXPECT().Send(gomock.Any()).AnyTimes()
   192  	execsetup.marketActivityTracker = common.NewMarketActivityTracker(execsetup.log, execsetup.teamsEngine, execsetup.stakingAccount, broker, execsetup.collateralEngine)
   193  
   194  	execsetup.notary = notary.NewWithSnapshot(execsetup.log, notary.NewDefaultConfig(), execsetup.topology, execsetup.broker, commander)
   195  
   196  	execsetup.assetsEngine = stubs.NewAssetStub()
   197  
   198  	execsetup.referralProgram = referral.NewEngine(execsetup.broker, execsetup.timeService, execsetup.marketActivityTracker, execsetup.stakingAccount)
   199  	execsetup.epochEngine.NotifyOnEpoch(execsetup.referralProgram.OnEpoch, execsetup.referralProgram.OnEpochRestore)
   200  
   201  	execsetup.volumeDiscountProgram = volumediscount.New(execsetup.broker, execsetup.marketActivityTracker)
   202  	execsetup.epochEngine.NotifyOnEpoch(execsetup.volumeDiscountProgram.OnEpoch, execsetup.volumeDiscountProgram.OnEpochRestore)
   203  	execsetup.volumeRebateProgram = volumerebate.New(execsetup.broker, execsetup.marketActivityTracker)
   204  
   205  	execsetup.banking = banking.New(execsetup.log, banking.NewDefaultConfig(), execsetup.collateralEngine, execsetup.witness, execsetup.timeService, execsetup.assetsEngine, execsetup.notary, execsetup.broker, execsetup.topology, execsetup.marketActivityTracker, stubs.NewBridgeViewStub(), stubs.NewBridgeViewStub(), eventHeartbeat, execsetup.profilesEngine, execsetup.stakingAccount)
   206  
   207  	execsetup.executionEngine = newExEng(
   208  		execution.NewEngine(
   209  			execsetup.log,
   210  			execsetup.cfg,
   211  			execsetup.timeService,
   212  			execsetup.collateralEngine,
   213  			execsetup.oracleEngine,
   214  			execsetup.broker,
   215  			execsetup.stateVarEngine,
   216  			execsetup.marketActivityTracker,
   217  			execsetup.assetsEngine, // assets
   218  			execsetup.referralProgram,
   219  			execsetup.volumeDiscountProgram,
   220  			execsetup.volumeRebateProgram,
   221  			execsetup.banking,
   222  			execsetup.profilesEngine,
   223  			&DummyDelayTarget{},
   224  		),
   225  		execsetup.broker,
   226  	)
   227  	execsetup.epochEngine.NotifyOnEpoch(execsetup.executionEngine.OnEpochEvent, execsetup.executionEngine.OnEpochRestore)
   228  	execsetup.epochEngine.NotifyOnEpoch(execsetup.marketActivityTracker.OnEpochEvent, execsetup.marketActivityTracker.OnEpochRestore)
   229  	execsetup.epochEngine.NotifyOnEpoch(execsetup.banking.OnEpoch, execsetup.banking.OnEpochRestore)
   230  	execsetup.epochEngine.NotifyOnEpoch(execsetup.volumeRebateProgram.OnEpoch, execsetup.volumeRebateProgram.OnEpochRestore)
   231  	execsetup.delegationEngine = delegation.New(execsetup.log, delegation.NewDefaultConfig(), execsetup.broker, execsetup.topology, execsetup.stakingAccount, execsetup.epochEngine, execsetup.timeService)
   232  
   233  	execsetup.activityStreak = activitystreak.New(execsetup.log, execsetup.executionEngine, execsetup.broker)
   234  	execsetup.epochEngine.NotifyOnEpoch(execsetup.activityStreak.OnEpochEvent, execsetup.activityStreak.OnEpochRestore)
   235  
   236  	execsetup.vesting = vesting.New(execsetup.log, execsetup.collateralEngine, execsetup.activityStreak, execsetup.broker, execsetup.assetsEngine, execsetup.profilesEngine, execsetup.timeService, execsetup.stakingAccount)
   237  	execsetup.rewardsEngine = rewards.New(execsetup.log, rewards.NewDefaultConfig(), execsetup.broker, execsetup.delegationEngine, execsetup.epochEngine, execsetup.collateralEngine, execsetup.timeService, execsetup.marketActivityTracker, execsetup.topology, execsetup.vesting, execsetup.banking, execsetup.activityStreak)
   238  
   239  	// register this after the rewards engine is created to make sure the on epoch is called in the right order.
   240  	execsetup.epochEngine.NotifyOnEpoch(execsetup.vesting.OnEpochEvent, execsetup.vesting.OnEpochRestore)
   241  
   242  	// The team engine is used to know the team a party belongs to. The computation
   243  	// of the referral program rewards requires this information. Since the team
   244  	// switches happen when the end of epoch is reached, it needs to be one of the
   245  	// last services to register on epoch update, so the computation is made based
   246  	// on the team the parties belonged to during the epoch and not the new one.
   247  	execsetup.epochEngine.NotifyOnEpoch(execsetup.teamsEngine.OnEpoch, execsetup.teamsEngine.OnEpochRestore)
   248  
   249  	execsetup.registerTimeServiceCallbacks()
   250  
   251  	if err := execsetup.registerNetParamsCallbacks(); err != nil {
   252  		panic(fmt.Errorf("failed to register network parameters: %w", err))
   253  	}
   254  
   255  	return execsetup
   256  }
   257  
   258  func enableAssets(ctx context.Context, collateralEngine *collateral.Engine) {
   259  	vegaAsset := types.Asset{
   260  		ID: "VEGA",
   261  		Details: &types.AssetDetails{
   262  			Name:    "VEGA",
   263  			Symbol:  "VEGA",
   264  			Quantum: num.MustDecimalFromString("1"),
   265  		},
   266  	}
   267  	if err := collateralEngine.EnableAsset(ctx, vegaAsset); err != nil {
   268  		panic(fmt.Errorf("could not enable asset %q: %w", vegaAsset, err))
   269  	}
   270  
   271  	usdt := types.Asset{
   272  		ID: "USDT",
   273  		Details: &types.AssetDetails{
   274  			Name:    "USDT",
   275  			Symbol:  "USDT",
   276  			Quantum: num.MustDecimalFromString("1"),
   277  		},
   278  	}
   279  	if err := collateralEngine.EnableAsset(ctx, usdt); err != nil {
   280  		panic(fmt.Errorf("could not enable asset %q: %w", usdt, err))
   281  	}
   282  
   283  	usdc := types.Asset{
   284  		ID: "USDC",
   285  		Details: &types.AssetDetails{
   286  			Name:    "USDC",
   287  			Symbol:  "USDC",
   288  			Quantum: num.MustDecimalFromString("1"),
   289  		},
   290  	}
   291  	if err := collateralEngine.EnableAsset(ctx, usdc); err != nil {
   292  		panic(fmt.Errorf("could not enable asset %q: %w", usdc, err))
   293  	}
   294  }
   295  
   296  func (e *executionTestSetup) registerTimeServiceCallbacks() {
   297  	e.timeService.NotifyOnTick(
   298  		e.epochEngine.OnTick,
   299  		e.witness.OnTick,
   300  		e.notary.OnTick,
   301  		e.banking.OnTick,
   302  		e.delegationEngine.OnTick,
   303  		e.builtinOracle.OnTick,
   304  		e.stateVarEngine.OnTick,
   305  		e.executionEngine.OnTick,
   306  	)
   307  }
   308  
   309  func (e *executionTestSetup) registerNetParamsCallbacks() error {
   310  	return e.netParams.Watch(
   311  		netparams.WatchParam{
   312  			Param:   netparams.MarketFeeFactorsBuyBackFee,
   313  			Watcher: e.volumeRebateProgram.OnMarketFeeFactorsBuyBackFeeUpdate,
   314  		},
   315  		netparams.WatchParam{
   316  			Param:   netparams.MarketFeeFactorsTreasuryFee,
   317  			Watcher: e.volumeRebateProgram.OnMarketFeeFactorsTreasuryFeeUpdate,
   318  		},
   319  		netparams.WatchParam{
   320  			Param:   netparams.StakingAndDelegationRewardMinimumValidatorStake,
   321  			Watcher: e.topology.OnMinDelegationUpdated,
   322  		},
   323  		netparams.WatchParam{
   324  			Param:   netparams.MarketMarginScalingFactors,
   325  			Watcher: e.executionEngine.OnMarketMarginScalingFactorsUpdate,
   326  		},
   327  		netparams.WatchParam{
   328  			Param:   netparams.MarketFeeFactorsBuyBackFee,
   329  			Watcher: e.executionEngine.OnMarketFeeFactorsBuyBackFeeUpdate,
   330  		},
   331  		netparams.WatchParam{
   332  			Param:   netparams.MarketFeeFactorsTreasuryFee,
   333  			Watcher: e.executionEngine.OnMarketFeeFactorsTreasuryFeeUpdate,
   334  		},
   335  		netparams.WatchParam{
   336  			Param:   netparams.MarketFeeFactorsMakerFee,
   337  			Watcher: e.executionEngine.OnMarketFeeFactorsMakerFeeUpdate,
   338  		},
   339  		netparams.WatchParam{
   340  			Param:   netparams.MarketFeeFactorsInfrastructureFee,
   341  			Watcher: e.executionEngine.OnMarketFeeFactorsInfrastructureFeeUpdate,
   342  		},
   343  		netparams.WatchParam{
   344  			Param:   netparams.MarketValueWindowLength,
   345  			Watcher: e.executionEngine.OnMarketValueWindowLengthUpdate,
   346  		},
   347  		netparams.WatchParam{
   348  			Param:   netparams.MarketLiquidityMaximumLiquidityFeeFactorLevel,
   349  			Watcher: e.executionEngine.OnMarketLiquidityMaximumLiquidityFeeFactorLevelUpdate,
   350  		},
   351  		// Liquidity version 2.
   352  		netparams.WatchParam{
   353  			Param:   netparams.MarketLiquidityBondPenaltyParameter,
   354  			Watcher: e.executionEngine.OnMarketLiquidityV2BondPenaltyUpdate,
   355  		},
   356  		netparams.WatchParam{
   357  			Param:   netparams.MarketLiquidityEarlyExitPenalty,
   358  			Watcher: e.executionEngine.OnMarketLiquidityV2EarlyExitPenaltyUpdate,
   359  		},
   360  		netparams.WatchParam{
   361  			Param:   netparams.MarketLiquidityMaximumLiquidityFeeFactorLevel,
   362  			Watcher: e.executionEngine.OnMarketLiquidityV2MaximumLiquidityFeeFactorLevelUpdate,
   363  		},
   364  		netparams.WatchParam{
   365  			Param:   netparams.MarketLiquiditySLANonPerformanceBondPenaltySlope,
   366  			Watcher: e.executionEngine.OnMarketLiquidityV2SLANonPerformanceBondPenaltySlopeUpdate,
   367  		},
   368  		netparams.WatchParam{
   369  			Param:   netparams.MarketLiquiditySLANonPerformanceBondPenaltyMax,
   370  			Watcher: e.executionEngine.OnMarketLiquidityV2SLANonPerformanceBondPenaltyMaxUpdate,
   371  		},
   372  		netparams.WatchParam{
   373  			Param:   netparams.MarketLiquidityStakeToCCYVolume,
   374  			Watcher: e.executionEngine.OnMarketLiquidityV2StakeToCCYVolumeUpdate,
   375  		},
   376  		netparams.WatchParam{
   377  			Param:   netparams.MarketLiquidityProvidersFeeCalculationTimeStep,
   378  			Watcher: execsetup.executionEngine.OnMarketLiquidityV2ProvidersFeeCalculationTimeStep,
   379  		},
   380  		// End of liquidity version 2.
   381  		netparams.WatchParam{
   382  			Param:   netparams.MarketAuctionMinimumDuration,
   383  			Watcher: e.executionEngine.OnMarketAuctionMinimumDurationUpdate,
   384  		},
   385  		netparams.WatchParam{
   386  			Param:   netparams.MarketAuctionMaximumDuration,
   387  			Watcher: e.executionEngine.OnMarketAuctionMaximumDurationUpdate,
   388  		},
   389  		netparams.WatchParam{
   390  			Param:   netparams.MarketProbabilityOfTradingTauScaling,
   391  			Watcher: e.executionEngine.OnMarketProbabilityOfTradingTauScalingUpdate,
   392  		},
   393  		netparams.WatchParam{
   394  			Param:   netparams.DelegationMinAmount,
   395  			Watcher: e.delegationEngine.OnMinAmountChanged,
   396  		},
   397  		netparams.WatchParam{
   398  			Param:   netparams.StakingAndDelegationRewardMaxPayoutPerParticipant,
   399  			Watcher: e.rewardsEngine.UpdateMaxPayoutPerParticipantForStakingRewardScheme,
   400  		},
   401  		netparams.WatchParam{
   402  			Param:   netparams.StakingAndDelegationRewardDelegatorShare,
   403  			Watcher: e.rewardsEngine.UpdateDelegatorShareForStakingRewardScheme,
   404  		},
   405  		netparams.WatchParam{
   406  			Param:   netparams.StakingAndDelegationRewardMinimumValidatorStake,
   407  			Watcher: e.rewardsEngine.UpdateMinimumValidatorStakeForStakingRewardScheme,
   408  		},
   409  		netparams.WatchParam{
   410  			Param:   netparams.RewardAsset,
   411  			Watcher: e.rewardsEngine.UpdateAssetForStakingAndDelegation,
   412  		},
   413  		netparams.WatchParam{
   414  			Param:   netparams.StakingAndDelegationRewardCompetitionLevel,
   415  			Watcher: e.rewardsEngine.UpdateCompetitionLevelForStakingRewardScheme,
   416  		},
   417  		netparams.WatchParam{
   418  			Param:   netparams.StakingAndDelegationRewardsMinValidators,
   419  			Watcher: e.rewardsEngine.UpdateMinValidatorsStakingRewardScheme,
   420  		},
   421  		netparams.WatchParam{
   422  			Param:   netparams.StakingAndDelegationRewardOptimalStakeMultiplier,
   423  			Watcher: e.rewardsEngine.UpdateOptimalStakeMultiplierStakingRewardScheme,
   424  		},
   425  		netparams.WatchParam{
   426  			Param:   netparams.ValidatorsEpochLength,
   427  			Watcher: e.epochEngine.OnEpochLengthUpdate,
   428  		},
   429  		netparams.WatchParam{
   430  			Param:   netparams.MarketMinLpStakeQuantumMultiple,
   431  			Watcher: e.executionEngine.OnMinLpStakeQuantumMultipleUpdate,
   432  		},
   433  		netparams.WatchParam{
   434  			Param:   netparams.MarketMinProbabilityOfTradingForLPOrders,
   435  			Watcher: e.executionEngine.OnMarketMinProbabilityOfTradingForLPOrdersUpdate,
   436  		},
   437  		netparams.WatchParam{
   438  			Param:   netparams.MarketSuccessorLaunchWindow,
   439  			Watcher: execsetup.executionEngine.OnSuccessorMarketTimeWindowUpdate,
   440  		},
   441  		netparams.WatchParam{
   442  			Param:   netparams.FloatingPointUpdatesDuration,
   443  			Watcher: execsetup.stateVarEngine.OnFloatingPointUpdatesDurationUpdate,
   444  		},
   445  		netparams.WatchParam{
   446  			Param:   netparams.TransferFeeFactor,
   447  			Watcher: execsetup.banking.OnTransferFeeFactorUpdate,
   448  		},
   449  		netparams.WatchParam{
   450  			Param:   netparams.TransferMinTransferQuantumMultiple,
   451  			Watcher: execsetup.banking.OnMinTransferQuantumMultiple,
   452  		},
   453  		netparams.WatchParam{
   454  			Param:   netparams.TransferFeeMaxQuantumAmount,
   455  			Watcher: execsetup.banking.OnMaxQuantumAmountUpdate,
   456  		},
   457  		netparams.WatchParam{
   458  			Param:   netparams.TransferFeeDiscountDecayFraction,
   459  			Watcher: execsetup.banking.OnTransferFeeDiscountDecayFractionUpdate,
   460  		},
   461  		netparams.WatchParam{
   462  			Param:   netparams.TransferFeeDiscountMinimumTrackedAmount,
   463  			Watcher: execsetup.banking.OnTransferFeeDiscountMinimumTrackedAmountUpdate,
   464  		},
   465  		netparams.WatchParam{
   466  			Param:   netparams.MaxPeggedOrders,
   467  			Watcher: execsetup.executionEngine.OnMaxPeggedOrderUpdate,
   468  		},
   469  		netparams.WatchParam{
   470  			Param:   netparams.MarkPriceUpdateMaximumFrequency,
   471  			Watcher: execsetup.executionEngine.OnMarkPriceUpdateMaximumFrequency,
   472  		},
   473  		netparams.WatchParam{
   474  			Param:   netparams.InternalCompositePriceUpdateFrequency,
   475  			Watcher: execsetup.executionEngine.OnInternalCompositePriceUpdateFrequency,
   476  		},
   477  		netparams.WatchParam{
   478  			Param:   netparams.SpamProtectionMaxStopOrdersPerMarket,
   479  			Watcher: execsetup.executionEngine.OnMarketPartiesMaximumStopOrdersUpdate,
   480  		},
   481  		netparams.WatchParam{
   482  			Param:   netparams.MarketLiquidityEarlyExitPenalty,
   483  			Watcher: execsetup.executionEngine.OnMarketLiquidityV2EarlyExitPenaltyUpdate,
   484  		},
   485  		netparams.WatchParam{
   486  			Param:   netparams.MarketLiquiditySLANonPerformanceBondPenaltyMax,
   487  			Watcher: execsetup.executionEngine.OnMarketLiquidityV2SLANonPerformanceBondPenaltyMaxUpdate,
   488  		},
   489  		netparams.WatchParam{
   490  			Param:   netparams.MarketLiquiditySLANonPerformanceBondPenaltySlope,
   491  			Watcher: execsetup.executionEngine.OnMarketLiquidityV2SLANonPerformanceBondPenaltySlopeUpdate,
   492  		},
   493  		netparams.WatchParam{
   494  			Param:   netparams.MarketLiquidityBondPenaltyParameter,
   495  			Watcher: execsetup.executionEngine.OnMarketLiquidityV2BondPenaltyUpdate,
   496  		},
   497  		netparams.WatchParam{
   498  			Param:   netparams.MarketLiquidityMaximumLiquidityFeeFactorLevel,
   499  			Watcher: execsetup.executionEngine.OnMarketLiquidityV2MaximumLiquidityFeeFactorLevelUpdate,
   500  		},
   501  		netparams.WatchParam{
   502  			Param:   netparams.MarketLiquidityStakeToCCYVolume,
   503  			Watcher: execsetup.executionEngine.OnMarketLiquidityV2StakeToCCYVolumeUpdate,
   504  		},
   505  		netparams.WatchParam{
   506  			Param:   netparams.MarketLiquidityProvidersFeeCalculationTimeStep,
   507  			Watcher: execsetup.executionEngine.OnMarketLiquidityV2ProvidersFeeCalculationTimeStep,
   508  		},
   509  		netparams.WatchParam{
   510  			Param:   netparams.ReferralProgramMinStakedVegaTokens,
   511  			Watcher: execsetup.referralProgram.OnReferralProgramMinStakedVegaTokensUpdate,
   512  		},
   513  		netparams.WatchParam{
   514  			Param:   netparams.ReferralProgramMaxPartyNotionalVolumeByQuantumPerEpoch,
   515  			Watcher: execsetup.referralProgram.OnReferralProgramMaxPartyNotionalVolumeByQuantumPerEpochUpdate,
   516  		},
   517  		netparams.WatchParam{
   518  			Param:   netparams.ReferralProgramMaxReferralRewardProportion,
   519  			Watcher: execsetup.referralProgram.OnReferralProgramMaxReferralRewardProportionUpdate,
   520  		},
   521  		netparams.WatchParam{
   522  			Param:   netparams.ReferralProgramMinStakedVegaTokens,
   523  			Watcher: execsetup.teamsEngine.OnReferralProgramMinStakedVegaTokensUpdate,
   524  		},
   525  		netparams.WatchParam{
   526  			Param:   netparams.RewardsActivityStreakBenefitTiers,
   527  			Watcher: execsetup.activityStreak.OnBenefitTiersUpdate,
   528  		},
   529  		netparams.WatchParam{
   530  			Param:   netparams.RewardsActivityStreakMinQuantumOpenVolume,
   531  			Watcher: execsetup.activityStreak.OnMinQuantumOpenNationalVolumeUpdate,
   532  		},
   533  		netparams.WatchParam{
   534  			Param:   netparams.RewardsActivityStreakMinQuantumTradeVolume,
   535  			Watcher: execsetup.activityStreak.OnMinQuantumTradeVolumeUpdate,
   536  		},
   537  		netparams.WatchParam{
   538  			Param:   netparams.RewardsActivityStreakInactivityLimit,
   539  			Watcher: execsetup.activityStreak.OnRewardsActivityStreakInactivityLimit,
   540  		},
   541  		netparams.WatchParam{
   542  			Param:   netparams.RewardsVestingBaseRate,
   543  			Watcher: execsetup.vesting.OnRewardVestingBaseRateUpdate,
   544  		},
   545  		netparams.WatchParam{
   546  			Param:   netparams.RewardsVestingMinimumTransfer,
   547  			Watcher: execsetup.vesting.OnRewardVestingMinimumTransferUpdate,
   548  		},
   549  		netparams.WatchParam{
   550  			Param:   netparams.RewardsVestingBenefitTiers,
   551  			Watcher: execsetup.vesting.OnBenefitTiersUpdate,
   552  		},
   553  		netparams.WatchParam{
   554  			Param:   netparams.MinEpochsInTeamForMetricRewardEligibility,
   555  			Watcher: execsetup.marketActivityTracker.OnMinEpochsInTeamForRewardEligibilityUpdated,
   556  		},
   557  		netparams.WatchParam{
   558  			Param:   netparams.MarketLiquidityEquityLikeShareFeeFraction,
   559  			Watcher: execsetup.executionEngine.OnMarketLiquidityEquityLikeShareFeeFractionUpdate,
   560  		},
   561  		netparams.WatchParam{
   562  			Param:   netparams.MarketAMMMinCommitmentQuantum,
   563  			Watcher: execsetup.executionEngine.OnMarketAMMMinCommitmentQuantum,
   564  		},
   565  		netparams.WatchParam{
   566  			Param:   netparams.MarketAMMMaxCalculationLevels,
   567  			Watcher: execsetup.executionEngine.OnMarketAMMMaxCalculationLevels,
   568  		},
   569  	)
   570  }