Distinguish pending and finalizable Tezos unstake requests
Requesting an unstake starts a protocol process. A portfolio can overstate a user’s immediately transferable balance if it merges pending, finalizable and liquid balances.
Reconstruct three separate balances
Collect the liquid balance and the protocol’s unstake information at the same block. In this illustrative snapshot, eight tez are still waiting and three have reached finalizability.
liquid = 20 tez
pending unstake = 8 tez
finalizable unstake = 3 tez
The account currently has twenty liquid tez before fees. Finalizing eligible requests can release the three tez, while the other eight remain subject to the applicable waiting and slashing rules. Display eligible and pending amounts separately.
Confirm the finalization outcome
Use the active protocol’s finalize_unstake mechanism or account for an operation that finalizes implicitly under that protocol. Re-read balances after successful inclusion. Cycle boundaries and protocol changes make a hard-coded wall-clock release date unreliable. octez.tezos.com Octez protocol documentation