-
Notifications
You must be signed in to change notification settings - Fork 208
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
updated rebate to use native denom instead of reward denom #1162
Conversation
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.
Looking solid to me - great work!
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.
lgtm - although I'm slightly less familiar with this code, should get a review from @shellvish and @ethan-stride too!
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.
LGTM
One weird thing is that StrideCommission and RebateRate are not stored in the same format. We might also want to rename StrideCommission if it is really the percent of total fees not just the stride fees.
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.
This looks great, thanks a lot for doing this! Seems like this greatly simplifies the rebate logic!
Context
The rebate must now be issued using the native denom (DYDX) instead of the reward denom (USDC).
Brief Changelog
CalculateRewardsSplitBeforeRebate
andCalculateRewardsSplitAfterRebate
in favor of a simpler functionCalculateRewardsSplit
that returns the portion of rebate, stride fee, and reinvestmentwithdrawal-rewards
callback (the callback on the USDC query) to trade the full queried amount instead of checking for a rebatewithdrawal-host
callback (the callback on the DYDX query) to optionally fund the community pool if a rebate was specified