Applications of AI/ML on the Blockchain

Matthew Wang
Valence
Published in
7 min readSep 5, 2023
AI-Generated

We talked about the current state of blockchain x AI integration, now begs the question…why? Does blockchain technology really need AI or vice versa? Empirically, there are a lot of projects developing interesting tangential use-cases involving putting AI personas or LLM-based consumer applications on-chain, but would core blockchain services really benefit from AI integration? What even are the use-cases?

Let’s take a deeper dive.

Cate dive

Preface

In the previous blog post, we talked about the current state of blockchain x AI inference and some of the major limitations that are preventing integration of the two technologies. Quick recap: (1) Hardware limitations of validator nodes and decentralization, (2) Gas and blockspace limitations leading to congestion, (3) New orthogonal security vulnerabilities from trusting off-chain model inference. These are the core problems we’re solving at Vanna Labs, we are re-inventing blockchain architecture to support native, scalable, and trustless AI/ML model inference that can be seamlessly leveraged directly from solidity smart contracts. We would like to open up a new world of possibilities with these native features for decentralized application developers.

But going back to the question: what can AI/ML even do for blockchains? In addition to some cool, new use-cases that we’ll discuss at the end, we’ve identified three core frontiers of applications of this technology in core DeFi: optimization, analysis, and new protocol development.

DeFi Optimization:

In the world of traditional quantitative finance, optimization is the name of the game, significant efforts are often made to eek out every basis point of PnL. That’s why big quantitative hedge funds like Citadel and Two Sigma hire armies of PhDs to do research on not just alpha signal generation, but also other PnL contributors like market impact, toxic flow, risk modeling, portfolio optimization…etc.

Machine learning techniques like regression models for price prediction, volatility forecasting with GARCH models, or regime analysis with hidden markov models are all considered age-old techniques in traditional quant finance that everyone uses from securities pricing to risk management to proprietary trading. Yet, for reasons delineated in the previous blog post, none of this exists on-chain in Web3 DeFi.

TradFi vs DeFi

Compared to TradFi, many DeFi structures have a ton of room for improvement. From AMM liquidity providers bleeding money to lack of risk management in CDP protocols, we think a lot of elements intrinsic to protocol design can be made significantly better by taking a page out of TradFi’s book and using more sophisticated models and computation. By creating accessibility to AI/ML inference directly on the smart contract level on the Vanna Blockchain, we enable all these vanilla DeFi protocols to seamlessly leverage the same aforementioned sophisticated models to perform significantly heavier computational workloads in a verified and trustless fashion, which opens up DeFi to an entire new world of optimization. One can imagine a world where lending protocols compute interest rates using smarter models, AMM pools reducing impermanent loss through charging dynamic fees based on predicted realized volatility, or CDP protocols having better risk engines to minimize loss during liquidation proceedings. We believe higher efficiency and effective risk management through applied ML can seriously level up DeFi’s game to increase traction and adoption. Without the same tools, it’s difficult for decentralized finance to approach traditional quantitative finance in terms of efficiency and optimization.

That’s also why research protocols like Gauntlet make millions of dollars every quarter from big DeFi names that outsource analytical research and optimization to them. However, smaller protocols that can’t afford in-house research teams or outsourced optimization research are gate-kept from these resources. Vanna Blockchain aims to be the layer of infrastructure that not only features trustless, native, and seamless model inference, but also democratizes access to AI/ML models for on-chain use for the evolution and betterment of DeFi.

We’re not attacking modern DeFi; rather, we actually think many elements of DeFi like decentralized market-making or the constant product formula are very elegant. We do think, however, there is room for iterative improvement on certain designs in DeFi, and we’re so excited to be providing the infrastructure that can allow for this new wave of innovation.

DeFi Analysis:

The ability to inference models in a scalable and trustless fashion on-chain also opens up the possibility of running dApps that conduct analysis directly from the smart-contract level. This not only removes the ‘trust’ element from obtaining analysis from research conducted off-chain, but it allows research and analysis to be democratized.

Fitting volatility surfaces for options

As an example to illustrate what can be done, building a volatility surface fitting model into a dApp that fits crypto option volatility surfaces for on-chain users to see and analyze could become a reality. Open-sourced models for polynomial spline interpolation for volatility surfaces, factor analysis for tokens with principal-component analysis, or other crypto-econometric models can all suddenly be run on-chain directly from a smart contract! Imagine connecting your wallet to a web interface, executing a smart contract, and seeing all these interesting metrics pop up about your wallet holdings. Exciting! We believe developments like this not only remove barriers to analysis, but it pushes the DeFi ecosystem forward in general by lending more clarity to the science of crypto economics.

New DeFi Protocols:

One can also imagine building DeFi protocols that are now enabled by model inference such as smart yield-farming protocols based on AI/ML algorithms. There are numerous AI-based DeFi apps like that popping up already, many of which build their own models, zkML proving systems, and off-chain infrastructure for model inference. With the Vanna blockchain in place however, instead of having to rebuild their own infrastructure, dApp developers can simply upload their models (or just use ones we build!) and let the chain do all the work for them. We strongly believe having powerful infrastructure like this in place is what will allow this new wave of DeFi to flourish; making protocol developers who aren’t AI/ML experts re-invent the wheel and build their own off-chain infrastructure from the ground up every time simply doesn’t scale.

We’re very excited by new classes of DeFi protocols that might be enabled by this as well, on-chain algorithmic models that trade crypto-assets could exciting. Building quantconnect/quantopian-esque platforms where people can invest in models or submit their models for competition could be an awful lot of fun and help attract more research talent to the ecosystem.

All in all, by building blockchain infrastructure that allows for trustless and scalable on-chain model inference while building an open-source community led by DeFi incentives, we hope to democratize access to all sorts of use-cases enabled by AI/ML in the DeFi world.

New Non-DeFi Use-Cases

In addition to DeFi, there are also a series of use-cases that deliver value not through optimization, but rather through novelty. This includes “sexy” use-cases like using stable diffusion models to generate NFT art on the blockchain, or using large language models (LLM) like GPT3 to generate text dialogue being used in on-chain games. These are use-cases that could help a product, in this case an NFT project or a GameFi community, gain more traction through differentiation of its novel utilization of new technology. These are certainly use-cases we plan to explore at Vanna Labs too in order to help propel the ecosystem forward.

In the other corner, you also have novel use-cases that actually can serve as a major driving force for improvement of the blockchain space as a whole. A high-impact field being explored is security, for example, Certik began exploring the use of LLMs in flagging obvious smart contract code vulnerabilities. Companies like Guardrail.AI are also creating AI-empowered platforms that detect deeper vulnerabilities in your blockchain stack or infrastructure. This could prove to be impactful in the blockchain security space, even now it’s still not uncommon to see protocols getting drained by common exploits that AI models can likely detect with the wealth of data on similar past exploits. At Vanna Labs, due to our native integration of AI and ML with the blockchain, ingesting on-chain data to inference trained security models to prevent dangerous exploits is not only possible, but could also potentially be automatic and seamless (obtaining data + inference computation all done on chain) and is a use-case we plan to explore.

Use-cases for AI on the Blockchain

Final Thoughts

Conclusively, blockchain applications don’t need AI; after all, we’ve made it quite far without it. But if we want dApps to catch up to its Web2.0 counterparts, and for DeFi to really unleash its true potential, then powerful computation and sophisticated application of AI/ML for higher levels of optimization is a big step forward.

Here at Vanna Labs we’re trying to build infrastructure that would allow easy and seamless deployment of reliable and trustless AI/ML empowered dApps to truly revolutionize the space.

Stay tuned to our medium page, our website, and our twitter for further updates that are coming very soon. Specifically, we will soon be giving a detailed explanation of the Vanna Blockchain!

I hope you’re as excited as we are.

Twitter: https://twitter.com/0xVannaLabs

Website: https://www.vannalabs.ai/

--

--