Skip to main content
The EventDecoder transforms raw event log rows into structured, typed output tables. Each matched event produces a table named {chain_name}_evt_{event_name_snake_case} with columns derived from the event’s ABI parameters.

How It Works

1

Normalization

The LogsNormalizer upstream produces rows containing raw_log_topics (a JSON array of 32-byte hex topics) and raw_log_data (a hex-encoded byte string).
2

Signature Matching

The EventDecoder reads topics[0], which is the keccak256 hash of the event signature (e.g., Transfer(address,address,uint256)), and matches it against event entries in the provided ABI file.
3

Indexed Parameter Decoding

Indexed parameters are decoded from topics[1..N]. Each indexed parameter occupies exactly one topic slot. Note that dynamic types (string, bytes, arrays) produce a keccak256 hash rather than the original value when indexed.
4

Non-Indexed Parameter Decoding

Non-indexed parameters are ABI-decoded from raw_log_data according to standard Solidity ABI encoding rules.
5

Table Emission

The decoded row is emitted to a table named {chain_name}_evt_{event_name_snake_case}. For example, a Swap event on the Base chain produces rows in the base_evt_swap table.

Output Schema

Every {chain_name}_evt_ table includes a set of envelope columns inherited from the raw log, followed by the decoded ABI parameters.

Envelope Columns

ColumnTypeSource
block_heightUINT64From logs envelope
block_signed_atTIMESTAMPFrom logs envelope
tx_hashSTRINGFrom logs envelope
log_offsetUINT32From logs envelope
contract_addressSTRINGFrom logs envelope

ABI Parameter Columns

Each parameter defined in the event ABI becomes an additional column. The column name is the parameter name converted to snake_case, and the column type is determined by the Solidity type mapping.

Worked Example: Uniswap V3 Swap

Consider the Uniswap V3 Swap event:
event Swap(
    address indexed sender,
    address indexed recipient,
    int256 amount0,
    int256 amount1,
    uint160 sqrtPriceX96,
    uint128 liquidity,
    int24 tick
);
  • sender and recipient are indexed - decoded from topics[1] and topics[2].
  • amount0, amount1, sqrtPriceX96, liquidity, and tick are non-indexed - decoded from raw_log_data.

Resulting base_evt_swap Table

ColumnType
block_heightUINT64
block_signed_atTIMESTAMP
tx_hashSTRING
log_offsetUINT32
contract_addressSTRING
senderSTRING
recipientSTRING
amount0STRING
amount1STRING
sqrt_price_x96STRING
liquiditySTRING
tickSTRING
Integer types (int256, uint160, uint128, int24) are represented as STRING columns to preserve full precision. See the type mapping reference for details.

Indexed Dynamic Types

When a dynamic type (string, bytes, or an array type) is marked as indexed, the EVM stores a keccak256 hash of the value in the topic slot rather than the value itself. The EventDecoder writes this hash as a hex string. There is no way to recover the original value from the hash alone.