Creating a Stake

When users stake WNM tokens, their tokens are locked (burned) for a specific number of days. During this period, wShares are created to represent the user’s stake. These wShares accumulate rewards in the form of WNM, WBLK, WUNI, and WNT.
wShares Calculation Formula:
The number of wShares created depends on several multipliers and factors as defined in the _calculatewSharesToReceive
function:
function _calculatewSharesToReceive(address owner, uint256 _amount, uint256 _stakingdays, uint256 _wblkamount, bool isAirdrop) private view returns (uint256) {
uint256 stakingdaysMultiplier = _calculateDaysMultiplier(_stakingdays);
uint256 wblkbonus = _calculateWBLKBonus(_wblkamount);
uint256 xenbonus = _calculateXENBonus(owner);
uint256 wShares = _amount * wblkbonus * xenbonus * stakingdaysMultiplier / wsharePrice / 10;
uint256 wSharesWithBonus = wShares * 110 / 100; // 10% bonus for airdrop stake
if (isAirdrop) {
return wSharesWithBonus;
} else {
return wShares;
}
}
# Main Formula
wShares =
(WNM_staked
× stakingdaysMulitplier
× wblkbonus
× xenbonus)
/ ( wSharePrice ← starts at 200 and rises by 1 every WEN Day
* 10 ) ← scaling factor used inside the contract
WNM_staked: Amount of WNM tokens being staked (must be at least 1 WNM)
wblkbonus: Bonus based on the amount of W.BLK locked
xenbonus: Bonus based on the amount of XEN burned
stakingdaysMultiplier: Multiplier based on the staking duration
wSharePrice: Starts at 200 and increases by 1 each day
10: Scaling factor used in the contract
W.BLK Bonus Multiplier
The W.BLK bonus is determined by the _calculateWBLKBonus
function:
function _calculateWBLKBonus(uint256 _amount) internal pure returns (uint256) {
if (_amount >= 100e18) return 25; // 2.5×
if (_amount >= 50e18) return 20; // 2.0×
if (_amount >= 10e18) return 15; // 1.5×
if (_amount >= 1e18) return 12; // 1.2×
if (_amount == 0) return 10; // 1.0×
return 10;
}
Xen Burn Bonus Multiplier
Xen burning is a one-time action per address that permanently increases your staking power. The XEN burn bonus is determined by the _calculateXENBonus function:
function _calculateXENBonus(address owner) internal view returns (uint256) {
uint256 userXENburnt = xenburnt[owner];
return (userXENburnt / minXENamount) * 10 + 10;
}
Where minXENamount = 1000000000 * 1e18
(1 billion XEN)
Staking Duration Multiplier
The staking duration multiplier is determined by the _calculateDaysMultiplier
function:
function _calculateDaysMultiplier(uint256 _days) internal pure returns (uint256) {
uint256 minDays = 7;
uint256 maxDays = 730;
uint256 minMultiplier = 100; // 1.0x
uint256 maxMultiplier = 250; // 2.5x
if (_days <= minDays) {
return minMultiplier;
} else if (_days >= maxDays) {
return maxMultiplier;
}
// Linear interpolation
uint256 multiplier = minMultiplier + ((_days - minDays) * (maxMultiplier - minMultiplier)) / (maxDays - minDays);
return multiplier;
}
Airdrop Bonus
If a stake is created through an airdrop (via the WENBlocksManager), an additional 10% bonus is applied to the calculated wShares:
uint256 wSharesWithBonus = wShares * 110 / 100; // 10% bonus for airdrop stake
wShare Price and Early Adroption Advantage
The wSharePrice starts at 200 and increases by 1 each day through the incrementDay
function:
function incrementDay() public {
require(block.timestamp >= (currentDay * DAY_IN_SECONDS) + launchTimestamp, "24 hours have not passed yet.");
uint256 _day = currentDay + 1;
wsharePrice += 1;
_calculateInflationAmount(_day);
wenblocksmanager.updateDailyPenalty();
}
Staking Process
To create a stake, users call the stake
function:
function stake(address owner, string memory _stakename, uint256 _amount, uint256 _stakingdays, uint256 _wblkamount) external {
if (msg.sender != manageraddress) {
uint256 userBalance = balanceOf(msg.sender);
require(_amount <= userBalance, "DevToken: Cannot stake more than you own");
_stake(msg.sender, _stakename, _amount, _stakingdays, _wblkamount, false);
// Burn the amount of tokens on the sender
_burn(msg.sender, _amount);
} else if (msg.sender == manageraddress) {
_stake(owner, "AIRDROP", _amount, _stakingdays, _wblkamount, true); // If the staker is the WENBlocksManager, then apply bonus staking since that's an AIRDROP
}
}
Requirements for staking:
Staking amount must be at least 1 WNM (
_amount >= 1e18
)Staking period must be between 7 and 730 days (
_stakingdays >= 7 && _stakingdays <= 730
)W.BLK amount must not exceed the user's balance
During staking:
The W.BLK amount is burned using
wblk.burnFrom(owner, _wblkamount)
The WNM tokens are burned using
_burn(msg.sender, _amount)
wShares are calculated and assigned to the stake
The stake information is stored in the contract
Example Calculation
Let's calculate the wShares for a user staking:
100 WNM for 365 days
With 50 W.BLK locked
After burning 2B XEN
On day 1 (wSharePrice = 200)
1. W.BLK Bonus = 20 (2.0×) for 50 W.BLK 2. XEN Bonus = 30 (3.0×) for 2B XEN 3. Staking Days Multiplier = ~175 (1.75×) for 365 days 4. wSharePrice = 200
wShares calculation:
wShares = (100e18 * 20 * 30 * 175) / (200 * 10)wShares = 5.25e21 / 2000wShares = 2.625e18
This means the user would receive approximately 2,625,000,000,000,000,000 wShares.
These wShares then:
Determine the user's proportional share of daily rewards
Are scheduled to expire at the end of the staking period
Cannot be transferred or traded
Last updated