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

event NewStaker(
    address staker
);

Emitted when a new Staker instance is set.

event TransferRewards

event TransferRewards(
    address indexed to, 
    address indexed lpToken,
    uint256 amount
);

Emitted when pool rewards are transferred to an address

State-Changing Functions

function setEpochParams

function setEpochParams(
        uint32 _epochDuration,
        uint32 _epochPreparationTime
 ) external override onlyOwner

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:

Name
Type
Description

_epochDuration

uint32

Epoch duration (in seconds)

_epochPreparationTime

uint32

Amount to transfer

function prepareForNextEpoch

function prepareForNextEpoch(
    uint256 nextBalance
) external;

✏️Can only be called by the owner

Parameters:

Name
Type
Description

nextBalance

uint256

Amount transferred to be distributed to vStaker contracts during the next epoch

function transferRewards

function transferRewards(
    address to, 
    address lpToken,
    uint256 amount) 
external override

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:

Name
Type
Description

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

function setAllocationPoints(
  address[] calldata _lpTokens,
  uint256[] calldata _allocationPoints
) external override onlyOwner

Defines the proportion in which the protocol emission is distributed between VirtuSwap pools contracts.

✏️Can only be called by the owner

Parameters:

Name
Type
Description

_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

function mintVeVrsw(address to, uint256 amount) external override

Mint a given amount of veVrsw tokens to the specified to address.

✏️Can only be called by the Staker

Parameters:

Name
Type
Description

to

address

Address of the recipient

amount

uint256

Amount to be transferred

function burnVeVrsw

function burnVeVrsw(address from, uint256 amount) external override

Burn a given amount of veVrsw tokens from the specified to address

✏️Can only be called by a Staker

Parameters:

Name
Type
Description

from

address

Address to transfer veVRSW to be burned

amount

uint256

Amount to be transferred

function setStaker

function setStaker(
        address _newStaker) 
external override onlyOwner

Sets the Staker instance.

Emits NewStaker event

✏️Can only be called by a Owner

Parameters:

Name
Type
Description

from

address

Address to transfer veVRSW to be burned

amount

uint256

Amount to be transferred

function calculateTokensForPool

function calculateTokensForPool(
      address lpToken
  ) external view returns (uint256)

Calculates the total amount of tokens available for a pool represented by the LP Token address

Parameters:

Name
Type
Description

lpToken

address

address of the LP Token belonging to the target pool

Read-only Functions

emissionStartTs

function emissionStartTs() 
external view returns (uint32); 

Returns the timestamp when VRSW emission began.

Last updated