IVirtualLockMultiplierFacet
It defines the basic interface of VirtualLockMultiplier facets.
initVirtualLockMultiplierFacet
Initialization function.
The structure and content of initVirtualLockMultipliersData
are implementation specific.
Parameters
Name | Type | Description |
---|---|---|
initVirtualLockMultipliersData | bytes | The ABI-encoded initialization data. |
setCampaignVirtualLockMultipliers
Setter function for configuring lock multipliers for the specified staking campaign.
Setter functions are executed during the creation process of campaigns.
The structure and content of campaignVirtualLockMultipliersData
are implementation specific.
Parameters
Name | Type | Description |
---|---|---|
campaignId | uint256 | The unique identifier of the targeted staking campaign. |
campaignVirtualLockMultipliersData | bytes | The ABI-encoded data containing the lock multipliers configuration. |
applyVirtualLockMultiplier
Applies the respective lock multiplier to the specified position based on the campaign's configuration and the position's lock period.
Parameters
Name | Type | Description |
---|---|---|
campaignId | uint256 | The unique identifier of the targeted staking campaign. |
nftId | uint256 | The unique identifier of the NFT associated with the position. |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The value of the applied lock multiplier. |
combineVirtualLockMultipliers
Applies to the specified position the calculated combined lock multiplier.
combinedLockMultiplier = (((packetsStaked * currentLockMultiplier) + (packetsRestaked * newLockMultiplier)) / (packetsStaked + packetsRestaked))
Parameters
Name | Type | Description |
---|---|---|
nftId | uint256 | The unique identifier of the NFT associated with the position. |
currentLockMultiplier | uint256 | The value of the lock multiplier currently applied to the position. |
newLockMultiplier | uint256 | The lock multiplier applicable for the restake's lock period. |
packetsStaked | uint256 | The total amount of staked input packets in the current position. |
packetsRestaked | uint256 | The amount of input packets to be allocated during the restake operation. |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The calculated combined lock multiplier value. |
getCurrentLockMultiplier
Retrieves the lock multiplier currently applied to the specified position.
Lock multipliers are scaled by 1e18, allowing for 18 decimal precision.
Parameters
Name | Type | Description |
---|---|---|
nftId | uint256 | The unique identifier of the NFT associated with the position. |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The lock multiplier value currently applied to the specified position. |
getVirtualBalance
Calculates and retrieves the virtual balance of the specified position. The virtual balance is calculated as the position's actual raw balance (staked input packets) multiplied by the applicable amount and lock multiplier.
Parameters
Name | Type | Description |
---|---|---|
nftId | uint256 | The unique identifier of the NFT associated with the position. |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The virtual balance of the position accounting for both any applicable amount and lock multipliers. |
getVirtualBalanceForAmount
Retrieves the virtual amount of packets based on the specified amount of packets and the position's applicable lock multiplier (virtualAmount = amountOfPackets * lockMultiplierApplied).
This function only accounts for any applicable lock multiplier.
Parameters
Name | Type | Description |
---|---|---|
nftId | uint256 | The unique identifier of the NFT associated with the position. |
amountOfPackets | uint256 | The virtual balance of the specified packets accounting only for any applicable lock multiplier. |