diff --git a/CHANGELOG.md b/CHANGELOG.md index 86f032aef87..e392720be93 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 0c345e67802..414fb2e00c5 100644 --- a/commands/proposal_submission.go +++ b/commands/proposal_submission.go @@ -1028,8 +1028,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 a6498cdac88..689f21a16ee 100644 --- a/commands/proposal_submission_new_market_test.go +++ b/commands/proposal_submission_new_market_test.go @@ -677,20 +677,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, }, }, }, @@ -698,7 +696,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 30e0cb4de1c..2a3d5f84806 100644 --- a/commands/proposal_submission_new_spot_market_test.go +++ b/commands/proposal_submission_new_spot_market_test.go @@ -499,6 +499,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{ @@ -508,14 +513,7 @@ func testNewSpotMarketChangeSubmissionWithTooManyPMTriggersFails(t *testing.T) { Product: &protoTypes.InstrumentConfiguration_Spot{}, }, PriceMonitoringParameters: &protoTypes.PriceMonitoringParameters{ - Triggers: []*protoTypes.PriceMonitoringTrigger{ - {}, - {}, - {}, - {}, - {}, - {}, - }, + Triggers: triggers, }, }, }, @@ -523,7 +521,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) {