Resource reclamation upon undelegation
When a delegator undelegates resources, the network reclaims a proportional amount of the recipient's unrecovered resources. This page covers the formula and a worked example.
Prerequisites
When a delegator undelegates resources from a recipient, the network reclaims not just the staked TRX share, but also a proportional amount of the recipient's unrecovered resources — resources the recipient has used and is still in the 24-hour recovery window for. This page explains the formula and shows a worked example.
Why this happens
In the TRON network, the amount of resources an account receives depends on the proportion of its TRX staked relative to the total TRX staked across the entire network.
When a delegator delegates resources to a recipient, it essentially lends a portion of its own staked TRX to the recipient. In resource quota calculations, the system does not distinguish between the sources of TRX. TRX staked by the account itself and TRX delegated from other accounts are aggregated and treated uniformly as the weighting basis for resource allocation.
Based on this mechanism, unless otherwise specified, the term "staked amount" in this document refers to the total staked TRX of an account, including both self-staked TRX and TRX delegated from other accounts, without distinguishing their sources.
Reclamation logic for unrecovered resources
When the delegator initiates an undelegation, the network proportionally reclaims the recipient's unrecovered resources based on the amount of TRX being undelegated.
Calculation formula
Reclaimed unrecovered resources
= (Canceled delegated TRX amount ÷ Recipient's total staked TRX amount for that resource)
× Recipient's unrecovered resource amountThe reclaimed unrecovered resources must not exceed the maximum resource capacity corresponding to the undelegated TRX amount, calculated in real time based on current network-wide staking.
The fields involved:
- Canceled delegated TRX amount — the amount of staked TRX reclaimed in the cancel-delegation transaction.
- Recipient's total staked TRX amount for that resource — the total staked TRX used by the recipient to obtain a specific resource (Energy or Bandwidth), including self-staked TRX (Stake 1.0 and Stake 2.0) and delegated TRX from others. Query via
wallet/getaccount. - Recipient's unrecovered resource amount — the amount of resources that have already been consumed and are currently in the 24-hour recovery window on the recipient's account. Query via
wallet/getaccountorwallet/getaccountresource.
Account state changes
After undelegation, the effective resource-related states of both accounts change as follows. The expressions describe the changes at a logical level — "staked amount" represents a computed value rather than a single on-chain field.
Delegator:
Staked amount = Original staked amount + Canceled delegated TRX amount
Unrecovered resource amt = Original unrecovered resource amount + Reclaimed unrecovered amountRecipient:
Staked amount = Original staked amount − Canceled delegated TRX amount
Unrecovered resource amt = Original unrecovered resource amount − Reclaimed unrecovered amount
Recovery dynamicsResources recover linearly over a 24-hour period. If an account uses resources again or has resources reclaimed during this period, the system merger the existing recovery progress and the new recovery cycle.
Worked example
Assume the current network resource conversion ratio is 1 TRX staked = 0.2 Energy, and the total network staking remains unchanged. User X delegated 200 TRX worth of Energy to User Y. Before the delegation is canceled, the account states are:
| Account | Role | Total Staked TRX (for Energy) | Total Energy | Unrecovered Energy |
|---|---|---|---|---|
| X | Delegator | 1,000 TRX | 200 Energy | 75 Energy |
| Y | Recipient | 500 TRX | 100 Energy | 50 Energy |
When User X cancels the Energy delegation of 200 TRX to User Y:
Reclaimed unrecovered Energy = (200 / 500) × 50 = 20 EnergyAfter reclamation:
| Account | Role | Total Staked TRX (for Energy) | Total Energy | Unrecovered Energy |
|---|---|---|---|---|
| X | Delegator | 1,200 TRX (1,000 + 200) | 240 Energy | 95 Energy (75 + 20) |
| Y | Recipient | 300 TRX (500 − 200) | 60 Energy | 30 Energy (50 − 20) |
The recipient's unrecovered Energy decreased by exactly the reclaimed amount (50 → 30), and the delegator's unrecovered Energy increased by the same amount (75 → 95). The TRX share moves back from recipient to delegator (500 → 300 for Y; 1,000 → 1,200 for X).
Related resources
- Delegating resources — the operation this page describes the cleanup for
- Resource model — Bandwidth and Energy regeneration mechanics
- HTTP API — undelegateresource
- HTTP API — getaccount
- HTTP API — getaccountresource
Updated 8 days ago