-
Notifications
You must be signed in to change notification settings - Fork 2
Add Staking Tier Discount on Fees #36
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
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.
Nice work! That was a much heavier lift than we thought but in general looks really good.
I think we need to add some more test coverage around modifying fees while a user is in a position, and the position modification in general, so that we have more confidence that there are no side effects from the changes.
Overview
Implements staking-based fee discounts for Mars Credit Manager users based on their MARS token staking tier.
Key Features
8-tier system: 0% to 80% fee discounts based on MARS staked (10k to 1.5M+ tokens)
Applies to: Swap fees and perpetual trading fees
Integration: Queries DAO staking contract for user voting power
Implementation
New staking.rs module with StakingTierManager
Updated swap.rs and perp.rs to apply discounts
New query endpoints for tier information
Benefits
Incentivizes long-term MARS staking
Configurable tier thresholds and discounts
No breaking changes to existing functionality