Skip to main content
NEAR uses a Proof-of-Stake (PoS), meaning that users chose the active node validators by delegating their tokens to them. In this article you’ll find a detailed explanation of the staking process, including delegating, viewing balances, and withdrawing using the NEAR CLI.
Contract source codeYou can review the Staking pool smart contract source code in this GitHub repository.

Delegate NEAR tokens

Before delegating, you need to choose a validator (a node that participates in staking). Check NearBlocks, Pikespeak or Near Staking, and look for validators with a good track record, uptime, and reasonable commission rates.
If you prefer, you can get the list of current validators by using the near-validator CLI:

Stake Tokens

You will start earning staking rewards after the next epoch (approximately 12 hours)

Staked Balance

To check your staked balance on the <my_validator> pool for the <user-account.near> account, run the following command:
You can view additional information and balances from the staking pool using the following CLI commands:

Total staked balance of the entire pool

Owner of the staking pool

Current reward fee

Owner’s balance

Staking key


Withdrawing Staked Tokens

To withdraw your staked tokens, you will first need to “un-delegate” them from the validator. Your tokens will enter a 4 epoch (~24 hours) unbonding period before they can be withdrawn.

Unstake Tokens

Use the unstake-all command to to unstake all tokens at once:

Query Unstaked Balance

Withdraw Tokens

Once the unbonding period has passed, you can withdraw your unstaked tokens:
If you want to withdraw all available tokens, you can use the withdraw-all command:

Sunsetting a Stake Pool

If you are a stake pool owner and want to wind down your validator service, follow these steps to ensure delegators can safely recover their funds.

Step 1: Notify Delegators

Before making any changes, inform your delegators that the pool is shutting down. Give them enough time to unstake and withdraw their tokens. They need to:
  1. Call unstake_all on the pool.
  2. Wait for the 4-epoch unbonding period (~48 hours).
  3. Call withdraw_all to retrieve their tokens.
You can share the commands from the Withdrawing Staked Tokens section above with them.

Step 2: Pause Staking

Call pause_staking from the pool owner account. This causes the contract to unstake everything (stake 0) and stop restaking, without affecting share balances or reward calculations.
The contract will unstake all tokens at the next epoch boundary. Delegators will still see their shares and can unstake and withdraw normally.

Step 3: Withdraw Owner Balance

Once your own staked tokens are unstaked and the unbonding period has passed, withdraw them:

Step 4: Resume (Optional)

If you decide to keep the pool running again, you can re-enable staking at any time:

Tools and Resources