DeFi’s Next Chapter: Unleashing the Power of Data

Amidzic Momir
IOSG Ventures

--

Acknowledgment: Thanks to Scott and Ron for their valuable review of the article.

Keywords: dependencies, modularity, tamperproof, Proof of SQL, non-uniform, qualified, dynamic, real-time, self-parametrized, economics, ZKML

Projects mentioned: Space and Time, ChainML, Nil Foundation, Axiom, Brevis, Herodotus, HyperOracle, Uniswap v4, Solity, AAVE, Valantis, Tornado Cash, Spectral, Cred, Spool, GenSyn, together.xyz, Render, Akash, Modulus Labs, Giza

Smart contracts have inherent limitations as they lack the ability to interact with the environment, which restricts the potential of decentralized applications (dApps). To achieve greater sophistication, DeFi protocols have two options: they can either embrace a flexible design, assuming savvy players who can handle various scenarios themselves, or they can introduce external dependencies — relying on off-chain infrastructure such as oracles, keepers, or off-chain computations — to maintain a simple user experience.

In a recent thought-provoking piece titled “Why DeFi is Broken and How to Fix It, Pt 1: Oracle-Free Protocols”, Dan Elitzer argues for DeFi primitives with zero external dependencies to minimize attack vectors. The idea is to eliminate the need to trust third-party intermediaries. However, envisioning a DeFi ecosystem with zero dependencies would effectively professionalize the space. The majority of users lacking the time, expertise, or resources to become market makers on Uniswap v3 or assess collateral quality in lending protocols without dependencies would have to rely on trusted intermediaries to participate.

Hence, the quest for zero dependencies may lead us back to square one, or even worse, push non-professional users to trust sophisticated entities or deposit funds into intermediary smart contracts which introduce additional security assumptions into the equation. Rather than striving for the complete elimination of external dependencies, a more pragmatic approach would involve subjecting dependencies to greater scrutiny and limiting potential black swan scenarios. We must recognize that some level of dependencies is inevitable and even crucial for the industry to evolve.

Uniswap, among the prominent DeFi projects, came closest to achieving zero dependencies with its earlier versions. However, the recent introduction of Uniswap v4 indicates a shifting tide, signaling a willingness to embrace dependencies (“hooks”) via a highly modular approach in order to move the space forward.

Data primitives

Talk about external dependencies predominantly revolves around the capacity of smart contracts to engage with external data. Nowadays, data interactions often involve relying on oracles to access off-chain information, albeit limited in scope (mainly encompassing the prices of major cryptocurrencies).

As more activity migrates to blockchains, there is a wealth of valuable on-chain data that could be utilized to enhance mechanism design in an algorithmic and transparent manner. However, despite the transparency of on-chain data, integrating it with smart contracts is no easy feat. Reading, processing, and delivering meaningful data necessitates the establishment of a complex and trusted infrastructure. Consequently, developers typically rely on existing tools to meet their data requirements. Nevertheless, the majority of existing data solutions are rooted in Web 2.0 frameworks, and even the more Web 3.0 native protocols cannot guarantee the accuracy of the data they provide.

Sushiswap Discord discussion regarding The Graph subgraph sending inaccurate data

Considering that smart contracts could manage even billions of dollars in deposits, it is neither desirable nor practical for them to connect directly to a single trusted API source as such a reliance would undermine the decentralized nature of the blockchain ecosystem.

Building tamperproof data solutions

Our investment thesis revolves around the fundamental belief that tamperproof data will serve as a bedrock for empowering the next generation of DeFi protocols. However, achieving tamperproof data is no simple task; it necessitates intricate infrastructure and a plethora of optimizations to make it economically viable.

In this context, Space and Time has emerged as a pioneer, building tamperproof data infrastructure. A crucial part is its Proof of SQL, a refinement of SNARK proofs tailored specifically for querying data from relational databases. This implementation provides robust guarantees that the query and its underlying data remain tamperproof. Besides it offers guarantees of data validity upon retrieving it from archival nodes via RPC calls.

Some other notable projects working on trustless data primitives include but are not limited to Nil Foundation, Axiom, Brevis, Herodotus, etc.

Tamperproof data opens up new horizons for DeFi protocols, enabling them to push the boundaries of functionality and drive the industry toward further growth and innovation.

Below we discuss data-driven protocol design optimizations in the context of:

  • Non-uniform experiences
  • Self-parametrized protocols
  • Protocol economics
  • Qualified access

Leveraging tamperproof data

Non-uniform experiences

In the realm of technology businesses, it is commonplace to offer tailored experiences to users, utilizing data to customize offerings for specific user segments. However, smart contracts, which are essentially lines of code representing some business logic, often lead to uniform user experiences which are frequently equal to poor user experiences.

Consider major lending platforms, where User A, a novice crypto account holder, is indistinguishable from User B, a responsible long-term protocol user, or User C, a risk-prone trader with a history of liquidations. This lack of differentiation fails to account for user behavior and misses opportunities to enhance user stickiness, incentivize positive actions, and optimize capital utilization.

Protocols have a vested interest in recognizing user behavior and adapting accordingly. By leveraging credit rating scores, for example, to offer cheaper credit or lower collateralization ratios to well-behaved clients, a project can naturally attract users away from platforms with uniform terms. Additionally, this approach creates implicit incentives for users to exhibit desirable behavior in order to access more favorable credit terms.

Drawing inspiration from the fintech space, where companies like SoFi gained market share by rejecting uniformity, DeFi dApps can learn valuable lessons. SoFi, for instance, identified a market inefficiency in the student loans market where Stanford graduates were being charged the same loan rates as any other borrower, despite their higher likelihood of securing high-paying jobs post-graduation. By adjusting interest rates to better reflect user risk profiles, SoFi achieved remarkable success.

Similarly, within the DeFi space, we envision an opportunity for innovative protocols to incorporate user risk in interest rates and collateralization factors. However, it is essential to exercise caution and not enable undercollateralized borrowing solely based on the existing historical data which reflects user behavior in overcollateralized systems, as when the game theory changes the historical data becomes irrelevant.

It’s worth mentioning projects such as Spectral and Cred Protocol which are trying to derive credit-scoring models from on-chain data. However, these projects are operating on centralized databases, thus it is very unlikely that major DeFi protocols would connect to their APIs as long as the data and models they serve come from centralized sources and could be easily tampered. Instead, if these projects were to adopt tamperproof solutions they have the potential to become ubiquitous DeFi credit oracles powering a range of innovative applications.

Self-parametrized protocols (minimizing governance intervention)

Many DeFi protocols still rely on manual governance processes, often guided by off-chain consultancy firms, to adjust their parameters. A notable example is AAVE, which pays significant sums to external consultancies for monitoring and recommendations on protocol risk parameters.

However, several issues arise from this approach:

  1. Lack of real-time support: Systems lack responsiveness to changing market conditions or emerging risks.
  2. Manual system: The reliance on human intervention introduces delays and potential inefficiencies in adjusting protocol parameters.
  3. Trust in off-chain entities: Relying on external consultancies raises concerns about transparency and the methodology used in making recommendations.

This static approach was exposed in a recent economic attack, resulting in the creation of bad debt that could have been avoided with appropriate borrowing factors that better reflect borrowed token liquidity. Additionally, the risks associated with using a large percentage of a token’s circulating supply as collateral in lending protocols have not been adequately addressed.

To address these limitations, projects should transition towards real-time, automatic, transparent, and trustless designs. For example, lending protocols can leverage Space and Time-like infrastructure to implement standardized queries monitoring data in real-time. This would enable them to adjust collateral requirements, borrow factors, and other critical parameters for specific assets dynamically.

Likewise, exchanges could introduce dynamic fee structures based on estimated volatility or impermanent loss. Many liquidity vaults on top of Uniswap v3 struggled to achieve sustainable operations primarily due to the inability to dynamically charge for the liquidity provision. With Uniswap v4’s hooks or Valantis’ modules, it would be possible to finally introduce non-static fees.

Also, yield aggregators could benefit from moving away from manual and static approaches to adapting to the continuously changing risks and rewards of underlying protocols. The Spool and Solity partnership is a step in this direction, where Solity uses a big-data approach to analyze the risk-reward of underlying pools.

Protocol economics

A data-driven approach holds the potential for enhancing both the protocol economics and token economics within DeFi where projects could share incentives with the users that satisfy the set of encoded criteria.

Consider a DEX aggregator that seeks to incentivize user engagement and loyalty. They could, for instance, distribute positive slippage benefits to users who meet certain thresholds, such as executing a specified number of transactions and reaching a minimum trading volume.

Alternatively, think about a Uniswap v4 pool with a hook distributing the fees among its swappers based on the volume contributed and some time factor, where the time factor accrues in value when the user starts trading and resets to zero or depreciates if the user stops using the protocol during an epoch (e.g. 30-day period) or even if the user interacts with a competitor. The combinations are endless.

Such incentives give a strong motivation to the early adopters, create loyalty in the user base, and direct monetary incentives to the existing users to promote the usage of the protocol to their own community.

Similar logic could be replicated in any other application vertical in the space, think for instance of a rollup-specific application that could capture MEV and distribute it to the target segment of users.

Furthermore, the above-mentioned dynamic fees could encode logic that incentivizes desirable user behavior. For instance, a hook/module could offer a trading fees discount for the holder or staker of a specific amount of some fungible or non-fungible tokens. Imagine a project having significant protocol-owned liquidity (POL) choosing to launch a pool on Uniswap v4 or Valantis with a hook that specifies zero trading fees for the holder of its governance token.

Qualified access

While the fundamental principle of blockchains lies in their permissionless nature, it is also the freedom of everyone to choose whom they engage with. There are multiple use cases in which permissioned access at the application layer could either ensure protocol is not used for malicious purposes or enable more effective engagement with the target user base.

For example, privacy protocols such as Tornado Cash are under scrutiny from regulators due to their potential misuse by bad actors seeking to launder money and erase their on-chain traces. To safeguard against money laundering, protocol developers can take proactive measures to prevent bad actors from interacting with their platforms. One approach is to deploy tables to a tamperproof data warehouse that contains a list of hacker addresses and run queries (Proof of SQL) that ensure that addresses interacting with the protocol do not originate from blacklisted wallets.

Alternatively, having knowledge about the counterparty is a piece of valuable information for market makers, yet DEXs are, generally, not able to capture such information. Presuming it is possible to utilize data to build a proof of humanity, DEXs could permit only non-bot addresses i.e. non-toxic order flow to interact with the pools that are featuring more aggressive pricing algorithms.

In cases where institutional participants are the target audience, projects could create pools exclusively accessible to users who have undergone the KYC (Know Your Customer) process. Information pertaining to KYC-ed addresses could be stored and encrypted on top of a tamperproof data warehouse, ensuring compliance with regulations while maintaining data security.

Demand for verifiable computing

Some of the discussed use cases can be fully achieved through the integration with trustless data primitives. However, the others would require additional resources to perform statistical computations or machine learning. For instance, credit-scoring projects can utilize tamperproof data but still require machine learning algorithms to generate credit scores.

Or in the case of risk oracles, obtaining data about a specific token’s circulating supply, volume, transaction count, number of holders, the time since the token generation event (TGE), etc. would be essential for determining appropriate collateralization and borrowing factors. But, machine learning techniques would need to be employed on top of this data to make accurate calculations.

Source: ChainML

Dynamic fee modules also require complex computations to determine the optimal level. This may involve calculating implied volatility, modeling impermanent loss, and more.

Other areas in DeFi that demand more complex computing include but are not limited to:

  • Yield aggregators: Estimating the yield and risk of underlying protocols and finding an optimal allocation.
  • Portfolio optimization: Computing a target portfolio allocation based on pre-determined criteria, changing directional exposure based on technical indicators, etc.
  • Derivative DEXs: Managing systematic risk, funding fee adjustments, pricing derivatives, etc.
  • Advanced trade execution algorithms
  • Liquidity vault market-making logic
  • Liquidation vaults

Projects like ChainML address this demand by providing a layer for verifiable off-chain computing, supported by purpose-built consensus mechanisms. Others building distributed ML compute layer include but are not limited to GenSyn, Together.xyz, Akash, etc.

Similarly, ZKML presents an intriguing opportunity where ZK (validity) proofs can compress computations into succinct proofs that can be verified on-chain or demonstrate the use of a particular model without revealing its properties (functional commitments). It is worth mentioning notable ZKML projects such as Modulus Labs, Giza, and libraries ezkl, zkml, keras2circom, etc.

However, implementing machine learning in ZK is currently prohibitively expensive (several orders of magnitude more expensive!), making practical implementation in the medium term challenging. While hardware acceleration and circuit optimizations may improve performance in the future, the computational requirements of AI are expected to increase even at a faster pace, making ZKML limited to niche computing methods and not able to accommodate state-of-the-art AI models. As a result, approaches such as the pessimistic approach (consensus-based) or the optimistic approach (fraud-proofs) offered by ChainML-like projects may be the industry’s best chance of integrating the latest AI algorithms into Web 3.0.

Concluding remarks

The convergence of tamperproof data, advanced computing capabilities, and data-driven decision-making has the potential to unlock new levels of innovation, efficiency, and user satisfaction in the DeFi ecosystem. While this article is focused on the optimizations that could be done on top of on-chain data primitives, we are equally excited about the opportunities that could arise from integrating varied off-chain data through ZK-proof attestations. We believe that data will enhance the interoperability between the on-chain and off-chain worlds, fostering greater collaboration between decentralized finance and traditional financial systems.

As the industry continues to evolve, it is critical for protocols to embrace these technologies, collaborate with cutting-edge projects, and prioritize transparency and trustlessness, not only build a robust and sustainable future for DeFi but also pave the way for DeFi to make a profound impact on the global financial landscape.

Disclaimer: Space and Time, ChainML, Nil Foundation, and Solity are IOSG portfolio projects.

References:

🦄 About IOSG

IOSG Ventures is a leading crypto-native fund that invests in the future of Web3. As a thesis-driven firm, we assist founders in developing community-driven protocols that are primed to transform the crypto landscape. Our portfolio comprises a wide range of innovative and high-potential investments, including L1/L2 (Polkadot, NEAR, Arbitrum, Starkware), DeFi (1inch, 0x, Metamask), GameFi (Bigtime, Illuvium), and SocialFi (Galaxy, Cyberconnect).

Our team comprises experienced crypto-native BUIDLers and long-term HODLers, and we remain fully committed to supporting our early-stage developers and founders. Since our founding in 2017, we have invested in a number of industry leaders, including Cosmos, Starkware, zkSync, Arbitrum, Aztec, 1inch, MakerDAO, Illuvium, and Galxe. Whether you’re building infrastructure, middleware, gaming, or social platforms, we are passionate about investing in crypto-native paradigms that have the potential to transform the future of the industry.

Follow us on Twitter.

--

--