OGV and veOGV are the governance and staked governance tokens for Origin Dollar (OUSD) which is a leading DeFi protocol on the Etherum blockchain. Refer to the OUSD docs for more details on how the OUSD protocol uses OGV and veOGV.
Characteristics
Curve Finance pioneered the concept of vote-escrowed token when they released their veCRV implementation.
veOGV's innovation resides in using an exponential decay as opposed to the linear decay used by veCRV. This allows us to significantly reduce the complexity of the smart contract logic (veOGV is 175 loc), unlocks functionality such as vote delegation and minimizes gas consumption.
Here are the key characteristics of veOGV:
- ERC20
- Open Zeppelin ERC20Votes compatible
- Vote delegation
- Configurable rewards token distribution
veOGV, offers several advantages over veCRV. A trade-off is that is that with veOGV the voting power does not decay down to zero. It is a side effect of using exponential decay vs linear decay.
Attribute | veOGV | veCRV |
---|---|---|
ERC20 | Yes | Yes |
Snapshot | Yes | Yes |
Vote delegation | Yes | No |
Built-in rewards distribution | Yes | No |
Solidity smart contracts | Yes | No (vyper) |
Residual voting power at the end of the staking | No | Yes |
Exponential voting power decay
The amount of veOGV allocated in return for staking OGV is calculated using this formula:
veOGV = OGV * k^y
- veOGV is the amount of veOGV minted
- OGV is the amount of OGV staked
- k is a constant (for veOGV we chose a value of 1.8 but it is configurable)
- y is the end date of the staking, as a timestamp in second
This has the following properties:
- After staking OGV, the staker's veOGV balance remains constant.
- The voting power decay happens via dilution as additional veOGV tokens are minted when new stakes occur.
- The voting power of a staker relative to the othe stakers remains constant until a new stake or unstake event occurs.
Examples of Linear voting power decay
Notice how the calculation of the relative power becomes fairly complicated... and this is just for 4 users! With hundreds or thousands of users it requires non-trivial computation which is challenging to do on-chain.
Examples of Exponential voting power decay
A key property about exponential decay is that the percentage of voting power remains contant and only changes when a new staking or unstaking event takes place.
Notice how simpler the calculation of relative voting power becomes vs linear decay. One (worth the trade-off!) limitaton is that there is residual voting power after a user's stake expires.
Rewards
veOGV includes a baked-in functionality to distribute rewards to the stakers. The rewards are in the form of extra OGV that are awarded relatively to the percentage of veOGV a staker holds.
The rewards schedule is configurable in tranches. A tranche is defined by a time window and amount of OGV rewards to distribute per day in said tranche. The stakers can collect their rewards at anytime.
The distribution of rewards is optional and can be turned off if desired.
As an example, here is how we configured the reward schedule for veOGV:
Implementation
The smart contract implementation is structured into 3 compact contracts with less than 400 lines of code in total!
- GovernanceToken.sol: The OGV ERC20 token.
- OGVStaking.sol: The veOGV implementation. Including staking, unstaking and rewards collection.
- RewardsSource.sol: The logic related to the calculation and minting of rewards (in the form of extra OGV) for stakers.
Gas usage
The veOGV implementation is optimized for low gas consumption.
Operation | Gas usage in gwei |
---|---|
Stake | 257k |
Unstake and collect rewards | 104k |
Extend stake | 174k |
Delegate | 102k |
Security
veOGV smart contracts were audited by Open Zeppelin. The audit report can be found here.
Using OGV and veOGV for your project
OGV and veOGV token implementation is meant to be generic - there is no code specific to Origin Dollar. Refer to the README for step by step instructions to deploy your own vote-escrowed governance token.
Reach out on Origin Protocol Discord if you have any questions or need help!