VChainMinter
Responsible for distributing VRSW and veVRSW tokens to pools according to allocation points
On VirtuSwap v1, distribution protocol inflation between pools is facilitated by the Minerva Liquidity Optimization Engine. Every epoch, Minerva calculates the optimal distribution of liquidity between the pools, and distributes the protocol reward allocation points between pools with the goal of achieving such distribution of liquidity.
Minerva calculations are done in a centralized way off-chain, and will be gradually moved a to a decentralized solution in later versions. Read more about Minerva here.
vChainMinter contract receives VRSW tokens minted by vGlobalMinter, and distributes them between vStaker instances (each representing a VirtuSwap pool) according to allocation points.
Events
event NewStaker
Emitted when a new Staker instance is set.
event TransferRewards
Emitted when pool rewards are transferred to an address
State-Changing Functions
function setEpochParams
Changes minting epoch duration and preparation time. A minting epoch is the time period between changes in distribution of rewards between VirtuSwap pools. Default is 4 weeks.
The Epoch Preparation Time is the time window before the start of the epoch in which it is allowed to transfer the rewards for the upcoming epoch. Default is 1 week.
✏️Can only be called by the owner
✏️Should be in sync with Epoch Params set to vGlobalMinter
Parameters:
_epochDuration
uint32
Epoch duration (in seconds)
_epochPreparationTime
uint32
Amount to transfer
function prepareForNextEpoch
Accepts transfer of necessary amount of VRSW tokens for the next epoch according to the Emission Schedule. Currently the transfers are done manually using intermediary wallet (contracts owner).
✏️Can only be called by the owner
Parameters:
nextBalance
uint256
Amount transferred to be distributed to vStaker contracts during the next epoch
function transferRewards
Allows a the Staker to transfer a specified amount of rewards tokens to a recipient address. The recipient is an LP in the pool that is identified by address of its LP token.
Can only be called by the Staker.
Emits the TransferRewards event.
Parameters:
to
address
Address of the recipient LP
lpToken
address
Address of the LP token of the pool
amount
uint256
Amount to be transferred
function setAllocationPoints
Defines the proportion in which the protocol emission is distributed between VirtuSwap pools contracts.
✏️Can only be called by the owner
Parameters:
_lpTokens
address
Array of addresses of the LP Tokens of pools to which allocation points are assigned
_allocationPoints
uint256
Array of allocatoin points assigned to the corresponding pool in _lpTokens array
function mintVeVrsw
Mint a given amount of veVrsw tokens to the specified to address.
✏️Can only be called by the Staker
Parameters:
to
address
Address of the recipient
amount
uint256
Amount to be transferred
function burnVeVrsw
Burn a given amount of veVrsw tokens from the specified to address
✏️Can only be called by a Staker
Parameters:
from
address
Address to transfer veVRSW to be burned
amount
uint256
Amount to be transferred
function setStaker
Sets the Staker instance.
Emits NewStaker event
✏️Can only be called by a Owner
Parameters:
from
address
Address to transfer veVRSW to be burned
amount
uint256
Amount to be transferred
function calculateTokensForPool
Calculates the total amount of tokens available for a pool represented by the LP Token address
Parameters:
lpToken
address
address of the LP Token belonging to the target pool
Read-only Functions
emissionStartTs
Returns the timestamp when VRSW emission began.
Last updated