The Sablier APIs
Sablier relies on specific dependencies to source data and enable off-chain features. All of these are either public or open-source, so feel free to roam around and suggest improvements or optimizations.
Below, we will cover:
- The solutions we use to index and query data
- The interface-to-protocol links between these solutions
- The raw entities emitted by the contracts
Solutions
As an alternative to reading data from the contracts or listening to onchain events, we use a collection of data indexing services. These services act as a middleware between the chain and our interfaces and allow for caching, aggregating, and querying data. For more advanced features like Merkle tree generation (used in Airdrops), we've written our own SDKs and open-sourced some of them.
To preview the GraphQL APIs for the indexers, you can plug them into the Hasura explorer. Here's an example setup of a Mainnet subgraph for Sablier Lockup.
Subgraphs
The Graph
The Graph has been the vendor of choice in the EVM space for some time. We've been using The Graph since we launched Sablier Legacy in 2019. For our current apps, we created a special set of feature-oriented subgraphs used internally and by third-party services (e.g., Snapshot) and integrators.
These subgraphs are hosted on The Graph Network, as well as on the The Graph Hosted Service. They can be used to query Sablier data from the official indexers. Each chain has its own subgraphs.
- Caveats between subgraphs and indexers
- Lockup indexers
- Flow indexers
- Airdrops indexers
- The Graph docs
Endpoints / Slugs
Every subgraph deployment will have a slug
generated by The Graph. The slug is derived from the subgraph name and can
be found in the Studio Development Query URL. We use the following naming convention for subgraphs:
Subgraph | Example | Product or Concept |
---|---|---|
sablier-lockup-* | sablier-lockup-ethereum | Lockup (Vesting) |
sablier-flow-* | sablier-flow-optimism | Flow (Payments) |
sablier-airdrops-* | sablier-airdrops-base | Merkle (Airdrops) |
sablier-* | sablier-optimism | V1 (Legacy) |
In February 2025, we've deprecated the old line-up of sablier-v2-*
subgraphs. They remain available (see Deprecated
section under each subgraph documentation), but they will not track the most recent deployments nor get future updates.
Envio
Envio offers a suite of fast and flexible tools to access onchain data. Their HyperIndex service provides a similar GraphQL-driven API to access cached data and serve it into our client interfaces.
We wrote Envio indexers that mirror the features and entities exposed by The Graph subgraphs. This enables us to take advantage of the speed and optimized environment provided by HyperIndex.
All chains share the same endpoint (for each Sablier protocol, e.g. Lockup).
- Caveats between subgraphs and indexers
- Lockup indexers
- Flow indexers
- Airdrops indexers
- Envio docs
Merkle API
To support the Merkle distributions in Airdrops, we developed a backend service
called @sablier/merkle-api
. This API deals with the validation, creation, and management of Merkle trees, which are
used to define eligibility and claiming rules for Sablier's Airstream campaigns.
The service is open-source and can be used by integrators as a plug-n-play solution to support (and even deploy) similar
campaigns. Read more on the dedicated page about the merkle-api
service here.
App Products
This is how the products available in the Sablier Interface are powered by the different APIs we provide.
Vesting
The Vesting side of the application is powered by:
- The Graph subgraph for Lockup
- The Envio endpoint for Lockup
Airdrops
The Airdrops side of the application is powered by:
- The Graph subgraph for Airdrops
- The Envio endpoint for Airdrops
These handle both Airstreams and Instant Airdrops.
Payments
The Payments side of the application is powered by:
- The Graph subgraph for Flow
- The Envio endpoint for Flow