Skip to main content
Schema: tron.core Table: fact_transactions Type: View

What

This table contains comprehensive transaction-level data for the Tron blockchain. Each row represents one transaction with its associated receipt data including status, gas consumption, and value transfers. TRX values are expressed in SUN (1 TRX = 1,000,000 SUN).

Key Use Cases

  • Analyzing wallet activity and transaction patterns
  • Tracking TRX transfer volumes and trends
  • Monitoring gas consumption and fee economics
  • Identifying smart contract interactions via input data
  • Detecting high-value TRX movements

Important Relationships

  • Join with fact_blocks: Use block_number for block-level context
  • Join with fact_event_logs: Use tx_hash for events emitted during execution
  • Join with fact_internal_transactions: Use tx_hash for internal contract calls
  • Join with dim_contracts: Use to_address = address for contract metadata

Commonly-used Fields

  • tx_hash: Unique transaction identifier
  • from_address: Transaction sender
  • to_address: Transaction recipient (NULL for contract creation)
  • value: TRX amount transferred (decimal-adjusted)
  • status: Receipt status (1 = success, 0 = failure)
  • gas_used: Actual gas consumed
  • input_data: Hex-encoded function call data

Sample queries

-- Daily transaction stats
SELECT
    DATE_TRUNC('day', block_timestamp) AS day,
    COUNT(*) AS total_transactions,
    SUM(CASE WHEN tx_succeeded THEN 1 ELSE 0 END) AS successful,
    SUM(CASE WHEN NOT tx_succeeded THEN 1 ELSE 0 END) AS failed,
    COUNT(DISTINCT from_address) AS unique_senders,
    SUM(value) AS total_trx_transferred
FROM tron.core.fact_transactions
WHERE block_timestamp >= CURRENT_DATE - 30
GROUP BY 1
ORDER BY 1 DESC;

-- High-value TRX transfers
SELECT
    block_timestamp,
    tx_hash,
    from_address,
    to_address,
    value AS trx_amount,
    tx_succeeded
FROM tron.core.fact_transactions
WHERE block_timestamp >= CURRENT_DATE - 7
    AND value > 1000000  -- Over 1M TRX
    AND tx_succeeded
ORDER BY value DESC
LIMIT 100;

-- Smart contract interaction patterns
SELECT
    to_address AS contract_address,
    origin_function_signature,
    COUNT(*) AS call_count,
    COUNT(DISTINCT from_address) AS unique_callers
FROM tron.core.fact_transactions
WHERE block_timestamp >= CURRENT_DATE - 1
    AND to_address IS NOT NULL
    AND input_data IS NOT NULL
    AND input_data != '0x'
GROUP BY 1, 2
ORDER BY 3 DESC
LIMIT 100;

Columns

Column NameData TypeDescription
BLOCK_NUMBERNUMBERSequential counter representing the position of a block in the Tron blockchain since genesis (block 0). Key Facts: Immutable once finalized Primary ordering mechanism for blockchain data Increments by 1 for each new block Encoded in the first bytes of blockhash Usage in Queries: Important: Many early Tron blocks are empty (zero transactions). Expect blocknumber gaps in transaction-based tables.
BLOCK_HASHTEXTThe unique hash of the block header. Key Facts: Contains the block number encoded in its first bytes Used for chain reorganization detection Example: ‘0x00000000033fc3d68297d9c3bfab0a01c57a56a61a82f270ba7f9e4400000000’
BLOCK_TIMESTAMPTIMESTAMP_NTZUTC timestamp when the block was produced by the super representative (SR). Format: TIMESTAMP_NTZ (no timezone) Precision: Second-level accuracy Best Practices: Note: Tron produces blocks every 3 seconds via DPoS consensus.
TX_HASHTEXTUnique identifier for the transaction. Format: 0x + 64 hexadecimal characters Usage: Primary key for transaction lookups Join key for event logs, internal transactions, and token transfers Immutable once confirmed Example: ‘0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060’
TX_POSITIONNUMBERZero-indexed position of the transaction within its block. Example: 5
FROM_ADDRESSTEXTThe address that initiated the transaction, in 0x-prefixed hex format. Key Points: Lowercase normalized in all tables Cannot be NULL for valid transactions Tron uses 0x hex internally; user-facing format is Base58Check (T…)
TO_ADDRESSTEXTThe destination address of the transaction, in 0x-prefixed hex format. Special Cases: NULL: Contract creation transaction Contract address: Smart contract interaction EOA address: Simple TRX transfer
ORIGIN_FUNCTION_SIGNATURETEXTFunction signature (first 4 bytes) of the called method in the originating transaction. Format: 0x + 8 hex characters Common Signatures: 0xa9059cbb: transfer(address,uint256) 0x095ea7b3: approve(address,uint256) 0x23b872dd: transferFrom(address,address,uint256) Note: NULL for simple TRX transfers or non-contract calls.
TX_VALUETEXTThe value transferred in the transaction, in SUN (1 TRX = 1,000,000 SUN). This is the raw integer value before decimal adjustment. Example: 1000000
VALUE_PRECISE_RAWTEXTString representation of the raw value transferred in SUN, preserving exact precision without floating-point loss. Example: ‘1000000000000’
VALUE_PRECISETEXTString representation of the value transferred in TRX (decimal-adjusted by 6 places), preserving full precision. Example: ‘1000000.0’
VALUEFLOATThe value transferred in TRX, as a float. Already converted from SUN (divided by 1e6). Use value_precise for exact amounts in high-precision scenarios. Example: 1000000.0
INPUT_DATATEXTHex-encoded function call data sent with the transaction. First 4 bytes (10 chars including 0x) identify the function signature. ‘0x’ indicates a simple transfer with no call data. Example: ‘0xa9059cbb000000000000000000000000…’
GASNUMBERThe gas limit provided by the sender for the transaction. Example: 300000
GAS_PRICETEXTThe gas price specified by the sender, in SUN. Example: 420
MAX_FEE_PER_GASNUMBERMAX_FEE_PER_GAS column
MAX_PRIORITY_FEE_PER_GASNUMBERMAX_PRIORITY_FEE_PER_GAS column
TX_TYPENUMBERTX_TYPE column
ACCESS_LISTVARIANTACCESS_LIST column
RTEXTR column
STEXTS column
VTEXTV column
CONTRACT_ADDRESSTEXTSmart contract address that emitted the event or received the transaction, in 0x-prefixed hex format. Key Points: Always the immediate event emitter for logs May differ from transaction to_address Lowercase normalized Never NULL for valid events
CUMULATIVE_GAS_USEDNUMBERCUMULATIVE_GAS_USED column
GAS_USEDNUMBERActual gas units consumed by the transaction execution. Example: 21000
EFFECTIVE_GAS_PRICENUMBEREFFECTIVE_GAS_PRICE column
ROOTTEXTROOT column
STATUSNUMBERThe status of the transaction receipt. Derived from the blockchain receipt. Values: 1: Transaction executed successfully 0: Transaction failed/reverted
TX_SUCCEEDEDBOOLEANBoolean indicator of transaction success. Values: TRUE: Transaction executed successfully FALSE: Transaction failed/reverted
FACT_TRANSACTIONS_IDTEXTPrimary key — unique identifier for each row ensuring data integrity. Format: VARCHAR containing composite key generated using MD5 hash of the relevant columns. Usage: Deduplication in incremental loads Join operations for data quality checks Troubleshooting specific records
INSERTED_TIMESTAMPTIMESTAMP_NTZUTC timestamp when the record was first added to the Flipside database. Format: TIMESTAMP_NTZ Use Cases: Data freshness monitoring Incremental processing markers Debugging data pipeline issues
MODIFIED_TIMESTAMPTIMESTAMP_NTZUTC timestamp of the most recent update to this record. Format: TIMESTAMP_NTZ Use Cases: Tracking data corrections and reprocessing Monitoring incremental model updates Data quality audits