Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: include party information in estimate fee to calculate the disc… #11590

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- [11562](https://github.com/vegaprotocol/vega/issues/11562) - Update average notional metric with mark price at the end of the epoch and when calculating live score.
- [11570](https://github.com/vegaprotocol/vega/issues/11570) - Include the required set of parties for evaluation for eligible entities reward.
- [11576](https://github.com/vegaprotocol/vega/issues/11576) - Replace additional rebate validation with a cap.

- [11533](https://github.com/vegaprotocol/vega/issues/11533) - Suppose per party fee discounts in fee estimation.

### 🐛 Fixes

Expand Down
96 changes: 96 additions & 0 deletions datanode/api/mocks/epoch_service_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions datanode/api/mocks/volume_service_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 26 additions & 3 deletions datanode/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,29 @@ import (
"google.golang.org/grpc/status"
)

// VolumeDiscountService ...
//
//go:generate go run github.com/golang/mock/mockgen -destination mocks/volume_service_mock.go -package mocks code.vegaprotocol.io/vega/datanode/api VolumeDiscountService
type VolumeDiscountService interface {
Stats(ctx context.Context, atEpoch *uint64, partyID *string, pagination entities.CursorPagination) ([]entities.FlattenVolumeDiscountStats, entities.PageInfo, error)
}

// EpochService
//
//go:generate go run github.com/golang/mock/mockgen -destination mocks/epoch_service_mock.go -package mocks code.vegaprotocol.io/vega/datanode/api EpochService
type EpochService interface {
GetCurrent(ctx context.Context) (entities.Epoch, error)
GetByBlock(ctx context.Context, height uint64) (entities.Epoch, error)
Get(ctx context.Context, ID uint64) (entities.Epoch, error)
GetAll(ctx context.Context) ([]entities.Epoch, error)
}

type ReferralSetService interface {
GetReferralSetStats(ctx context.Context, setID *entities.ReferralSetID, atEpoch *uint64, referee *entities.PartyID, pagination entities.CursorPagination) ([]entities.FlattenReferralSetStats, entities.PageInfo, error)
ListReferralSets(ctx context.Context, referralSetID *entities.ReferralSetID, referrer, referee *entities.PartyID, pagination entities.CursorPagination) ([]entities.ReferralSet, entities.PageInfo, error)
ListReferralSetReferees(ctx context.Context, referralSetID *entities.ReferralSetID, referrer, referee *entities.PartyID, pagination entities.CursorPagination, aggregationEpochs uint32) ([]entities.ReferralSetRefereeStats, entities.PageInfo, error)
}

// EventService ...
//
//go:generate go run github.com/golang/mock/mockgen -destination mocks/event_service_mock.go -package mocks code.vegaprotocol.io/vega/datanode/api EventService
Expand Down Expand Up @@ -550,7 +573,7 @@ func (g *GRPCServer) Start(ctx context.Context, lis net.Listener) error {
delegationService: g.delegationService,
marketDepthService: g.marketDepthService,
nodeService: g.nodeService,
epochService: g.epochService,
EpochService: g.epochService,
RiskFactorService: g.riskFactorService,
networkParameterService: g.networkParameterService,
checkpointService: g.checkpointService,
Expand All @@ -567,11 +590,11 @@ func (g *GRPCServer) Start(ctx context.Context, lis net.Listener) error {
fundingPeriodService: g.fundingPeriodService,
partyActivityStreak: g.partyActivityStreak,
referralProgramService: g.referralProgramService,
referralSetsService: g.referralSetsService,
ReferralSetsService: g.referralSetsService,
teamsService: g.teamsService,
feesStatsService: g.FeesStatsService,
fundingPaymentService: g.fundingPaymentService,
volumeDiscountStatsService: g.volumeDiscountStatsService,
VolumeDiscountStatsService: g.volumeDiscountStatsService,
volumeDiscountProgramService: g.volumeDiscountProgramService,
paidLiquidityFeesStatsService: g.paidLiquidityFeesStatsService,
partyLockedBalances: g.partyLockedBalances,
Expand Down
Loading
Loading