An event in Flipside's data model represents the distillation of all interactions that occur within a transaction. An event could range from a simple transfer between two parties to more complex smart contract calls.
The event model is represented for each chain as a single table. For example "cosmos_events" or "ethereum_events". The event model can conceptually be broken down into 2 core components, parent context data corresponding to the event and the event data itself.
Depending on the chain, a single transaction may consist of several "child" events.
To consistently represent the 1-to-many relationship, you will see 1 row that represents each transaction (including the fee for issuing the transaction) and then 1 or more rows representing all other events that are generated by this transaction.
All of these rows are grouped by their parent transaction metadata:
The following block-level metadata allows for block-level grouping of events.
Field | ā |
block_timestamp | UTC timestamp when the block was confirmed. |
block_number | The block height. |
Field | ā |
tx_id | A unique identifier of the transaction, typically a transaction hash. |
tx_type | Transaction type is used to distinguish the top-level transaction type, e.g. reward distribution, delegation, validator creation, or any smart contract function call on a chain like Ethereum. |
tx_from | The address that initiated the transaction. |
tx_to | The address of the transaction recipient. |
tx_fee | The decimal adjusted fee associated with the transaction. |
tx_fee_usd | The USD equivalent value of fee at transaction time. |
When you are looking at more complicated behaviors, you may want to filter by particular tx_type first, then look at the "child" events for all transactions in this subset.
Note: On Ethereum, the tx data is broken out into its own separate table. All other chains follow a 1 table rule for the Events data model. Check-out the specific Ethereum documentation for more details there.
Field | Description |
event_from | The initiator of the event. |
event_to | The recipient of the event. |
event_type | The type of event, specific to each blockchain, for example, "transfer", "reward", "stake", "mint", etc. |
event_currency | If applicable, the on-chain asset involved in the event. |
event_amount | If applicable, the decimal adjusted amount involved in the event (this is typically present when the event_type is a "transfer") |
event_amount_usd | If applicable, the USD equivalent value sent at transaction time (this is typically present when a market exists for the event_currency involved) |
Next, we'll dive into Flipside's balance model.