Skip to main content
Chain Media

Protocols, chains and markets, reported

Three Checks to Trace a TRON Swap Output by Hash

A transaction hash identifies the call, but its receipt and token logs show whether a TRON swap succeeded and which wallet received the output token.

The Chain Media Editors5 min read

Three Checks to Trace a TRON Swap Output by Hash

To trace a TRON swap output by hash, inspect the transaction receipt, decode the token transfer logs, and reconcile the output with the pool’s swap event. The hash identifies the outer transaction. It does not, by itself, prove execution succeeded or tell you how much a particular wallet received. Those facts are in the post-execution receipt and the events emitted by the contracts called during the swap.

Start with the transaction body to identify the caller, target contract, and call data. Then retrieve its execution receipt by transaction ID. For pool-level pricing, see how a TRON AMM pool prices a swap; the event checks below establish what happened in one transaction.

What does the transaction hash tell you?

The hash locates a transaction; the receipt tells you whether its smart-contract execution succeeded. Query the transaction body and the receipt using the same ID. The body contains the submitted call and signature. The receipt contains post-execution data, including the result, logs, resource use, and, when recorded, internal transactions.

For a smart-contract swap, confirm that the body calls the expected router or pool contract and that the call data matches the intended operation. A transaction sent to a router may call a pool indirectly, so the body’s target address alone does not identify every contract involved. Then check the receipt result. A `SUCCESS` result means contract execution succeeded; a transaction that is merely present on-chain, or whose body shows a swap call, is not enough.

Use a receipt endpoint that serves solidified transactions when you need a confirmed result. A full-node receipt may be available earlier, while a SolidityNode receipt is limited to solidified transactions. If the transaction is not yet available from the confirmed endpoint, its final status is not established there. Record the transaction ID, block, caller, and result before interpreting any displayed output.

Which token log proves the output amount?

A TRC-20 `Transfer` event identifies a token movement, but only when its emitting contract is the token contract you intend to trace. In the receipt’s `log` array, each entry has an emitting `address`, `topics`, and ABI-encoded `data`. The address identifies the contract that emitted that log. Do not infer the token from the event name or the wallet interface label alone.

For the standard `Transfer(address,address,uint256)` event, `topics[0]` is the event signature hash, `topics[1]` and `topics[2]` encode the indexed sender and recipient, and `data` encodes the amount. Decode against the token contract’s ABI, and compare the decoded recipient with the wallet that should receive the output. In raw logs, TRON addresses use the EVM-compatible 20-byte form; interfaces may convert them to TRON’s familiar address format for display.

One transaction can contain several transfer events. A routed swap may move the input token into a pool, move one or more intermediate assets between pools, and transfer the final token to the user. The relevant output is the transfer emitted by the output token contract to the intended recipient. A transfer to a router or the next pool is an intermediate leg, not the wallet’s final receipt.

  • Match the log’s emitting address to the output token contract.
  • Decode the recipient and confirm it is the intended wallet.
  • Read the raw integer amount, then apply that token’s decimals for display.
  • Keep intermediate transfers separate from the final wallet transfer.

The raw event value is an integer in the token’s smallest unit. Decimals change how that integer is displayed; they do not change the logged value. Use the token contract’s decimals rather than assuming a standard precision. If no matching transfer appears, the receipt does not establish that the wallet received the expected TRC-20 output, even if an interface labels the transaction a successful swap.

How do you reconcile the pool event and catch edge cases?

Compare the output transfer with the pool’s own swap event, decoded using that pool’s ABI. The pool event describes amounts exchanged at that contract. The token transfer describes a movement recorded by the token contract. In a multi-hop route, each pool can emit its own swap event, while the final output transfer identifies what reached the recipient. Event names and field layouts are contract-specific, so decode them from the relevant ABI instead of assuming every TRON AMM uses the same schema.

The amounts need not match at every point in the route. A pool’s output may become the next pool’s input, and the recipient gets the last leg. Fees and the route’s execution rules affect the amounts, so trace the sequence of pool events and transfers rather than comparing only the first pool with the final wallet receipt. If the decoded values conflict, check that the ABI belongs to the emitting contract and that you have not mistaken an intermediate recipient for the user.

For TRX or TRC-10 movements made during contract execution, inspect the receipt’s internal transactions when the node or API provides them. They are execution records attached to the outer transaction, not independent user-submitted transactions. TRC-20 movement is represented by token contract events instead. Availability of internal transaction records depends on the node configuration or service, so their absence from one response does not prove no such movement occurred.

The reliable trace is a chain of evidence: a confirmed successful receipt, a transfer log emitted by the expected token contract to the intended wallet, and pool events that account for the route’s intermediate exchanges. The hash gets you to that evidence; the decoded contracts and recipients tell you what the swap delivered.