How Sablier uses Envio to Power its Next Gen Multichain Token Distribution Platform
Managing operations across multiple blockchain networks shouldn’t be a headache. This was the challenge for Sablier until they discovered Envio’s powerful indexing capabilities. Sablier has recently transitioned to Envio’s multi-chain indexing stack, HyperIndex, to accelerate its development cycles and significantly ease the complexity of infrastructure management across various blockchain networks. This integration has allowed Sablier to cut infrastructure costs and expedite the release of new features and product updates, improving their time to market (TTM).
In this blog post, we are excited to delve into how Sablier - a next-generation token streaming and distribution platform - efficiently indexes and aggregates their application data across 11+ mainnets, joining the ranks of Envio’s robust multi-chain indexers.
What is Sablier?
Sablier is a DeFi platform offering real-time, blockchain-based money-streaming services. Specializing in on-chain token distribution for DAOs, businesses, and individual users, Sablier enables flexible vesting, payroll, airdrops, and grants. Operating through smart contracts on EVM-compatible networks, the Sablier platform facilitates continuous streams of ERC-20 tokens over scheduled periods (seconds, minutes, etc.), enhancing financial efficiency, transparency, and security without intermediaries.
Sablier also integrates seamlessly with other DeFi protocols, providing programmable and scalable payment solutions within the DeFi ecosystem, making it a part of the broader DeFi landscape by enabling real-time, trustless, and automated payment flows.
Deep Dive into the Integration
Before integrating with Envio HyperIndex, Sablier grappled with the complexity of managing and maintaining 12 separate deployments of indexers across 11 mainnets, including Optimism, Gnosis, Polygon, zkSync, Base, Scroll, and more. With an ambitious growth trajectory and a commitment to providing a seamless user experience while scaling across a diverse array of EVM blockchain networks, Sablier needed to re-evaluate its infrastructure to optimize and support its growth strategy.
With the launch of their new product, Airstreams, in Sablier V2.1—and more recently, the introduction of Sablier V2.2 with a specialized contract called LockupTranched—the prospect of updating and re-indexing 12 indexers, or deploying 12 new ones, was daunting. This process would be extremely resource-intensive, both in terms of infrastructure and cost.
In their search for alternatives, Envio stood out due to its robust multi-chain support, lightning-fast indexing times for fetching historical data, and real-time data synchronization capabilities. Envio’s developer-friendly and flexible architecture allows for quick adaptation and support for a wide range of blockchains, perfectly aligning with Sablier’s goal of becoming a truly multi-chain token streaming platform.
Razvan Gabriel, Co-founder and CPO at Sablier, points out how “Envio has significantly streamlined our workflow, enabling us to build, index, and release new features to our customers faster than ever before. Not only that, but through their multi-chain querying architecture, they’ve empowered us to prepare for a future where Sablier could offer chain-abstracted dashboards, paving the way for a vastly improved and less technical UX.”
Challenges Faced
- Operational Complexity: Managing 12 separate indexer deployments across 11+ chains significantly increased the operational burden and introduced numerous potential points of failure. This required meticulous monitoring and proactive infrastructure maintenance to ensure stability and performance.
- Data Fragmentation: Sablier had to query data from multiple endpoints and incorporate additional code to aggregate cross-chain data, creating a unified view of activity and analytics. This data fragmentation added complexity to their operations.
- Sync times: The lengthy sync and re-sync times for datasets meant that product features and updates took longer to develop and deploy. This hindered Sablier’s ability to accelerate its development cycles and respond swiftly to market demands.
- Scalability Issues: As Sablier added new networks, the need for additional indexers complicated the infrastructure and increased maintenance costs. This scalability issue posed a significant challenge to their growth strategy.
- Cost Inefficiencies: Higher infrastructure maintenance and update costs due to multiple indexers diverted resources from core development activities, reducing overall efficiency.
Envio as Sablier’s new Data API
Multi-chain Efficiency
One of the standout features of Envio’s SDK that greatly benefited Sablier was its multi-chain support. This feature eliminated the need for Sablier to deploy separate indexers for each chain and allowed them to write data to a single database for unified data access.
Envio’s multi-chain capability provides developers with an efficient way to access fragmented data across multiple chains. Builders can specify their event handler to operate against a common schema. For Sablier, they could collect and transform data from various sources and aggregate it into a single PostgreSQL database. With all cross-chain data consolidated, Sablier could query this data via a unified GraphQL API instead of requesting the same data via multiple endpoints. This streamlined their operations, making it easier to manage and utilize data from multiple blockchain networks.
When indexing multi-chain, Envio’s SDK offers two options:
- Default Mode: This mode preserves ordering across chains and ensures that events from all chains are ingested and processed in sequence. It is essential if you need to maintain the order across chains and are handling the same data from multiple chains.
- Unordered Head Mode: This mode indexes each chain quickly without preserving order across chains. It is useful if you are indexing at the head and do not want the slow block time of one chain to hinder the optimistic processing of events on other chains.
For more information on Envio’s multi-chain indexing capabilities, view our dev docs here.
Simplified Infrastructure Management
Sablier chose to leverage typescript, offering a more straightforward development experience, and once developed and tested, proceeded to deploy their multi-chain indexer to Envio’s hosted service. Builders can easily manage and configure their indexers through the Envio Deployments GitHub app, streamlining development and deployment, by pushing the latest indexer version to a preconfigured branch to auto-deploy the indexer to the hosted service.
Envio's hosted service allows you to have a static production deployment URL. By pushing your latest project code to a pre-configured GitHub repository, your indexer will be auto-deployed to the hosted service, ensuring a consistent and static URL for your production deployment.
For more information on deploying an indexer to Envio’s hosted service, view our dev docs here.