Revolutionizing DeFi with PropellerHeads and Substreams

How Substreams Powers the Next Generation of MEV Solvers and Liquidity Indexing


Introduction

DeFi has matured as web3’s leading use case, valued at tens of billions in on-chain capital today. But what will drive DeFi’s next leap into the future? The answer lies in rethinking how we consume the vast volume of on-chain data that DeFi generates– using Substreams, an ultra-fast, parallelized streaming technology on The Graph.

To frame DeFi’s future, we’ll explore an example of an innovative use of Substreams today. PropellerHeads, a leading MEV solver builder, has invested years into developing advanced yet closed-source Substreams modules for major DeFi protocols like Curve and Uniswap. In a bold move, they are now open-sourcing Tycho, an indexer designed for real-time access to current state across financial protocols, aiming to set a new standard for DeFi liquidity indexing infrastructure. To accomplish this, PropellerHeads has harnessed the capabilities of Substreams on The Graph to meet their requirements for real-time, low-latency, and chain-agnostic operations.

Let’s dive into the challenges PropellerHeads was facing, and the Substreams-powered solution.


Challenges with DeFi Liquidity Indexing

  1. Scaling Indexing With an RPC: Solvers need comprehensive, fast, and reliable access to liquidity data. Missed data on protocols, pools, or tokens directly affects their performance, costing revenue and time to market.
  2. High Development Costs: Using an RPC to develop a complete, reliable indexing solution for major DeFi protocols like Curve, Balancer, and Uniswap requires significant engineering resources — estimated to cost over $1M just to build a baseline solution.
  3. Fragmented Indexing Solutions: Many solver teams roll out their own custom indexing or use unreliable, incomplete solutions. These highly specialized, proprietary indexing approaches do not generalize well across chains, creating inefficiencies for engineering teams.

Why Substreams on The Graph is the Best Choice

Substreams on The Graph, developed by core dev StreamingFast, emerged as the ideal solution for PropellerHeads' ambitious liquidity indexing infrastructure. Here's why:

  1. Customizability and Flexibility: PropellerHeads leveraged Substreams to build a highly scalable, chain-abstracted solution that’s adaptable across DeFi protocols. This approach allows them to integrate different on-chain liquidity sources (e.g., DEXs, oracles, and lending pools) using a single programming paradigm to support over 50 DEX protocols.
  2. Efficiency and Cost-Effectiveness: Substreams' modular framework allows for rapid development and customization, significantly reducing the internal resources required for integration. It also offers real-time, highly efficient indexing, which helps solvers maintain the edge they need to compete effectively in liquidity auctions.
  3. Rich Data-Model and Reorg Aware: Substreams reliably provides comprehensive data which includes the full call tree (balance changes, internal transactions, storage changes, and gas costs) and a cursor to persist state through forks and disconnects. This ensures that PropellerHeads never misses any critical information.
  4. Open-source and Decentralized: The open-source and decentralized nature of Substreams paired perfectly with the open-source and sustainable vision of the PropellerHeads' stack enabling standardized liquidity indexing across solvers, boosting the entire ecosystem.

Key Results

  1. Significant Indexing Time Saved: The Substreams engine's ability to parallelize the back-processing of entire chains was a crucial unlock for PropellerHeads, resulting in over a 10,000% reduction in indexing time — think days instead of months, allowing them to bring their solver to market swiftly.
  2. Cost Reduction: By building their stack on Substreams, PropellerHeads avoided the need to develop shortcuts to limit RPC calls, resulting in a greater than 5X cost reduction.
  3. Improved Data Model: RPC calls were a major bottleneck for PropellerHeads, now with Substreams there’s no need to take shortcuts to limit the RPC calls and the data model includes the full call tree ensuring a precise solver.

"Previously, RPC calls were a significant bottleneck. We had to take shortcuts and limit the number of calls to meet the time constraints for solving our order flow. For instance, we couldn’t query every tick from every pool on Uniswap v3 and had to prioritize the most relevant data. This created downstream limitations in our solver, as we couldn’t track all pools or ticks, preventing us from efficiently handling long-tail tokens or large price impact trades. Now, thanks to the enhanced indexing capabilities provided by Substreams, we can capture every relevant state and ensure a precise, deliberate approach on the solver side." - Markus, CEO of PropellerHeads


Conclusion

PropellerHeads’ vision to reshape DeFi liquidity indexing would not have been possible without Substreams’s impact on Tycho. Furthermore, by open-sourcing Tycho, they’re setting the stage for the next evolution of DeFi infrastructure, where standardized liquidity indexing can become the backbone of decentralized trading.

Start building with Substreams and access the cutting edge of DeFi data technology.

Get an API keyRead the Docs

About The Graph

The Graph is the source of data and information for the decentralized internet. As the original decentralized data marketplace that introduced and standardized subgraphs, The Graph has become web3’s method of indexing and accessing blockchain data. Since its launch in 2018, tens of thousands of developers have built subgraphs for dapps across 70+ blockchains - including  Ethereum, Solana, Arbitrum, Optimism, Base, Polygon, Celo, Fantom, Gnosis, and Avalanche.

As demand for data in web3 continues to grow, The Graph enters a New Era with a more expansive vision including new data services and query languages, ensuring the decentralized protocol can serve any use case - now and into the future.

Discover more about how The Graph is shaping the future of decentralized physical infrastructure networks (DePIN) and stay connected with the community. Follow The Graph on X, LinkedIn, Instagram, Facebook, Reddit, Farcaster and Medium. Join the community on The Graph’s Telegram, join technical discussions on The Graph’s Discord.

The Graph Foundation oversees The Graph Network. The Graph Foundation is overseen by the Technical Council. Edge & Node, StreamingFast, Semiotic Labs, Messari, GraphOps, Pinax and Geo are eight of the many organizations within The Graph ecosystem.


Categories
RecommendedDeveloper Corner
Published
November 4, 2024

StreamingFast

View all blog posts