Entities
Entity Architecture
GraphQL entities defined by the Sablier subgraphs are meant to mirror the functionality exposed by our core lockup contracts. To achieve this, events are stored as historical entries (e.g. Action) while also being used to mutate attributes for live entities (e.g. Stream).
Inside the protocol subgraph, the
schema.graphql
file is responsible
of defining the following Sablier entities:
Primary
Entity | Description |
---|---|
Contract | Instances of SablierV2LockupLinear or ..Dynamic or ..Tranched |
Action | Emitted events transformed into historical entries (e.g. Create, Withdraw) |
Stream | Primary entity tracking the up to date state of a stream |
Asset | The ERC20 asset that is being streamed |
Segment | The function segment used to build the custom curve in cases of Lockup Dynamic streams |
Tranche | The tranche/step used to build shapes powered by Lockup Tranched streams |
Secondary
Entity | Description |
---|---|
Batch | An entity grouping a set of stream created all at once (action done through the lockup-periphery ) |
Batcher | An entity resolving 1:1 to a stream sender, in charge of managing the count of "batches" of streams one creates |
Watcher | A singleton data store for subgraph-level unique indexes such as the stream or action index |