WENBlocks
  • Getting Started
    • Overview
      • Technical Architecture
    • Key Features
  • Staking
    • Overview
    • Creating a Stake
    • Withdrawing the Stake
    • Claiming Rewards
  • Liquidity Program
    • How It Works
  • WNT
    • WNT — The Engine of the WEN Ecosystem
  • Airdrops
    • Airdrop Schedule
    • Server Management
    • Penalty Structure
    • How It Works
    • Example
  • Smart Contracts
  • Security
    • Overview
    • Internal Audits
    • External Audits
    • AI Audits
      • Grok
  • CODE
    • WENBlocksManager.sol
    • wnmContract.sol
    • wblkToken.sol
    • wuniContract.sol
    • wntToken.sol
    • syncnode.py
    • airdropGenerator.js
    • dayTrigger.js
  • Conclusion
    • Conclusion
  • Socials
    • Links
Powered by GitBook
On this page
  • W.BLK Bonus Multiplier
  • Xen Burn Bonus Multiplier
  • Staking Duration Multiplier
  • Airdrop Bonus
  • wShare Price and Early Adroption Advantage
  • Staking Process
  • Example Calculation
  1. Staking

Creating a Stake

PreviousOverviewNextWithdrawing the Stake

Last updated 1 month ago

Minimum Stake Requirement: You must stake at least 1 WNM to create 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.

Important: When you create a stake, your WNM tokens are burned (destroyed). These tokens will be re-minted and returned to you when you withdraw the stake, along with any earned rewards.

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;
}

The W.BLK Bonus tiers are:

  • 0 W.BLK: 1x

  • ≥1 W.BLK: 1.2x

  • ≥10 W.BLK: 1.5x

  • ≥50 W.BLK: 2x

  • ≥100 W.BLK: 2.5x

You may lock any amount of WBLK in a stake. The multiplier plateaus at 100 WBLK (2.5×). Locking more than 100 WBLK does not increase rewards further, but the extra WBLK is still burned (unless the stake comes from an airdrop, see below).

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)

Every billion Xen burned gives a 1x wShare bonus. For example, 5 billion burned Xen gives the user a 5x bonus on their wShares while 50 billion burned Xen gives the user a 50x bonus on their wShares.

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;
}

The staking days multiplier ranges from 1.0× to 2.5× based on duration:

  • 7 days: 100 (1.0×)

  • 365 days: ~175 (1.75×)

  • 730 days: 250 (2.5×)

For any duration between 7 and 730 days, the multiplier increases linearly.

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

All WBLK that accompanies the airdrop is automatically locked (and burned) inside that new stake, up to the 100 WBLK multiplier plateau. No separate approval is needed.

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();
}

This mechanism creates an advantage for early adopters, as the same amount of WNM staked will create more wShares on earlier days when the wSharePrice is lower.

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:

  1. The W.BLK amount is burned using wblk.burnFrom(owner, _wblkamount)

  2. The WNM tokens are burned using _burn(msg.sender, _amount)

  3. wShares are calculated and assigned to the stake

  4. 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:

  1. Determine the user's proportional share of daily rewards

  2. Are scheduled to expire at the end of the staking period

  3. Cannot be transferred or traded

The longer a user stakes, the higher the wShares bonus multiplier applied. The staking days multiplier is calculated using linear interpolation, as follows: