How does it work?
Sperax Gauge functions with 3 main contracts, Gauge Controller which tracks the gauges and user votes, SPA Rewarder which allocates rewards based on votes and Bribe contracts which help is distributing bribe tokens for each gauge.
Gauge Controller contract tracks the list of all gauges. It tracks user votes, gauge weights, typeWeights and totalWeights. There can be multiple gauge types, and each gauge type can have multiple gauges.
- Voting cycle is 1 Week, that is every week on THURSDAY 00:00 UTC, a snapshot of the vote is taken and SPA emission is done based on the relative votes of these gauges
- Any user with a veSPA balance > 0, lock-expiry > start of next-cycle will be eligible to use their veSPA to vote on multiple gauges. Else the user needs to create a new stake position
- veSPA holder with manual-cooldown and in residual period is not eligible to cast vote. Users in this case need to activate cooldown, withdraw and stake their SPA again.
- In a scenario where a user increases his/her wallet’s veSPA balance by either increasing the SPA stake or increasing the expiry time, their existing vote weights for a gauge won’t change unless the user votes again for the gauge.
- Users can define the weight they want to vote on a specific gauge out of 100.
- Users can change their vote weights for a gauge in an interval of 6 days.
- UserVoteWeight =(User’s vote weight for a gauge)
- GaugeWeight =(whereis the base weight for the gauge which remains constant and the other component is variable and decided by the user votes)
- TypeWeight =(TypeWeight acts like a multiplier for splitting rewards in between the different gauge types)
- TypeSum =(whereis gauge weight andcaptures the sum of all the gauges belonging to a particular type)
- TotalWeight =(Captures the total vote weight across all the gauge types)
Reward manager contract is responsible for emitting SPA rewards for all the registered gauges after voting is done for a week. It has a parameter to control global SPA Emission Rate per week (E) across all farms in Demeter (listed in GaugeController). Total SPA for emission will be funded to this contract. It will calculate the Relative weight of each gauge (wr) from the votes received by the gauge and total votes in the cycle. Based on Relative weight of a gauge and globalSPAEmissionRate, emission for each gauge will be determined.
- Eligibility for reward - A farm should have a relative weight > T to be eligible for reward distribution for a cycle. (T is an updateable param, within 10000).
- Reward distribution - Rewards are distributed to the farms using a public distributeReward() which can be called by anyone. distributeReward() is callable only once every reward cycle. If the distributeRewards function is not called for a gauge for a given cycle, there is no reward for the gauge for that week.
- globalSPAEmissionRate =
- Relative weight of a gauge =(is the weight of the gauge and W is the TotalWeight for the cycle)
- Emission for a gauge =
- Next reward time =(Start of the next reward cycle)
- Current time =(Current block timestamp)
- Reward rate =
Protocols will use this contract to bribe the veSPA holders to vote for their gauges. Bribes will incentivize veSPA holders to vote for specific gauges increasing the SPA emission for that gauge, leading to higher APR for that farm. The bribe goes to veSPA holders who vote on emissions for the gauge. Voteshare is calculated at the time of closing of the vote cycle. Bribe token is distributed in proportion to user’s veSPA weights that they have used to vote in the farm. Whenever a user updates/ votes for a specific gauge, the user claims the pending bribe rewards.
While adding a new gauge contract in the Gauge controller, a bribe contract is deployed, and mapped to the gauge. Bribe tokens are registered to the contract on request. Anyone can add bribe rewards for the gauge for at max 10 voting cycles. Once a bribe contract is funded, it is not allowed to recover the funds. Funds are withdrawable only in case of emergencies.
- Bribe rewards for a week =
- User’s vote weight =
- Total vote weight for a gauge =
- User’s bribe reward share for the week =