Open itxtoledo opened 2 months ago
I've already tried to get the energy and bandwidth prices from the library functions but they always return values that don't seem to make any sense, like 420 for 1 energy (what does that mean?).
The energy unit price is 420 sun.
How to actually calculate the cost of energy and bandwidth needed so that I don't receive errors like send:BANDWITH_ERROR?
Here is a guide about how to estimate energy/bandwidth consumption of a transaction.
Okay converting resources needed to transfer TRX:
bandwidth: 266 sun bandwidth price: 1000 sun
Total: 266000 sun or 0.266 TRX
And how to calculate in TRX if i dont have bandwidth or energy?
Okay converting resources needed to transfer TRX:
bandwidth: 266 sun bandwidth price: 1000 sun
Total: 266000 sun or 0.266 TRX
And how to calculate in TRX if i dont have bandwidth or energy?
thank you
According to this transaction, the real price of energy would be 0.0797 TRX, how did the value of 420 become this? https://tronscan.org/#/transaction/a66fc4ad2f3390cf605f99512c3b002a3354ea74d761fc803c454246cebcfa40
According to this transaction, the real price of energy would be 0.0797 TRX, how did the value of 420 become this? https://tronscan.org/#/transaction/a66fc4ad2f3390cf605f99512c3b002a3354ea74d761fc803c454246cebcfa40
You confused two concepts, one is the energy unit price, the other is the energy resource share.
energy unit price It's about transaction fees. It is the NO.11parameter of the tron network, the fee of 1 unit of Energy, now the value is 420sun (0.00042 TRX). You can view it on tronscan: https://tronscan.org/#/sr/committee For example, if a transaction needs to consume X amount of energy and the account has no energy, then the account needs to pay for a fee of X*0.00042 TRX for energy consumption.
energy resource share Resource share is a measure of the user’s ability to obtain resources from the network resource pool. The TRON network supplies a fixed amount of bandwidth and energy resources every day and allocates resources to users according to the proportion of TRX staked by users. The amount of TRX staked by users to obtain energy/bandwidth resources is the energy/bandwidth resource share. For more detailed information, you can get from here: https://developers.tron.network/docs/resource-model
Energy amount = (energy share / TRX staked for energy in total )* energy supplied in the whole network
So for the delegate energy transaction, in fact it is to delegate how much amount of energy resource share to target address, and the target address will receive the amount of energy corresponding to the energy share.
The transaction you provided is to delegate energy resource share of 755.864975 TRX to destination address:TAJpAf3ZitrUu5NnRjhvHmeKpJfuGrV6kV , and according to the above formula, the destination address will receive about 9400 energy. because the TRX staked for energy in total is changed all the time, so the energy received by the target address also changes in real time.
I've already tried to get the energy and bandwidth prices from the library functions but they always return values that don't seem to make any sense, like 420 for 1 energy (what does that mean?).
How to actually calculate the cost of energy and bandwidth needed so that I don't receive errors like send:BANDWITH_ERROR?