Skip to content
Finality

Crypto protocol and market news

What a Contract Energy Ratio Actually Controls

A contract energy ratio sets the caller’s share of TRON execution costs, but deployer limits and depleted Energy can shift the bill back to the caller.

The Finality Desk4 min read#bbea7d

Cover artwork for What a Contract Energy Ratio Actually Controls

A contract energy ratio sets how a smart-contract call’s Energy cost is divided between the caller and the contract deployer. On TRON, the protocol expresses that split with the contract setting consume_user_resource_percent: the value is the percentage assigned to the caller, and the deployer is assigned the remainder. It allocates a bill; it does not reduce the Energy needed to run the contract’s instructions.

What does a contract energy ratio measure?

It measures each side’s agreed share of a call’s Energy cost. Energy is the TRON Virtual Machine’s unit for computational work, and a call consumes it as the VM executes contract instructions. The total depends on the work performed; it is not a fixed fee set by the ratio.

The setting is an integer from 0 to 100. At 100, the caller is assigned all the Energy cost. At 0, the deployer is assigned all of it, subject to the deployer’s limits and available Energy. A value of 30 assigns 30% to the caller and 70% to the deployer. The setting belongs to the contract, so its split applies to calls by different users.

The ratio is separate from how either side obtains Energy. A caller can use Energy from staking or delegation, then TRX is burned if the caller’s share exceeds available Energy. Deployer-paid Energy comes from the deployer’s available Energy. For the separate question of how Tron Energy is staked, rented, or burned, see the guide to those resource paths. None of those funding methods changes the contract’s percentage setting.

How does TRON apply the ratio to a call?

TRON first determines the Energy consumed by execution, then calculates the caller’s and deployer’s theoretical shares using consume_user_resource_percent. The deployer’s actual contribution is limited by its available Energy and the contract’s origin_energy_limit, a per-call cap on how much Energy the deployer will cover. Any part of the deployer’s theoretical share that cannot be covered falls to the caller.

For example, if a call consumes 80 Energy and the caller percentage is 60, the theoretical split is 48 Energy for the caller and 32 for the deployer. If the deployer can cover only 10 Energy, the caller bears the remaining 70: its 48-share plus the uncovered 22. The caller first spends available Energy, then burns TRX for any shortfall.

This means a published ratio is not a promise that the deployer will pay that exact amount on every call. Its share can be smaller when the deployer hits origin_energy_limit or runs short of available Energy. The caller’s fee_limit sets a separate ceiling on the caller’s Energy budget for that transaction. If the caller cannot cover its resulting share within that budget, execution can fail with OUT_OF_ENERGY.

Who can change the contract energy ratio?

The contract deployer sets consume_user_resource_percent at deployment and can update it later with the wallet/updatesetting transaction. A caller cannot change the split for an individual call. An update governs subsequent calls; transactions already in flight use the setting they encountered before the update took effect.

The deployer should choose the percentage alongside origin_energy_limit and the Energy it can keep available. A low caller percentage can reduce the upfront resource burden on users, but it shifts more variable usage to the deployer. If the deployer’s balance cannot sustain that subsidy, callers may pay more than the nominal split suggests.

  • Caller percentage: the share of the theoretical Energy cost assigned to the account making the call.
  • Deployer percentage: the remainder, subject to the deployer’s per-call cap and available Energy.
  • fee_limit: the caller-side transaction budget, which does not set the contract’s sharing percentage.
  • Dynamic Energy: a contract’s effective Energy cost can change with network usage, so the ratio may apply to a different total on a later call.

How should callers and deployers use the ratio?

Callers should inspect the deployed setting, origin_energy_limit, and their own available Energy before treating a call as subsidized. A low caller percentage describes the intended allocation; it does not prove that the deployer has enough Energy to cover its part. For a transaction the caller submits, fee_limit is the direct control on how much caller-side Energy the transaction can consume.

Deployers should set a percentage their Energy reserve and per-call cap can support under real demand. A generous subsidy can remove friction for users, but a depleted reserve shifts the uncovered share back to them. The useful reading of a contract energy ratio is therefore two-part: it shows the planned cost split, while the cap and each payer’s available Energy determine the amount each side actually covers.