Vote-escrowed DEFE (veDEFE)
Last updated
Last updated
DEFE is a governance token and a utility token; In order for a DEFE holder to receive both governance and utility benefits, DEFE must be locked for a period of time and converted to veDEFEs.
The veDEFE is non-tradable and only cab is unlocked while the period expires. The user's voting power , which means the number of veDEFEs, will be decreasing linearly since the moment of lock. In order to avoid periodic check-ins, each time the holder locks, unlocks, or changes the locktime (longer), the smart contract records and updates the slope and bias of the user's linear function in the user_point_history. At the same time, the Defed Protocol updates the slope and bias of the veDEFE's total voting power and records the change of the slope and bias in point_history. Besides, when user’s lock is scheduled to end, we schedule change of slopes of W(t) in the future in slope_changes. All the possible expiration times of veDEFEs are rounded to whole weeks to make number of reads from blockchain proportional to number of missed weeks at most, not number of users (which can be potentially large) .Through this, Defed Protocol can calculate without having to cycle through all holdings.
Slopes and biases will only change when the user deposits, locks DEFE, and the veDEFEs locktime expires. All the possible expiration times are rounded to whole weeks to make number of reads from blockchain proportional to number of missed weeks at most, not number of users (which can be potentially large)See formula below for veDEFEs exchange results.
Parameter
Description
weight
amount of DEFE
locktime
max locktime, 4 years
remaining locktime