The Curvance Points System is a core component of the protocol's voting escrow (veCVE) mechanism, providing the foundation for governance voting power and reward distribution. Rather than using raw locked token amounts, Curvance implements a "points" system to track user influence and manage the distribution of protocol rewards.
Technical Implementation
Points System Architecture
The points system consists of several interconnected mechanisms that track both individual and aggregate protocol state:
Copy chainPoints : uint256 // Total points on the chain
userPoints : mapping ( address => uint256 ) // Points per user
chainUnlocksByEpoch : mapping ( uint256 => uint256 ) // Points unlocking in each epoch
userUnlocksByEpoch : mapping ( address => mapping ( uint256 => uint256 )) // User points unlocking by epoch Regular vs. Continuous Locks
Locks exist in two modes:
Regular Locks: Fixed-duration locks (1 year/26 epochs) with 1:1 point ratio
Continuous Locks: Auto-renewing locks with CONTINUOUS_LOCK_VALUE (max uint40) as unlockTime and a 2x point multiplier
Points Calculations
The continuous lock multiplier is defined as:
CL_POINT_MULTIPLIER = 2 // 200% of base points
Points calculation for continuous locks:
_getCLPoints(basePoints) => CL_POINT_MULTIPLIER * basePoints
Points State Machine
The points system's state evolves through these main operations:
Creating Locks: Adds points to user and chain totals
Extending Locks: Updates unlock schedule and potentially modifies points
Unlocking: Removes points when locks expire
Early Unlocking: Removes points with penalty
Changing Lock Mode: Toggles between regular and continuous lock
Internal functions managing this state:
User-Facing Functions
Creates a new voting escrow position by locking CVE tokens.
Function signature:
Amount of CVE tokens to lock
Whether to enable continuous lock mode
Data structure for reward claiming
Additional parameters for rewards processing
Extends an existing lock with additional tokens.
Function signature:
Index of the lock to extend
Additional amount to lock
Data structure for reward claiming
Additional parameters for rewards processing
updateLockMode()
Toggles a lock between regular and continuous lock modes.
Function signature:
Index of the lock to update
Whether to enable or disable continuous lock mode
Data structure for reward claiming
Additional parameters for rewards processing
Combines multiple locks into a single new lock.
Function signature:
Whether the combined lock should be continuous
Data structure for reward claiming
Additional parameters for rewards processing
Unlocks tokens from an expired lock.
Function signature:
Index of the lock to unlock
Data structure for reward claiming
Additional parameters for rewards processing
Unlocks tokens before the lock expires, with a penalty.
Function signature:
Index of the lock to unlock early
Data structure for reward claiming
Additional parameters for rewards processing
queryUserLocks()
Returns all locks for a specific user.
Function signature:
Address of the user to query
Return Values:
expiry dates or CONTINUOUS_LOCK_VALUE
Returns the voting power (points) of a user.
Function signature:
Address of the user to query
Return values:
Total voting power (points) of the user
Points Lifecycle
Regular lock: +1 point per token, scheduled to unlock in 1 year
Continuous lock: +2 points per token, no scheduled unlock
For continuous locks, increases points by 2x the additional amount
For regular locks, increases points by 1x the additional amount
Regular → Continuous: Increases points by 1x the locked amount, removes scheduled unlock
Continuous → Regular: Decreases points by 1x the locked amount, adds scheduled unlock
Removes points based on lock mode (1x for regular, 2x for continuous)
For regular locks, also updates the epoch unlock schedule
Same point reduction as normal unlock
Applies penalty to returned tokens
Implementation Notes
The points system is synchronized with epochs to ensure rewards are correctly distributed
State-changing operations are restricted around epoch transitions (RESTRICTION_DURATION = 12 hours)
Multichain support allows locks to be transferred between chains
Continuous lock mode provides higher rewards but the same amount of locked tokens
Last updated 11 months ago