For Developers
Flash Unstake
BNB Flash Unstake

BNB flash unstake

Ankr provides an additional opportunity to operate its LSTs by introducing a flash unstake feature. This feature significantly decreases the unstake time — the user receives their unstaked BNB in the same transaction. For this convenience, Ankr charges the user an additional flash unstake fee, subtracting it from the unstaked amount. Flash unstake is implemented via a pool — the same BNBStakingPool that provides functionality for Binance Liquid Staking.


  • Min amount to unstake — 0.1 BNB.
  • Max amount to unstake — up to the capacity of the pool, as flash unstake is performed via a pool swap (ankrBNB to BNB).
  • Unbond time — none, the unstaked BNBs are instantly released to the user's address.
  • Splitting amounts larger than the pool capacity — not possible, the user will have to use the classic version of BNB unstake.

Smart contracts

  • BNBStakingPool — the main entry point to BNB Liquid Staking; stake, unstake, flash-unstake, etc.
  • ankrBNB (proxy) — the Liquid Staking token (ankrBNB) contract; mint or burn ankrBNB tokens for the user.






Get the minimum unstake value.


ankrBNB.sharesToBonds(unit256 amount)

Get the initial amount of BNB (before the flash-unstake fee subtraction) for the user to receive when flash-unstaking. You can use it to calculate the final BNB amount, for example:

uint256 amount = ankrBNB.sharesToBonds(shares);
// calculate the amount of BNB with no flash unstake fee

uint256 unstakeFeeAmt = (amount * _flashUnstakeFee) / _FEE_MAX;
// Calculate the flash unstake fee; _FEE_MAX is 10000

amount -= unstakeFeeAmt;
// Calculate the final amount of BNB the user gets after the fee subtraction

amount (uint256, required) — amount of ankrBNB to convert to BNB.


await BNBStakingPool.getFlashUnstakeFee()

Get the flash unstake fee.


await BNBStakingPool.getFlashPoolCapacity()

Get the current flash pool capacity.


BNBStakingPool.swap(uint256 shares, address receiverAddress)

Perform a flash unstake. You can use it this way:

const tx = await BNBStakingPool.swap(uint256 shares, address receiverAddress);
  • shares (uint256; required) — the amount of ankrBNB to flash unstake.
  • receiverAddress (address; required) — the user's address to release the unstaked BNB to.