BNB staking mechanics
BNB Liquid Staking lets the user stake their funds through the corresponding smart contracts on the Binance network, accumulate rewards, and receive their stake and rewards when unstaking.
The following section explains staking requirements, fees, rewards, validators, smart contracts and function calls to interact with these smart contracts.
Requirements
The requirements when staking are:
-
Minimum value to stake — 1.002 BNB (the 0.002 part is the relayer fee added on top of 1 BNB).
-
Maximum value to stake — unlimited, at the user’s discretion.
The requirements when unstaking are:
-
Minimum value to unstake — 1 BNB.
-
Maximum value to unstake — up to the initial stake+accumulated rewards for aBNBb; up to the initial stake for aBNBc.
-
Release time — 7-14 days.
Fees
-
Ankr takes 5% of the Liquid Staking rewards as a base fee.
-
When staking, the user pays the relayer fee — 0.002 BNB, which is a fee for transferring assets between BNB Chain (prev. Binance Chain) and BNB Beacon Chain (prev. Binance Chain).
-
When unstaking, the user pays nothing, while Ankr pays:
-
Unbonding transaction fee (undelegate_fee) — 0.004 BNB.
-
Cross-chain transaction fee (transfer_out_fee) — 0.000075 BNB.
-
The user must also count in the gas price for outgoing transactions.
Rewards
Validators receive rewards every day, at midnight, UTC.
The APY is calculated from the validators' rewards.
The rewards the user gets are calculated using the exchange ratio explained later in this document.
To understand BNB Liquid Staking, you need to know the entities and understand the workflow under the hood.
The following entities are involved:
- Smart contracts
- Ankr addresses
- Ankr validators
Smart contracts
BinancePool Implementation and BinancePool Proxy — contracts on BNB Chain where the user sends their initial staking or unstaking request.
aBNBb Proxy — contract on BNB Chain that mints or burns aBNBb tokens for the user in 1:1 rate with the staked amount. All interactions go through the Proxy part.
aBNBc Proxy — contract on BNB Chain that mints or burns aBNBc tokens for the user. All interactions go through the Proxy part.
TokenHub — contract on BNB Chain that makes cross-chain transfers between BNB Chain and Binance Chain.
Intermediary address — address of the BNB backend service on Binance Chain that:
-
When staking, receives the staked funds from BinancePool to send to the validators.
-
When unstaking, receives the unstaked funds to later crosschain-send it to the operator address.
Operator address — address of the BNB backend service on BNB Chain that:
- When unstaking, receives the unstaked funds+rewards to send to stakers.
Validators
Staking workflow
-
User sends a request to the
BinancePool::stake({value:stake+relayer_fee})
on BNB Chain.stake
specifies the staked amount and should meet the requirements described above, whilefee
specifies the fee deducted from the user’s wallet for the staking. -
BinancePool
verifies the request checking theminimal_stake_value
and the user-paidrelayer_fee
, executesTokenHub::transferOut()
to make a cross-chain transaction to Binance Chain, mints either aBNBb to the user 1:1 to the staked BNB or aBNBc in the amount defined by the current exchange ratio, and then issues aStaked()
event with thesender
,stake
,intermediary
parameters.- Actual minting is internal and is done via a call from
BinancePool
toaBNBb::mint(userAddress, stake)
/aBNBc::mint()
.
- Actual minting is internal and is done via a call from
-
BNB backend service detects the issued
Staked()
event and creates a record in its Postgres database, then waits for the successful cross-chain transaction completion to Binance Chain, which usually takes around 45s. -
Upon transaction completion, the staked amount ends up at
intermediaryAddress
— the BNB backend service address on Binance Chain. Then the BNB backend service executessendDelegation(validatorAddress, stake)
on Binance Chain to send the stake tovalidatorAddress
of one of the validators from the Ankr set.
Exchange ratio
When staking, the user receives:
- aBNBb 1:1 to the staked amount.
- aBNBc in the amount calculated the following way:
user's_stake * exchange_ratio
.
When unstaking, the user receives their_stake + accumulated_rewards
in BNB.
It is calculated by the following formula: accumulated_amount_of_aBNBb_or_aBNBc / exchange ratio
.
The exchange ratio is calculated by the following formula:
uint256 totalShares = totalSharesSupply(); == aBNBc.totalSupply();
uint256 denominator = _totalStaked + totalRewards - _totalUnbondedBonds;
_ratio = (totalShares * 1e18) / denominator;
Unstaking workflow
Unstaking aBNBc adds an additional approval step — Step 1. Unstaking aBNBb workflow starts from Step 2.
-
For aBNBc only, the user sends a request to the
aBNBc::approve(aBNBb.address, amount)
to let theaBNBb
smart contract transfer the user's Liquid tokens. -
User sends a request to the
BinancePool::unstake(amount)
on BNB Chain.amount
specifies the amount to be released back to the user. -
BinancePool verifies the request checking the
minimal_stake_value
andbalance_of_user
, then executesaBNBb::burn()
to burn the bond tokens that are equivalent to the initial stake+accumulated reward. ThenBinancePool
issues anUnstakePending()
event with the staker and amount parameters. -
BNB backend service detects the
UnstakePending()
event and creates a record in Postgres database, then starts to check the database for newUnstake
requests every day at 00:00. If it finds a newUnstake
request, it executessideChainUnbond(bsc, validatorAddress, totalPendingAmount)
on the Binance Chain wheretotalPendingAmount
specifies the aggregate pending amount to unstake for different users andvalidatorAddress
specifies the address of one of the validators from the Ankr set to gettotalPendingAmount
from. -
After the
UnbondTime
,intermediaryAddress
receivesundelegated(unbonded)
funds. Then the BNB backend service makes a cross-chain transaction tooperatorAddress
on BNB Chain. -
Upon the cross-transaction completion, the unstaked amount ends up at
operatorAddress
. Then the BNB backend service executesBinancePool::distributeRewards({value: totalPendingAmount})
on BNB Chain to distribute stakes and rewards to the users.
Additional information
Additional details To get more information about staking on Binance, read Staking, Delegating, and Binance cross-chain transfer.
To get more information about unstaking on Binance, read Unbond and Binance cross-chain transfer.