> ## Documentation Index
> Fetch the complete documentation index at: https://docs.near.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Sunsetting a Staking Pool

> Wind down a staking pool, pause staking, and help delegators withdraw their tokens.

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**.
3. Call `withdraw_all` to retrieve their tokens.

Share the [unstaking and withdrawal commands](/protocol/tutorials/staking-tokens.md#withdrawing-staked-tokens) with your delegators.

***

## 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.

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
near call <my_validator> pause_staking '{}' --useAccount <owner-account.near> --depositYocto 1 --networkId mainnet
```

> [!NOTE]
>
> 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:

**Staking CLI**

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
near staking delegation <owner-account.near> withdraw-all <my_validator> network-config mainnet sign-with-keychain
```

**Function Call**

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
near call <my_validator> withdraw_all '{}' --useAccount <owner-account.near> --networkId mainnet
```

***

## Step 4: Resume (Optional)

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

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
near call <my_validator> resume_staking '{}' --useAccount <owner-account.near> --depositYocto 1 --networkId mainnet
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.