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.
UTC timestamp when the block was confirmed.
The block height.
A unique identifier of the transaction, typically a transaction hash.
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.
The address that initiated the transaction.
The address of the transaction recipient.
The decimal adjusted fee associated with the transaction.
The USD equivalent value of fee at transaction time.
The initiator of the event.
The recipient of the event.
The type of event, specific to each blockchain, for example, "transfer", "reward", "stake", "mint", etc.
If applicable, the on-chain asset involved in the event.
If applicable, the decimal adjusted amount involved in the event (this is typically present when the event_type is a "transfer")
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.