Skip to main content

Entities

Entity Architecture

GraphQL entities defined by the Sablier subgraphs are meant to mirror the functionality exposed by our v2-core 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

EntityDescription
ContractInstances of SablierV2LockupLinear or SablierV2LockupDynamic
ActionEmitted events transformed into historical entries (e.g. Create, Withdraw)
StreamPrimary entity tracking the up to date state of a stream
AssetThe ERC20 asset that is being streamed
SegmentThe function segment used to build the custom curve in cases of LockupDynamic streams care

Secondary

EntityDescription
BatchAn entity grouping a set of stream created all at once (action done through the v2-periphery)
BatcherAn entity resolving 1:1 to a stream sender, in charge of managing the count of "batches" of streams one creates
WatcherA singleton data store for subgraph-level unique indexes such as the stream or action index