Original author: Momir@IOSG Ventures
Smart contracts have limitations because they lack the ability to interact with the environment, which limits the development potential of decentralized applications (dApps). In order to achieve more complex functionality, DeFi protocols have two options: they can adopt flexible designs, such as allowing players to personalize various scenarios; or they can introduce external dependencies - relying on off-chain infrastructure such as oracle, keepers or off-chain computing - to maintain a simple user experience.
In a recent thought-provoking article titled "Why DeFi is Broken and How to Fix It - Part 1: No Oracle Protocol," Dan Elitzer advocates for the use of zero external dependency DeFi primitives to minimize attack vectors. The idea is to eliminate the need for trust in third-party institutions. However, a zero-dependency DeFi ecosystem will require higher specialization. Most users lack the time, expertise, or resources to become market makers on Uniswap v3 or evaluate collateral quality in protocols without external dependencies, and they have to rely on trusted intermediaries to participate.
Therefore, the pursuit of zero dependencies may lead us back to the starting point, or worse, force non-professional users to trust complex entities or deposit funds into transitional smart contracts, which increases the insecurity. Instead of striving to completely eliminate external dependencies, it is better to consider more practical methods, such as conducting stricter audits of external dependencies and limiting potential black swan scenarios. We must recognize that some degree of dependency is inevitable and even crucial to the development of the industry.
In well-known DeFi projects, Uniswap's early versions were closest to achieving zero reliance. However, the recently introduced Uniswap v4 indicates a trend towards a highly modular approach ("Hooks") to drive the field forward.
The discussion about external dependencies mainly revolves around the ability of smart contracts to interact with external data. Nowadays, data interaction usually relies on oracles to access off-chain information, although the scope is limited (mainly including the prices of major cryptocurrencies).
With more and more activities migrating to the blockchain, a large amount of valuable on-chain data can be used to enhance mechanism design through algorithms and transparent means. However, despite the transparency of on-chain data, integrating it with smart contracts is not an easy task. Building a complex and trustworthy infrastructure is required to read, process, and deliver meaningful data. Therefore, developers often rely on existing tools to meet their data needs. However, most existing data solutions are rooted in Web 2.0 frameworks, and even more Web 3.0 native protocols cannot guarantee the accuracy of the data they provide.

Sushiswap's discussion on inaccurate data transmission of Polygon Sushi-Matic subgraph
Considering that smart contracts can even manage billions of dollars in deposits, it is neither desirable nor practical for them to be directly connected to a trusted API source, as this dependency would undermine the decentralized nature of the blockchain ecosystem.
Our investment philosophy revolves around a fundamental belief that anti-tampering data will become the cornerstone of the next generation of DeFi protocols. However, achieving anti-tampering data is not a simple task, as it requires complex infrastructure and extensive optimization to make it economically feasible.
Against this backdrop, Space and Time has become a pioneer in establishing tamper-proof data infrastructure. A key part of this is its SQL proof, an improvement on SNARK proof specifically designed for querying data from relational databases. This approach provides assurance that the query and its underlying data are not tampered with. Additionally, when retrieving data from archival nodes through RPC calls, it provides assurance of data validity.
Other well-known projects for untrusted data primitives include but are not limited to Nil Foundation, Axiom, Brevis, and Herodotus.

Anti-tampering data has opened up new horizons for DeFi protocols, enabling them to break through the boundaries of functionality and drive further growth and innovation in the industry.
We will discuss the optimization of data-driven protocol design in the following scenarios:
1. Personalized user experience.
2. Self-parametrizing protocol.
3. Protocol Economy
4. Qualified Access

In the technical business field, providing customized services to users is commonplace. However, smart contracts (which are essentially code strings representing certain business logic) often unify the user experience, which is usually equivalent to a poor user experience. For example, on some lending platforms, User A is a novice, User B is a long-term contract user, and User C is a trading veteran. This lack of differentiation cannot explain user behavior and misses opportunities to enhance user stickiness, incentivize positive behavior, and optimize capital utilization.
The protocol has vested interests in identifying user behavior and making corresponding adjustments. For example, by utilizing credit ratings to offer cheaper credit or lower mortgage rates to well-performing customers. Such a project naturally attracts users to a platform with unified terms. In addition, this approach provides implicit incentives for users to exhibit good behavior in order to obtain more favorable conditions.
From the perspective of financial technology, companies like SoFi have gained market share by rejecting standardization, and DeFi dApps can also learn from this. For example, SoFi found that the student loan market was inefficient, with Stanford graduates being charged the same interest rate as other borrowers, despite their higher likelihood of obtaining high-paying jobs after graduation. By adjusting interest rates to better reflect users' risk profiles, SoFi has achieved significant success.
Similarly, in the DeFi field, we have envisioned an opportunity for an innovative protocol that incorporates user risk into interest rates and collateral factors. However, caution must be exercised not to rely solely on existing historical data for under-collateralized lending, as historical data becomes irrelevant when game theory changes.
It is worth mentioning that projects such as Spectral and Cred Protocol are attempting to establish credit scoring models from on-chain data. However, these projects are running on centralized databases, so as long as the data and models they serve come from centralized sources and are easily tampered with, major DeFi protocols are unlikely to connect to their APIs. On the other hand, if these projects adopt tamper-proof solutions, they have the potential to become ubiquitous DeFi credit oracles, powering a range of innovative applications.
Many DeFi protocols still rely on manual governance processes, typically guided by off-chain consulting firms, to adjust their parameters. For example, AAVE pays a hefty sum to external consulting firms to monitor and guide protocol risk parameters.
However, this approach has raised several issues:
1. Lack of real-time support: The system lacks the ability to respond to constantly changing market conditions or newly emerging risks.
2. Manual system: The reliance on human intervention introduces delay issues and potential inefficiencies when adjusting protocol parameters.
3. Trust in off-chain entities: reliance on external consulting firms has raised concerns about transparency and the methods used to make recommendations.
This static method was exposed in an attack on AAVE, resulting in the creation of bad debts, which could have been avoided with appropriate borrowing parameters that better reflect the liquidity of the borrowed tokens. In addition, the risk of using circulating tokens as collateral in lending protocols has not been fully addressed.
To address these limitations, projects should transition towards real-time, automatic, transparent, and trustless designs. For example, lending protocols can utilize infrastructure similar to Space and Time to monitor data in real-time. This will enable them to dynamically adjust collateral, lending parameters, and other key parameters.
Similarly, exchanges can introduce dynamic fee structures based on volatility or impermanent loss. Many liquidity pools on top of Uniswap v3 struggle to achieve sustainable operation, mainly due to the inability to charge LPs dynamically. With Uniswap v4's Hook or Valantis' module, dynamic fees become possible.
In addition, the aggregator can adapt to the constantly changing risks and returns of underlying protocols without interference from manual or fixed costs. The collaboration between Spool and Solity is a step in this direction, with Solity using big data methods to analyze the risk and return of the pool.
Data-driven methods may enhance the protocol economy and token economy models in DeFi, where projects can share incentives with eligible users.
For example, a DEX aggregator that seeks user stickiness and loyalty can allocate slippage profits to users who meet certain conditions, such as executing a specified number of trades and reaching a minimum trading volume.
This kind of incentive greatly motivates early users, establishes loyalty among the user base, and directly provides incentives to existing users to promote the protocol's usage within their own community.
Although blockchain has a permissionless nature, it also allows for freedom of choice. In multiple cases, permissioned access at the application layer can ensure that the protocol is not used for malicious purposes or effectively interacts with the target user group.
For example, privacy protocols like Tornado Cash are currently under scrutiny by regulatory agencies because they may be used for money laundering or other illegal activities. To prevent money laundering, protocol developers can take measures to prevent bad actors from interacting with their platform.
In addition, for market makers, it is very valuable to understand their counterparties, but DEXs usually cannot obtain such information. Assuming it is possible to use data to construct a proof of humanity, DEXs can only allow non-bot addresses to interact, and then such problems can also be solved.
By integrating with untrusted data primitives, the above discussed content can be fully realized. However, others will require additional resources to perform statistical calculations or machine learning. For example, credit scoring projects can use tamper-proof data, but still require machine learning algorithms to generate credit scores.
When it comes to determining appropriate collateral and lending factors, obtaining data on the circulating supply, quantity, transaction count, number of holders, and time since TGE of specific tokens is crucial, provided that it is done under the premise of Risk Oracle. However, machine learning technology requires precise calculations based on this data.

source:https://chainml.substack.com/p/web3-needs-ai-to-realize-its-potential
Other areas in DeFi that require more complex calculations include but are not limited to:
Earnings Aggregator: Estimate the earnings and risks of the underlying protocol and find the optimal allocation.
Investment portfolio optimization: calculate the allocation of the target investment portfolio based on predetermined criteria, and adjust directional exposure based on technical indicators.
Derivatives decentralized exchange: systematic risk management, funding cost adjustment, derivatives pricing, etc.
Advanced trading execution algorithm.
Liquidity pool market-making logic
Clearinghouse
Projects like ChainML meet this demand by providing a verifiable off-chain computation layer, supported by specially designed consensus mechanisms. Other projects that build distributed machine learning computation layers include but are not limited to GenSyn, Together.xyz, and Akash.
Similarly, ZKML provides an interesting opportunity where ZK proofs can compress computations into succinct proofs that can be verified on-chain, or demonstrate the use of specific models without revealing their properties, as seen in ZK projects such as Modulus Labs and Giza.
However, implementing machine learning in ZK is currently very expensive, which increases the practical challenges of implementation. Although hardware acceleration and circuit optimization may improve performance in the future, the computing demands of artificial intelligence are expected to grow at a faster rate, which limits ZKML to niche computing methods and cannot adapt to the most advanced artificial intelligence models. Therefore, projects like ChainML that offer consensus-based pessimistic approaches or optimistic approaches based on fraud proofs may be the best opportunity to integrate the latest artificial intelligence algorithms into Web 3.0.

The integration of tamper-proof data, advanced computing power, and data-driven decision-making may unlock new innovations, improve efficiency, and enhance user satisfaction in the DeFi ecosystem. While this article focuses on optimizations that can be made on the basis of on-chain data primitives, we also see opportunities in integrating various off-chain data through zk proofs. We believe that data will enhance interoperability between on-chain and off-chain systems, promoting the integration of decentralized finance and traditional financial systems.
With the continuous development of the industry, protocols must embrace emerging technologies, collaborate with leading projects, and prioritize transparency and decentralization. This can not only establish a strong and sustainable future for DeFi, but also provide the possibility for DeFi to have a profound impact on the global financial landscape.
Statement: Space and Time, ChainML, Nil Foundation, and Solity are IOSG's portfolio.
References:
Crypto x AI: https://messari.io/report/growing-synergies-in-ai-and-crypto?referrer=all-research
ZKML: https://docs.google.com/presentation/d/1zr0yLuUT2wjFYIgyU1zt80Gq8QaUdtX1YaGHsBi4z_g/edit#slide=id.g2294a8289d3_6_99ZKML
ecosystem: https://twitter.com/Louissongyz/status/165808735477367193
Original link
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia
