Skip to main content

The Sablier APIs

Sablier relies on specific dependencies to source data or manage off-chain flows. All of these are either public or fully open-source, so feel free to roam around and suggest improvements or optimizations where needed.

We document below:

  1. The solutions we use to index and query data
  2. The product-to-protocol links between these solutions and the raw entities emitted by the contracts

Solutions

Banner Sablier APIs

As an alternative to reading data from the contracts or listening to onchain events, we use a set of subgraphs and indexers. These act as a middleware between the chain and our interfaces and allow for caching, formatting and querying data. For more advanced features like merkle generation (used in Drops) we've written out own SDKs and open sourced some of them.

Subgraphs

The Graph

The Graph has been the vendor of choice in the EVM space for the past few years. We've been integrating The Graph since 2019 with Sablier V1. For our current apps, we designed a special set of feature-oriented subgraphs used internally as well as by 3rd party services (e.g. snapshot) and integrators alike.

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 endpoints. Every network has its own subgraph endpoints.

Sablier Subgraphs on Github@sablier/subgraphs

Endpoints / Slugs

Every subgraph deployment will have a slug generated by The Graph from its name. You'll find it in the Studio Development Query URL. We define the following naming convention for subgraphs:

SubgraphExampleProduct or Concept
sablier-v2-*sablier-v2, sablier-v2-optimismLockup (Vesting)
sablier-v2-flow-*sablier-v2-flow-arbitrumFlow (Payments)
sablier-v2-ms-*sablier-v2-ms-baseAirstreams (Drops)
sablier-*sablier-optimismV1 (Legacy)

Envio

Envio offers a suite of fast and flexible tools to access onchain data. Their HyperIndex service provides for a similar GraphQL driven API to access cached data and serve it into our client interfaces.

We designed a set of indexers that mimic the features and entities exposed by subgraphs and take advantage of the speed and optimized environment configured through HyperIndex.

All networks share the same indexer endpoint (for one indexer type), as Envio promotes a cross-chain indexing architecture.

Sablier Indexers on Github@sablier/subgraphs

Sablier SDKs

Merkle API

To support our merkle distribution (Drops / Airstreams) system we developed a backend service called @sablier/merkle-api. This API deals with the validation, creation and management of merkle trees, used to define eligibility and claiming rules for Sablier's Airstream campaigns.

This service is open-source and can be used by integrators as a plug-n-play solution to support (and even deploy) similar campaigns from their own dashboards. Read more on the dedicated page about the merkle-api service.

Sablier Merkle API on Github@sablier/merkle-api - Rust based service for merkle distributions

Products

Lockup

The vesting side of the application will be powered by:

  • The @sablier/subgraphs/apps/lockup subgraph
  • The @sablier/subgraphs/apps/lockup-envio indexer

Drops (Airstreams)

The drops side of the application will be powered by:

  • The @sablier/subgraphs/apps/merkle subgraph
  • The @sablier/subgraphs/apps/merkle-envio indexer
  • The @sablier/merkle-api rust service for drops

These will work for both Airstreams and Instant Drops 🔜.

Flow

The payments side of the application will be powered by:

  • The @sablier/subgraphs/apps/flow subgraph
  • The @sablier/subgraphs/apps/flow-envio indexer