What an energy order costs: the price at creation and the price at execution
An energy order carries three totals, and only one of them is what you pay. quoted_total_trx is the price the order was created at. total_trx is its price now, the amount held from your balance for it. charged_trx is what was taken from that hold when the order settled. The first two are equal until we raise a position of the order, which can happen right before we buy that position's energy, when what the cheapest available vendor may charge us leaves less than our minimum margin under the position's price. The difference a raise adds is held from your available balance before the purchase, and total_trx never goes below the quote.
Three totals on one order
All three are TRX amounts written as strings with six decimal places, and charged_trx is null until the order settles.
| Field | What it holds | When it changes |
|---|---|---|
quoted_total_trx | The order's total at creation, the amount the first hold was placed for | Never |
total_trx | The order's price now, the amount the hold stands at | Grows by the difference at each raise; falls again when a volume position's raise is taken back, and never below quoted_total_trx |
price_trx, on each position | That position's price | Grows with each raise of that position; falls back, when a volume position's raise is taken back, to energy_units times the per-unit price its last delivered piece was bought at |
charged_trx | What the order cost once it settled, the amount taken from the hold | null while the order is open; filled in once, when the order settles |
On a completed order charged_trx equals total_trx, raises included. On a partially_completed order it is lower: a volume position is charged for the units that were delivered, at the per-unit price the position stands at when the order settles, and a position that failed inside a batch is not charged at all. On failed and canceled it is zero. The closing events order.completed, order.partially_completed and order.failed carry the same figure, and so does the order's charge row in GET /v1/ledger; a zero leaves no such row.
The order also carries burn_cost_trx: what the same transfer would have cost by burning TRX at the network's rate in effect when the order was created (every change to that rate since 2018). It is informational and never recalculated.
The price is set when the order is created
An order is priced the moment it is created. A transfer position costs its energy_units times the current per-unit price of the lease you chose. A volume position, one that names energy_units instead of a kind, can be priced higher, when gathering that volume on the market at that moment costs more than the current price covers. The hold for the total is placed from available_trx, the part of your balance not already held, and that total is recorded as quoted_total_trx.
Each lease on sale has one current price, recomputed against the market. The pricing page shows the price in force, and thirty days of its hourly history show how it moved across the UTC day. The market page sets our live price beside the rates other vendors publish for the same energy.
When the price is raised at execution
Right before a position is bought, we compare its price with what the cheapest vendor available for that position at that moment may charge us. If that cost leaves less than our minimum margin under the position's price, we raise the position's per-unit price to the lowest whole number of sun that covers the cost with that margin. The raise has a ceiling, a fixed multiple of the per-unit price the order was created at; the multiple is not published. When what that vendor may charge us, plus our minimum margin, still fits under the position's price, the price stays where it is.
The difference is held from your available balance at once, and total_trx and the position's price_trx both grow by it. GET /v1/ledger shows a hold row for the difference with the order's order_id, an order.repriced event goes out, and only after that is the energy bought.
The event's data carries order_id, status (as a rule purchasing), duration_s and three amounts: quoted_total_trx, the same in every order.repriced of one order; previous_total_trx, the order's total before this change; and total_trx, the total after it. The raise is made before the purchase it pays for, so the event is sent before the energy is bought and does not say the energy was bought; that purchase can still fail. order.ready and the closing event follow as usual. Deliveries can arrive out of order, so read the current total_trx from GET /v1/orders/{order_id} instead of adding events up.
An illustration: a five-minute order in mode A for one transfer to an address that already holds USDT, shown after its only position was raised. Its figures are made up for the illustration, and the size of its raise says nothing about how large real raises are. quoted_total_trx still holds the creation price, total_trx and the position's price_trx hold the raised price, and charged_trx is null because the order is open.
{
"id": "9b1d…", "mode": "a", "status": "purchasing",
"duration_s": 300,
"total_trx": "2.405000", "quoted_total_trx": "2.080000",
"charged_trx": null, "burn_cost_trx": "6.500000",
"send_before": null, "fund_before": null, "client_ref": "invoice-42",
"items": [{"id": "…", "from": "TSender…", "to": "TRecipient…",
"kind": "single", "energy_units": 65000, "energy_delivered": null,
"price_trx": "2.405000", "status": "pending",
"txid": null, "error": null}],
"error_code": null, "created_at": "…", "updated_at": "…"
}
A raise is never made on credit
If your available balance is short of the difference, or the raised price would have to go above the ceiling, we do not make the raise and send no order.repriced. The position is then handled as if no vendor sold within its price. A transfer position, one with a kind, is not bought: it ends failed with error: purchase_failed, the part of the hold placed for it comes back in full, and nothing is charged for it, exactly as when no vendor sells at all.
A volume position fails that way only while nothing has been bought for it and allow_partial is off. Otherwise its fill goes on at the price it already stands at and ends short. The units delivered are charged, the rest of the hold comes back, and the order ends partially_completed, or failed if nothing at all could be bought. Delegated energy cannot be returned, so a position that comes up short after its first purchase closes as a short delivery whatever allow_partial says.
A raise is the one way an order comes to cost more than its quote, and we make it only when your available balance covers the difference and the raised price stays within the ceiling. Keep your available balance above what you order if you would rather pay a dearer market than have a position refused or filled short; above the ceiling the position is refused or filled short whatever the balance.
More than one raise, and a raise taken back
A position can be raised more than once, for instance when the vendor it was raised for refuses and the next vendor costs more still. Each raise adds one more hold row with the same order_id and sends one more order.repriced. When a transfer position fails after a raise, because the vendor refused and nobody else sold, the part of the order's hold placed for that position comes back whole as a hold_release, the raise included. The order keeps the raised figure in total_trx, and charged_trx shows what was charged.
A volume position can be raised before its first piece is bought and between pieces. It has one per-unit price, so a raise between pieces also raises the price of the units already delivered. If the fill then ends short without buying anything after the raise, the raise is taken back: the position returns to the per-unit price its last delivered piece was bought at, a hold_release row lowers the hold by the difference, and another order.repriced reports total_trx going down, though never below quoted_total_trx.
Reading an order back from the ledger
Every amount in GET /v1/ledger is positive, and the direction comes from type: hold and charge take funds away, and hold_release gives them back. A hold or hold_release row leaves balance_after_trx unchanged, because a hold reserves money without spending it; it moves available_trx in GET /v1/balance.
One order can leave several rows. The first hold is placed at creation for quoted_total_trx. Each raise adds a hold for its difference, and each raise taken back on a volume position adds a hold_release for its difference. When the order settles, its charge row, where there is one, and its hold_release rows together add up to all of its hold rows. Your own books can check that equation per order_id on every settled order.
What an estimate names
POST /v1/estimate takes up to 500 recipients and reserves nothing. It answers with the price an order would be created with at that moment, and that order can still be raised at execution. For a volume position the per-unit price cannot always be worked out from GET /v1/tariff; the total_trx of an estimate with the same energy_units and duration_s is the price an order with that one volume position would be created with at that moment; in an order with several volume positions, each is priced at least at what an estimate quotes for it alone (the smallest flow from estimate to order).
What we did not measure for this post: how often orders are raised, how large the raises are, and how often a raise is refused for want of balance or because of the ceiling. Everything above except that illustration is the contract as the API reference states it on 13 November 2026, and no live order was placed or read to write it.
See the hold, each raise and the final charge of any order as rows in your own ledger: GET /v1/ledger in the API reference →