Exporting TRON Swap Records for Bookkeeping
Export transaction, transfer and internal-transaction records, then join them by transaction hash; a swap needs reconciliation, not a single trade row.
The Blockchain Brief Desk4 min read
To export TRON swap records for bookkeeping, download the address’s transaction, transfer and internal-transaction CSVs, then reconcile each swap by transaction hash. A swap is a contract call whose token movements appear as contract events and, for some native-asset transfers, internal transaction records; no single transfer row necessarily represents the trade. Keep the original files and build a separate ledger that links every accounting entry back to its transaction.
Wallet interfaces may group or label those records differently from the chain. A fuller discussion of wallet builders’ questions about a TRON swap explains why the presentation layer matters. For bookkeeping, the underlying transaction hash remains the useful join key.
Where can I export TRON transaction records?
TRONSCAN provides CSV exports from address pages for transactions, transfers and internal transactions. Open the public address page, select each relevant record tab, apply the period or asset filters you need, and use the CSV export control. Export each category separately: the files describe different views of activity, not interchangeable copies of one complete ledger.
Start with the address’s transaction list. It records the outer transaction initiated by the wallet, including contract calls that may execute a swap. Export transfers as well, since TRC-20 movements are emitted as token contract events and shown as individual transfer records. Export internal transactions when the swap or related contract execution moves TRX or TRC-10 tokens inside the call.
Preserve the unmodified CSVs alongside the working ledger. Record the address, export date, selected time range, and any filters used. If the interface limits the visible history or omits records needed for reconciliation, query an indexed transaction and transfer history with pagination, or retrieve transaction details by hash. A repeated export is only comparable if its account scope and filters match.
How do I identify the swap inside the exported rows?
Use the outer transaction hash to group the transaction row with its associated transfer and internal-transaction records. Check that the call succeeded before treating the asset movements as a completed swap. The transaction identifies the contract call; the receipt and event logs show what executed and what assets moved.
TRC-20 tokens emit a Transfer event when their balances change. Its log identifies the emitting token contract, the sender and recipient, and the transferred integer amount. The amount is denominated in the token’s smallest unit, so convert it using that token contract’s decimals and retain the raw value for audit. The log is evidence of a token movement; it does not, by itself, label the movement as a swap.
One router call may create several transfer events: input sent to a pool, output returned to the wallet, and intermediate movements between contracts. Do not count each event as a separate trade. Group the events by transaction hash, identify the wallet’s net change in each asset, and inspect the called contract and transaction result. Internal transactions are a separate record type for TRX and TRC-10 transfers caused by contract execution. TRC-20 transfers are event logs, not internal transactions.
- Transaction row: hash, timestamp, initiating address, called contract, result and fee data.
- Transfer rows: hash, token contract, sender, recipient and amount for each token movement.
- Internal rows: parent hash, transfer participants, asset and amount for contract-triggered TRX or TRC-10 movement.
- Ledger row: one reconciled trade entry with the wallet’s net input and output, valuation data and links to the source rows.
What should I check before using the CSVs?
Reconcile totals against the wallet’s expected opening and closing balances for the period. Check for missing pages, repeated rows across overlapping exports, transfers involving several tracked wallets, and failed calls. A reverted swap does not produce the intended asset exchange, though the transaction can still incur a network fee. Keep the fee separate from the trade’s token amounts.
For each completed swap, record the timestamp and timezone, transaction hash, wallet address, token contract addresses, net amounts in and out, and the valuation method used for bookkeeping. Record the valuation source and time separately: token transfer logs establish quantities, not their fiat value. Preserve precision through the conversion from raw token units and round only in the accounting output.
The practical distinction is between exporting records and constructing a trade ledger. CSVs make the chain activity portable, but the transaction hash, token events and any internal records must be reconciled before a swap can be represented as one bookkeeping entry. Keep the source rows attached to that entry so another person can trace the amounts back to the chain.