An introduction to the possibilities with Deeplink

A look into some of the use cases for a deep learning layer in blockchain

Gavin Stein
Deeplink Labs
5 min readApr 19, 2022

--

image source

The decentralisation movement hit countless industries hard and fast with promises to revolutionise the way stakeholders interact. For the most part, this is very true. One such example is DeFi — we have seen financial primitives (such as lending and borrowing) be reborn using the innovations of programmable blockchains. While these technologies are cutting edge and push the boundaries of what we thought was possible, it is time for them to take their next evolutionary step; with artificial intelligence and deep learning. This is the cutting edge of the cutting edge.

This evolution has been witnessed over the last decade in the internet realm — businesses and applications have integrated deep learning into their products and services to make them better, and open up all sorts of new functionality and possibilities. The on-chain centric nature of blockchain generates a data footprint unprecedented in capital market vehicles¹. Such a massive collection of instant and evolving data is perfect for the implementation of deep learning; improving the experience and functionality of stakeholders across the board.

To help you understand, you can think of the current state of blockchain and decentralised services being similar to that of the internet at the turn of the millennium. The same way websites at that time were static and lacked much of the functionality we see today, smart contracts and protocols are also at that stage. As the technology matures, the functionality will improve, bringing with it a massive influx of new users. This functionality will require deep learning capabilities, which is why Deeplink will be so important.

Capital Efficiency

Deep learning tools are perfect for improving capital efficiency, and have been implemented across many industries. Blockchain protocols will be no exception. In the context of DEXs, it will be liquidity warehousing and AMM management, or for DeFi protocols, it will be optimising LTV ratios and lending/borrowing interest rates. There are so many inefficiencies that stand to benefit from deep learning functionality. The following are just a few illustrative examples:

Decentralised Exchanges:

The same way Amazon predicts demand to match supply, and uses this information to be a proactive participant within the supply chain, DEXs too can predict liquidity demand and can ensure there is enough liquidity to match this demand. This will enable AMMs to optimise their liquidity pools for high volume events, making transactions at this time cheaper for users and more profitable for liquidity providers.

Current AMMs take in little relevant data, and none from outside its own ecosystem, when determining the pricing of the assets in the pool. While some current generation DEXs are improving (i.e. UniSwap v3 and the introduction of concentrated liquidity and oracle upgrades²), there is only so far they can go without deep learning. The ideal AMM would have a full understanding of current market conditions and historical data before making decisions regarding its pricing of assets. This will enable AMMs to ultimately provide better liquidity in the market.

DEXs can also benefit from deep learning functionality through optimised trade execution. The AMM design differs from order books used in centralised exchanges, but it can still benefit from smart order routing. This is easily illustrated with UniSwap’s v3 multi-pool architecture. Each asset pair on UniSwap v3 can now consist of more than one liquidity pool, with different fee’s attached to trading within that pool. Users coming to trade that asset pair, obviously want to minimise their slippage and fees incurred for their trade. Uniswap v3 currently implements Split Orders and Gas Cost Awareness to optimise their capital efficiency in Auto Router mechanism.

From UniSwap’s documentation

While this simple logic can achieve a form of order routing to a certain degree, it is not smart in any sense of the word. Deep learning is the perfect tool to optimise the execution of trades, selecting which pool, or pools, to trade within to execute the trade at the best price and lowest slippage. Maintaining this functionality as bots on-chain allows for greater transparency and security for the protocol.

Decentralised Finance:

The capital efficiency benefits is not limited to AMMs and DEXs. Lending and borrowing (L&B) protocols frequently engage in decision making that is ripe for the implementation of deep learning. Three key components of any L&B protocol is its loan-to-value (LTV) ratio, its liquidation threshold, and its lend/borrow interest rates. These types of protocols obviously want to maximise the interest rates they can give lenders to attract capital, and minimise the interest rate they charge borrowers to stay competitive. They also want to pay careful attention to the LTV ratio and liquidation threshold they set to minimise the risk they take on but also offer customers the best value. At the moment, L&B protocols use very simple formulas to calculate these values. For example, check out AAVE’s documentation on risk parameters here. These parameters can be optimised using deep learning models which consider a massive amount of additional data points, giving these protocols a competitive advantage by reducing risk and giving users better interest rates.

On-chain Algorithms

The current, static nature of smart contracts prevents a lot of functionality. Deeplink has proposed the introduction of on-chain algorithms, to overcome this issue. This will open all sorts of possibilities for blockchain protocols.

Trading & execution:

The vast array of trading & swapping venues for trade execution adds a layer of complexity in crypto which can be further optimised through machine learning. Trades can be executed through centralised exchanges, decentralised exchanges and directly through protocol smart contracts; all with different order types and latencies. Various methods of execution such as limit orders, market orders, AMMs, stops, trailing stops etc. (many of which are currently not available on decentralised services) add further opportunities for optimisation in the space.

Implementing smart order routing to identify optimal liquidity allocation when trading to reduce slippage and manage gas/transaction fees will be made possible. Similar to that discussed above, but applied across many venues means more efficient trading with lower gas and transaction fees. This can be used in conjunction with a rule engine which accounts for performance parameters of exchanges, manages latency, and market mechanisms to predict optimal trading execution. This is a key use case of predictive analytics, determining optimal limit order price to ensure the trade has the highest possibility of execution, while the order is in transit from the trader’s environment to the exchange.

Yield farming:

Yield farming protocols initially began with simple rule based algorithms searching for the best price available and allocating capital to the venue with the highest yield. However, to maintain a competitive edge these protocols have developed advanced methods of generating yield through more complex yield bearing solutions. Improving these strategies with machine learning to understand potential dangers and volatility in the market is essential to minimise risk in this sector. Utilising Deeplink’s proposed super cluster in conjunction with domain specific data ranges will allow for better management of TVL, and optimising returns for participants. Understanding the market sentiment and health holistically will provide a 30,000 foot view of the space.

--

--

Gavin Stein
Deeplink Labs

Legal Solutions Developer; Computer Science and blockchain enthusiast