top of page

Deep Learning Applications in Decentralized Exchanges

Introduction

Using machine learning techniques Amazon anticipates demand to match supply, and uses this information to be a proactive participant within the supply chain. Predicting which markets require greater stock allocations and then routing stock supply to these locations is how the e-commerce giant is able to achieve incredibly fast delivery times and lower prices. They are able to do this through their AI-powered predictive analytics engine to forecast what customers will purchase before they do, using over 140 data points to identify what product will sell on any given day at any location.

Exchanges themselves have a similar stock management problem, where instead of goods that can be purchased, they are dealing with liquidity that can be traded, and instead of minimizing delivery times, they aims to reduce slippage, transaction fees, and gas fees. Decentralized Exchanges can similarly predict liquidity demand and ensure there is enough liquidity to match this demand. This will enable AMMs to optimize their liquidity pools for high-volume events, making transactions at this time cheaper for users and more profitable for liquidity providers.

Deep learning tools are perfect for improving capital efficiency and order execution 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. In this article, we will look at the Uniswap V3 architecture and expose various areas of inefficiency which may be improved through on-chain deep learning agents. The Deeplink Architecture will allow decentralized exchanges to optimize operations at an unprecedented level, which not only monitors pools in their local exchange but also observe the greater Web 3.0 environment to make liquidity allocation decisions. The unprecedented level of available data enabled by a decentralized open ledger being fed into an advanced deep learning algorithm will be an incredibly powerful system.

Architecture

For the specific Uniswap use case, will consist of two primary AI systems, the Uniswap cluster and the overall Web 3.0 Supercluster. The Uniswap cluster will collect data specifically from the Uniswap’s operations and transactions to predict demand in the Uniswap Exchange similar to what is already being used by the exchange. Deeplink aims to introduce a Supercluster that will collect data from all across Web 3.0 and directly from the Ethereum ledger to forecast market sentiment, activity, and health. This data will be sourced from the Open-Source data lake ‘L3 Atom’.

DEEP LEARNING APPLICATIONS IN DECENTRALIZED EXCHANGES
Introduction
Architecture
deep1.png

Deeplink's Uniswap Agent Architecture

Uniswap V3

Uniswap v3’s operations are incredibly advanced making this new iteration of the protocol highly complex. We will try to explain the key features v3 offers simply. Uniswap v3 enables multiple pools for the same pair at three distinct fee tiers.

In 0.05%, 0.3% and 1%. This tier mechanism was put into place to allow users to manage volatility. Highly correlated pairs such as USDT/DAI are significantly less volatile than pairs such as ETH/DAI. The USDT/DAI pair may naturally gravitate to the 0.05% pair while the latter to the 0.3%, whereas more exotic pairs may move into the 1% pools. This mechanism helps reduce the risk of impermanent loss through higher transaction fees.

Uniswap is likely already harnessing the power of machine learning. However, implementing truly decentralized on-chain agents will allow Uniswap to further manage the Blockchain Trilema through greater transparency and security.

Market Awareness

Decentralized exchanges presently do not consider the overall landscape of the market when making decisions with their trading algorithms. If Uniswap were to account for overall market sentiment, price on other exchanges, trade volume, etc. their AMMs will take advantage of inefficiencies in other markets and concentrate liquidity more effectively.

The Deeplink Supercluster will fill this gap in the market, by keeping a record of the overall market sentiment and health which can be viewed at any time. The unprecedented amount of data available as a result of an open decentralized ledger will enable tracking of markets never before seen in the Finance. The Supercluster will provide a feed of market health at that instant which the Uniswap Deeplink agents can use to make decisions based on the overall market.

For example, using an indicator such as the Fear & Greed index and checking social media sentiment to understand if there may be fear in the market and thus providing more liquidity to FIAT-based tokens and stable coins.

Trade Execution

Users coming to trade that asset pair, obviously want to minimize their slippage and fees incurred for their trade. Uniswap v3 currently implements Split Orders and Gas Cost Awareness to optimize their capital efficiency in the Auto Router mechanism.

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 optimize 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.In the example below a user would like to trade 80,000,00 USDT tokens. In Uniswap’s current architecture.

Uniswap v3
Market Awareness
Trade Execution
deep2.png

Uniswap’s Auto Router

The ultimate goal of Deeplink is to enable truly intelligent decentralized systems. Decentralized Exchanges are the future of trading in the Crypto Space and may very well take over Centralized Exchanges, introducing Deep learning and having these operations run through a DAO is the next logical step in achieving a truly Decentralized Economy.

bottom of page