Remove Delegation
Theory walkthrough of removing a delegation and claiming delegation rewards
Removing a Delegation
Delegators can remove their delegation to retrieve their staked tokens and claim earned rewards. The delegation removal follows a similar three-phase pattern to all other staking operations.
Phase 1: Initiation (L1)
The delegator calls initiateDelegatorRemoval(delegationID) on the Staking Manager contract.
Under the hood, the contract:
- Verifies the caller is the delegation owner
- Ensures the minimum stake duration has passed
- An uptime proof may optionally be provided to determine reward eligibility
- Sets the delegation status to
PendingRemoved - Calculates the new validator weight (minus the delegation weight)
- Enforces churn constraints
- Sends a
L1ValidatorWeightMessageto update the validator's weight on the P-Chain
Uptime Proof: Similar to validator removal, including an uptime proof when removing a delegation can result in more accurate reward calculations based on the validator's actual uptime performance.
Phase 2: P-Chain Processing
The weight update is signed and submitted to the P-Chain as a SetL1ValidatorWeightTx:
- Aggregate signatures for the weight update message
- Submit to the P-Chain
- The P-Chain acknowledges the weight reduction
- Returns a signed
L1ValidatorWeightMessageacknowledgement
Phase 3: Completion (L1)
Call completeDelegatorRemoval(messageIndex) with the P-Chain's signed response:
- Verifies the Warp message and nonce correspondence
- Calculates delegation rewards based on uptime
- Deducts the delegation fee (paid to the validator)
- Returns the delegated tokens to the delegator
- Distributes delegation rewards (minus the fee)
- Sets the delegation status to Completed
- Emits
CompletedDelegatorRemoval
Reward Distribution
When a delegation is removed, the reward calculation takes into account:
- Uptime - Higher validator uptime = higher rewards
- Delegation fee - The validator's configured fee percentage is deducted from delegation rewards
- Staking duration - Longer staking = more accumulated rewards
delegatorReward = totalReward * (1 - delegationFeeBips / 10000)
validatorFee = totalReward * (delegationFeeBips / 10000)The validator's share (delegation fee) is not sent immediately — it accumulates and must be claimed separately via claimDelegationFees.
Edge Case: Validator Removal During Delegation
If a validator initiates removal while delegations are still active:
- Pending delegations may or may not be completable depending on whether the P-Chain processed the delegation weight change before the validator removal
- Active delegations must be removed before the validator removal can be completed
- The contract handles the ordering carefully to ensure no funds are lost
Appendix: Delegation Removal Flow
Is this guide helpful?


