-
Notifications
You must be signed in to change notification settings - Fork 104
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
[OTE-817] update trading rewards with new logic #2300
Changes from 4 commits
213977b
368f359
9e422bb
8750e0d
f9d89c7
61a4542
972f274
3deb52e
2184b6a
581f861
6fada43
15ba5e6
f4d0f93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,9 +131,10 @@ func (k Keeper) GetRewardShare( | |
// * fill_quote_quantum - max_possible_taker_fee_rev_share) * (1 - F) | ||
// are added to reward share score. | ||
// max_possible_taker_fee_rev_share is 0 when taker trailing volume is > MaxReferee30dVolumeForAffiliateShareQuantums, | ||
// since taker trailing volume is only affiliate at the moment, and they don’t generate affiliate rev share. | ||
// since taker_fee_share is only affiliate at the moment, and they don’t generate affiliate rev share. | ||
// When taker volume ≤ MaxReferee30dVolumeForAffiliateShareQuantums, | ||
// max_possible_taker_fee_rev_share = max_vip_affiliate_share * taker_fee | ||
// regardless of if the taker has an affiliate or not. | ||
|
||
func (k Keeper) AddRewardSharesForFill( | ||
ctx sdk.Context, | ||
|
@@ -152,7 +153,7 @@ func (k Keeper) AddRewardSharesForFill( | |
|
||
// taker revshare is not returned if taker volume is greater than Max30dTakerVolumeQuantums | ||
if value, ok := revSharesForFill.FeeSourceToRevSharePpm[revsharetypes.REV_SHARE_FEE_SOURCE_TAKER_FEE]; ok && | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my b - didnt realize this when i was working through it fast 😓 |
||
value > 0 { | ||
value > 0 && fill.MonthlyRollingTakerVolumeQuantums < revsharetypes.MaxReferee30dVolumeForAffiliateShareQuantums { | ||
totalTakerFeeRevShareQuantums = lib.BigMulPpm(fill.TakerFeeQuoteQuantums, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Naming of variable is inaccurate, should be |
||
lib.BigU(affiliatetypes.AffiliatesRevSharePpmCap), | ||
false, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We aren't using
Max30dRefereeVolumeQuantums
below?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We dont need to - since no taker revshares are returned over 50 million - the if condition is never hit for value > 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new trading rewards logic is below:
If taker volume is <50M (equal statement: they would generate affiliate rev share if referred), then the max possible affiliate rev share is deducted from their trading rewards score.
The following implementation doesn't work correctly for a non-referred user under 50M volume