diff --git a/CHANGELOG.md b/CHANGELOG.md index bc6142bffb2..44d729dd5f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,8 @@ - [10686](https://github.com/vegaprotocol/vega/issues/10686) - Allow transfers to filter by from and to account type. - [10686](https://github.com/vegaprotocol/vega/issues/10764) - Network will now only trade within price monitoring bounds. -- [](https://github.com/vegaprotocol/vega/issues/xxx) +- [10770](https://github.com/vegaprotocol/vega/issues/10770) - Increase price monitoring triggers to 100. + ### 🐛 Fixes diff --git a/commands/proposal_submission.go b/commands/proposal_submission.go index 3d67bb074fc..11aacd05a95 100644 --- a/commands/proposal_submission.go +++ b/commands/proposal_submission.go @@ -1005,8 +1005,8 @@ func checkPriceMonitoring(parameters *protoTypes.PriceMonitoringParameters, pare return errs } - if len(parameters.Triggers) > 5 { - errs.AddForProperty(fmt.Sprintf("%s.price_monitoring_parameters.triggers", parentProperty), errors.New("maximum 5 triggers allowed")) + if len(parameters.Triggers) > 100 { + errs.AddForProperty(fmt.Sprintf("%s.price_monitoring_parameters.triggers", parentProperty), errors.New("maximum 100 triggers allowed")) } for i, trigger := range parameters.Triggers { diff --git a/commands/proposal_submission_new_market_test.go b/commands/proposal_submission_new_market_test.go index c1500810907..8e0dac7ad1b 100644 --- a/commands/proposal_submission_new_market_test.go +++ b/commands/proposal_submission_new_market_test.go @@ -638,20 +638,18 @@ func testPriceMonitoringChangeSubmissionWithTriggersSucceeds(t *testing.T) { } func testNewMarketChangeSubmissionWithTooManyPMTriggersFails(t *testing.T) { + triggers := []*vegapb.PriceMonitoringTrigger{} + for i := 0; i <= 100; i++ { + triggers = append(triggers, &vegapb.PriceMonitoringTrigger{}) + } + err := checkProposalSubmission(&commandspb.ProposalSubmission{ Terms: &vegapb.ProposalTerms{ Change: &vegapb.ProposalTerms_NewMarket{ NewMarket: &vegapb.NewMarket{ Changes: &vegapb.NewMarketConfiguration{ PriceMonitoringParameters: &vegapb.PriceMonitoringParameters{ - Triggers: []*vegapb.PriceMonitoringTrigger{ - {}, - {}, - {}, - {}, - {}, - {}, - }, + Triggers: triggers, }, }, }, @@ -659,7 +657,7 @@ func testNewMarketChangeSubmissionWithTooManyPMTriggersFails(t *testing.T) { }, }) - assert.Contains(t, err.Get("proposal_submission.terms.change.new_market.changes.price_monitoring_parameters.triggers"), errors.New("maximum 5 triggers allowed")) + assert.Contains(t, err.Get("proposal_submission.terms.change.new_market.changes.price_monitoring_parameters.triggers"), errors.New("maximum 100 triggers allowed")) } func testPriceMonitoringChangeSubmissionWithoutTriggerHorizonFails(t *testing.T) { diff --git a/commands/proposal_submission_new_spot_market_test.go b/commands/proposal_submission_new_spot_market_test.go index a79abf68ca8..f2eb126e128 100644 --- a/commands/proposal_submission_new_spot_market_test.go +++ b/commands/proposal_submission_new_spot_market_test.go @@ -472,6 +472,11 @@ func testSpotPriceMonitoringChangeSubmissionWithTriggersSucceeds(t *testing.T) { } func testNewSpotMarketChangeSubmissionWithTooManyPMTriggersFails(t *testing.T) { + triggers := []*vegapb.PriceMonitoringTrigger{} + for i := 0; i <= 100; i++ { + triggers = append(triggers, &vegapb.PriceMonitoringTrigger{}) + } + err := checkProposalSubmission(&commandspb.ProposalSubmission{ Terms: &protoTypes.ProposalTerms{ Change: &protoTypes.ProposalTerms_NewSpotMarket{ @@ -481,14 +486,7 @@ func testNewSpotMarketChangeSubmissionWithTooManyPMTriggersFails(t *testing.T) { Product: &protoTypes.InstrumentConfiguration_Spot{}, }, PriceMonitoringParameters: &protoTypes.PriceMonitoringParameters{ - Triggers: []*protoTypes.PriceMonitoringTrigger{ - {}, - {}, - {}, - {}, - {}, - {}, - }, + Triggers: triggers, }, }, }, @@ -496,7 +494,7 @@ func testNewSpotMarketChangeSubmissionWithTooManyPMTriggersFails(t *testing.T) { }, }) - assert.Contains(t, err.Get("proposal_submission.terms.change.new_spot_market.changes.price_monitoring_parameters.triggers"), errors.New("maximum 5 triggers allowed")) + assert.Contains(t, err.Get("proposal_submission.terms.change.new_spot_market.changes.price_monitoring_parameters.triggers"), errors.New("maximum 100 triggers allowed")) } func testSpotPriceMonitoringChangeSubmissionWithoutTriggerHorizonFails(t *testing.T) {