Key Components
- GaugeFactoryV2: The main contract for creating and managing gauges.
- GaugeV2: Individual gauge contracts created by the factory.
- Voting Mechanism: Allows ve3,3 token holders to allocate votes to gauges.
- Reward Distribution: Handles the emission of rewards based on gauge weights.
GaugeFactoryV2 Contract
TheGaugeFactoryV2 contract is responsible for creating and managing gauges. It includes functions for:
- Creating new gauges
- Managing emergency modes
- Setting reward parameters
- Updating gauge configurations
Key Functions
Using Gauges
Creating a New Gauge
To create a new gauge for a liquidity pool:- Call
createGaugeV2on the GaugeFactoryV2 contract. - Store the returned gauge address for future reference.
Voting on Gauges
Users with locked ve3,3 tokens can vote on gauges:- Implement a voting interface in the frontend.
- Call the voting function on the gauge controller contract.
Distributing Rewards
Rewards are distributed based on gauge weights:- The system calculates gauge weights periodically.
- Rewards are emitted to gauges based on their relative weights.
- Users can claim rewards from gauges they’ve provided liquidity to.
Maintenance and Upgrades
Emergency Mode
In case of critical issues:- Call
activateEmergencyModeon GaugeFactoryV2. - This will pause reward emissions and certain gauge functions.
- Use
stopEmergencyModeto resume normal operations.
Updating Gauge Parameters
To modify gauge settings:- Use the appropriate setter function in GaugeFactoryV2.
- Ensure you have the necessary permissions (GAUGE_ADMIN role).
Integration with Other Components
- ve3,3 Token: Provides voting power for gauge voting.
- Liquidity Pools: Gauges are associated with specific liquidity pools.
- Merkl: Handles efficient reward distribution from gauges to users.