Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
affanv14 committed Sep 18, 2024
1 parent d29f906 commit 12d634e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions protocol/x/feetiers/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/dydxprotocol/v4-chain/protocol/lib"
"github.com/dydxprotocol/v4-chain/protocol/x/feetiers/types"
revsharetypes "github.com/dydxprotocol/v4-chain/protocol/x/revshare/types"
)

type (
Expand Down Expand Up @@ -133,11 +134,17 @@ func (k Keeper) GetLowestMakerFee(ctx sdk.Context) int32 {
return lowestMakerFee
}

// GetAffiliateRefereeLowestTakerFee returns the lowest taker fee among any tiers.
// GetAffiliateRefxereeLowestTakerFee returns the lowest taker fee
// for volume under Max30dRefereeVolumeQuantums.
func (k Keeper) GetAffiliateRefereeLowestTakerFee(ctx sdk.Context) int32 {
feeParams := k.GetPerpetualFeeParams(ctx)
if len(feeParams.Tiers) < int(types.RefereeStartingFeeTier) {
panic("fee tiers does not have required number of tiers")
for _, tier := range feeParams.Tiers {
// assumes tiers are ordered by absolute volume requirement
if tier.AbsoluteVolumeRequirement < revsharetypes.Max30dRefereeVolumeQuantums {
return tier.TakerFeePpm
} else {
break
}
}

return feeParams.Tiers[types.RefereeStartingFeeTier].TakerFeePpm
Expand Down
4 changes: 2 additions & 2 deletions protocol/x/revshare/types/constants.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package types

const (
// 25 million USDC
Max30dRefereeVolumeQuantums = uint64(25_000_000_000_000)
// 50 million USDC
Max30dRefereeVolumeQuantums = uint64(50_000_000_000_000)
)

0 comments on commit 12d634e

Please sign in to comment.