Skip to main content
Schema: near.core Table: fact_logs Type: View

Description

This table contains all event logs emitted by smart contracts on the NEAR Protocol blockchain, capturing structured event data including token transfers, contract interactions, and custom application events. Logs represent the standardized way that smart contracts communicate state changes and events to external systems, following NEAR’s event logging standards. This table provides the foundation for understanding contract behavior, token movements, and application-specific events across the NEAR ecosystem.

Key Use Cases

  • Token transfer tracking and balance analysis
  • Smart contract event monitoring and analytics
  • DeFi protocol activity analysis and volume tracking
  • NFT minting and transfer event analysis
  • Cross-contract communication tracking
  • Application-specific event analysis and user behavior tracking
  • Compliance and audit trail analysis

Important Relationships

  • Links to core.fact_transactions through tx_hash for transaction context
  • Connects to core.fact_receipts through receipt_id for execution context
  • Provides event data for core.fact_token_transfers and core.ez_token_transfers
  • Supports defi.ez_dex_swaps and defi.ez_bridge_activity through event parsing
  • Enables analysis in nft.ez_nft_sales through NFT-related events
  • Powers stats.ez_core_metrics_hourly for aggregated event metrics

Commonly-used Fields

  • log_index: Essential for event ordering within transactions and receipts
  • block_timestamp: Primary field for time-series analysis and trend detection
  • receiver_id and predecessor_id: Critical for contract interaction analysis
  • clean_log: Important for event parsing and structured data analysis
  • event_standard: Essential for identifying standardized event types
  • receipt_succeeded: Important for filtering successful events only
  • gas_burnt: Useful for gas consumption analysis and cost optimization

Columns

Column NameData TypeDescription
BLOCK_IDNUMBERThe height of the chain this block corresponds with.
BLOCK_TIMESTAMPTIMESTAMP_NTZThe date and time at which the block began.
TX_HASHTEXTUnique identifier (hash) of this transaction.
RECEIPT_IDTEXTThe identifying hash for a receipt.
PREDECESSOR_IDTEXTAccount that called the relevant receipt (often the same as tx_signer, but can be system as well). This field identifies the account that directly invoked the receipt being processed. In simple transactions, this is typically the same as the transaction signer. However, in cross-contract calls or system operations, this may be a different account or the system account. This is crucial for understanding the call chain and access control in NEAR’s execution model.
RECEIVER_IDTEXTAccount reacting to the receipt from predecessor_id, can be relay, a contract, or a user of a relay, etc. This field identifies the account that is processing the receipt and executing the associated action. In most cases, this is a smart contract that is being called, but it can also be a user account in relay transactions or the system account for certain operations. This differs from tx_receiver and is specific to the receipt being processed.
SIGNER_IDTEXTSigner of the receipt, often same as tx_signer, sometimes system in the case of systemic gas refunds. This field identifies the account that has the authority to execute the receipt. In most cases, this is the same as the transaction signer, but in system operations like gas refunds, this may be the system account. The signer is the account that originally signed the transaction that began the blockchain activity, which may or may not include cross-contract calls.
LOG_INDEXNUMBERThe positon index for the record in question, if it was stored in a particular order.
CLEAN_LOGTEXTThe logs linked to the transaction.
EVENT_STANDARDTEXTThe event standard used in the log, if applicable.
GAS_BURNTNUMBERGas burned for the receipt action. This field represents the amount of computational resources consumed specifically for the receipt being processed. Gas burning is the mechanism by which NEAR charges for computational work, and this field tracks the exact amount burned for this particular receipt action. In raw number format with 16 decimal places, to adjust divide by POW(10,16) or multiply by 1e-16.
RECEIPT_SUCCEEDEDBOOLEANBoolean indicating whether the receipt was successfully processed. This field tracks the execution status of the receipt, which is crucial for understanding transaction outcomes. While most transactions succeed, individual receipts within a transaction can fail due to various reasons such as insufficient gas, contract errors, or invalid parameters. This field is essential for filtering successful operations and analyzing failure patterns.
FACT_LOGS_IDTEXTA unique identifier for the record.
INSERTED_TIMESTAMPTIMESTAMP_LTZThe timestamp at which the record was initially created and inserted into this table.
MODIFIED_TIMESTAMPTIMESTAMP_LTZThe timestamp at which this record was last modified by an internal process.