diff --git a/core/types/rebate_program.go b/core/types/rebate_program.go index ccade16005..91d22dd6fa 100644 --- a/core/types/rebate_program.go +++ b/core/types/rebate_program.go @@ -20,6 +20,7 @@ import ( "time" "code.vegaprotocol.io/vega/libs/num" + "code.vegaprotocol.io/vega/libs/ptr" vegapb "code.vegaprotocol.io/vega/protos/vega" ) @@ -42,10 +43,11 @@ type VolumeRebateBenefitTier struct { func (v VolumeRebateProgram) IntoProto() *vegapb.VolumeRebateProgram { benefitTiers := make([]*vegapb.VolumeRebateBenefitTier, 0, len(v.VolumeRebateBenefitTiers)) - for _, tier := range v.VolumeRebateBenefitTiers { + for i, tier := range v.VolumeRebateBenefitTiers { benefitTiers = append(benefitTiers, &vegapb.VolumeRebateBenefitTier{ MinimumPartyMakerVolumeFraction: tier.MinimumPartyMakerVolumeFraction.String(), AdditionalMakerRebate: tier.AdditionalMakerRebate.String(), + TierNumber: ptr.From(uint64(i + 1)), }) } diff --git a/core/types/referral_program.go b/core/types/referral_program.go index edc3f9816b..31ceddb090 100644 --- a/core/types/referral_program.go +++ b/core/types/referral_program.go @@ -20,6 +20,7 @@ import ( "time" "code.vegaprotocol.io/vega/libs/num" + "code.vegaprotocol.io/vega/libs/ptr" vegapb "code.vegaprotocol.io/vega/protos/vega" ) @@ -172,12 +173,13 @@ func (c ReferralProgram) String() string { func (c ReferralProgram) IntoProto() *vegapb.ReferralProgram { benefitTiers := make([]*vegapb.BenefitTier, 0, len(c.BenefitTiers)) - for _, tier := range c.BenefitTiers { + for i, tier := range c.BenefitTiers { benefitTiers = append(benefitTiers, &vegapb.BenefitTier{ MinimumEpochs: tier.MinimumEpochs.String(), MinimumRunningNotionalTakerVolume: tier.MinimumRunningNotionalTakerVolume.String(), ReferralRewardFactors: tier.ReferralRewardFactors.IntoRewardFactorsProto(), ReferralDiscountFactors: tier.ReferralDiscountFactors.IntoDiscountFactorsProto(), + TierNumber: ptr.From(uint64(i + 1)), }) } diff --git a/core/types/volume_discount_program.go b/core/types/volume_discount_program.go index d19fdf70a7..96f5023fb5 100644 --- a/core/types/volume_discount_program.go +++ b/core/types/volume_discount_program.go @@ -20,6 +20,7 @@ import ( "time" "code.vegaprotocol.io/vega/libs/num" + "code.vegaprotocol.io/vega/libs/ptr" vegapb "code.vegaprotocol.io/vega/protos/vega" ) @@ -42,10 +43,11 @@ type VolumeBenefitTier struct { func (v VolumeDiscountProgram) IntoProto() *vegapb.VolumeDiscountProgram { benefitTiers := make([]*vegapb.VolumeBenefitTier, 0, len(v.VolumeBenefitTiers)) - for _, tier := range v.VolumeBenefitTiers { + for i, tier := range v.VolumeBenefitTiers { benefitTiers = append(benefitTiers, &vegapb.VolumeBenefitTier{ MinimumRunningNotionalTakerVolume: tier.MinimumRunningNotionalTakerVolume.String(), VolumeDiscountFactors: tier.VolumeDiscountFactors.IntoDiscountFactorsProto(), + TierNumber: ptr.From(uint64(i + 1)), }) } diff --git a/datanode/gateway/graphql/gqlgen.yml b/datanode/gateway/graphql/gqlgen.yml index 147f41b3f2..ab4484c50a 100644 --- a/datanode/gateway/graphql/gqlgen.yml +++ b/datanode/gateway/graphql/gqlgen.yml @@ -848,4 +848,3 @@ models: model: code.vegaprotocol.io/vega/protos/data-node/api/v2.GetPartyDiscountStatsResponse MarketFees: model: code.vegaprotocol.io/vega/protos/data-node/api/v2.MarketFees -