If you no longer want to operate your stake pool, then you can deregister the pool. Deregistering the pool retires the pool.
To retire your stake pool, your stake pool does NOT require valid KES keys. However, you must ensure that your nodes are fully synchronized with the blockchain.
the earliest epoch for retirement is 40 ( current epoch + 1).
the latest epoch for retirement is 57 ( poolRetireMaxEpoch + current epoch).
Let's presume that you want to retire as soon as possible, in epoch 40.
Create the deregistration certificate and save it as pool.dereg. Update the epoch to your desired retirement epoch, usually the earliest epoch or asap.
Pool will retire at the end of your specified epoch. In this example, retirement occurs at the end of epoch 40.
If you have a change of heart, you can create and submit a new registration certificate before the end of epoch 40, which will then overrule the deregistration certificate.
After the retirement epoch, you can verify that the pool was successfully retired with the following query which should return an empty result.
Optionally, de-register the stake key to re-claim your 2 ADA stake deposit.
Important:
Do NOT de-register your stake key before your pool deposit of 500ADA is paid back to your rewards address. Nonreturnable pool deposits are sent to the Cardano treasury.
If there are multiple pool owners, communicate your intention to retire the pool and ensure they do not remove pledge funds until the pool is retired.
As a courtesy to your delegators, provide advanced notice of your intention to retire so that they may re-delegate their stake.