Skip to content

Commit

Permalink
chore: update with latest changes from DMM registration
Browse files Browse the repository at this point in the history
  • Loading branch information
gorgos committed Apr 5, 2022
1 parent 7f50dd5 commit e13b3b6
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 108 deletions.
1 change: 1 addition & 0 deletions chain/exchange/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
&MsgIncreasePositionMargin{},
&MsgLiquidatePosition{},
&MsgBatchUpdateOrders{},
&MsgRegisterAsDMM{},
)

registry.RegisterImplementations(
Expand Down
20 changes: 1 addition & 19 deletions chain/exchange/types/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,28 +61,10 @@ type TradingRewardAccountPoints struct {
Points sdk.Dec
}

func (p *PointsMultiplier) GetEffectiveMultiplier(e ExecutionType, isRegisteredDMMCache map[string]bool, account sdk.AccAddress) sdk.Dec {
if isRegisteredDMMCache[account.String()] {
return sdk.ZeroDec()
}

func (p *PointsMultiplier) GetMultiplier(e ExecutionType) sdk.Dec {
if e.IsMaker() {
return p.MakerPointsMultiplier
}

return p.TakerPointsMultiplier
}

func (p *PointsMultiplier) GetEffectiveMultipliers(isRegisteredDMMCache map[string]bool, account sdk.AccAddress) PointsMultiplier {
if isRegisteredDMMCache[account.String()] {
return PointsMultiplier{
MakerPointsMultiplier: sdk.ZeroDec(),
TakerPointsMultiplier: sdk.ZeroDec(),
}
}

return PointsMultiplier{
MakerPointsMultiplier: p.MakerPointsMultiplier,
TakerPointsMultiplier: p.TakerPointsMultiplier,
}
}
Loading

0 comments on commit e13b3b6

Please sign in to comment.