The "Smart Automation" Era: Can Intentional Trading and AI-Agents Spark a Flame?
0
4
0
Author: LT, Ethos Lau
Read time: 14 Minutes
Introduction
Many experts and industry leaders, including Ethereum founder Vitalik Buterin and the team at Paradigm, believe that intent-centric transactions will be one of the important directions for the development of blockchain applications in the future. In our article, we explore the concept of intentional trading and its potential, analyzing how this model can simplify user experience, enhance transaction security, and bring more innovative opportunities for decentralized applications. We also discuss the role of AI agents, exploring how they can be combined with intentional trading to further promote the automation and intelligence of smart contracts, providing users with a smarter and more personalized blockchain interaction experience.
What is Intentional Trading
When you want to take a taxi, you open a travel app, select the starting point, and a price range will appear at the bottom of the interface for you to set; when you use a food delivery app to order delicious food, after searching for similar products, the interface has filtering conditions for price, time, distance, etc., for you to choose. In this scenario, "what I want to buy," coupled with time and price restrictions, constitutes a trading intent. Nowadays, many apps add options to let customers fill in their "intent" to facilitate their use. Of course, the intent does not only include preset transaction prices; the price is one of the most commonly used parameters in the intent.
In the context of blockchain, intentional trading refers to the user executing blockchain operations in a goal-oriented manner. In this process, users only express their ultimate goals (time, transaction price, and other transaction conditions) without caring about the specific steps involved. In this process, users sign a contract, allowing users to "outsource" the creation of transactions to a third party. Intermediate steps are handled by third-party problem solvers (which may be human/programs). As long as the output is within the range specified in the user's intent, the solver (also known as the "solver") can freely achieve the result (usually searching and matching other intents in the community, exchanges, etc., to meet the needs of multiple users). Users usually need to pay a certain amount of money to the solver to help complete the transaction.
Two Core Features of Intentional Trading:
Firstly, intent-based blockchain transactions adopt a "declarative programming method," which does not specify the sequence of steps to be executed but directly declares the expected outcome of the transaction.
Secondly, once users have defined their trading intent, the process of building the actual transaction is handed over to a third-party solver, who is responsible for generating the traditional blockchain transactions needed to achieve the expected outcome.
A necessary condition for the establishment of intentional trading: A series of digital currencies represented by Bitcoin has a unique feature, that is, they have an inherent unity, that is, all bitcoins are essentially the same, similar to the unity of electrons and other fundamental particles. This characteristic makes Bitcoin show consistency and substitutability in transactions and use. Therefore, the method of intentional trading is suitable for dealing with virtual currencies with the "same" attribute, and users do not have to worry about the quality of the goods purchased at a lower price being lower than the goods purchased at a higher price.
Potential Benefits and Applications of Intentional Trading
The most obvious benefit of intent-based trading is to simplify the trading process.
Through this approach, transaction details (which may include buying tokens/other in-app purchases) can be reduced to enhance the user experience in dApps. It not only helps with normal transactions but also supports repeated transactions so that users can avoid the inconvenience of regular manual purchases/transfers. It can also support time-related or condition-based transactions, which may include automatic recharge of balances. For example, when the balance is insufficient, a simple command like "When my wallet balance is less than 100, transfer/buy xx coins" can automatically transfer. It can also eliminate the hassle of regularly buying tokens through simple commands.
In terms of helping the user experience, this promotes the use of blockchain technology because it allows newcomers to cryptocurrencies not to deal with all the tedious steps.
Since intent-based trading only focuses on the output, orders do not need to be traded immediately. Due to the system's flexibility in time, it can execute orders when the market is most favorable, thereby reducing slippage when prices change. The solver tries to find the best path, sometimes meaning it can aggregate orders for larger transactions to further reduce slippage. Users can also specify the maximum slippage fee they are willing to pay in their intent so that each transaction is ideal for them. Note: Slippage in trading refers to the difference between the executed price and the expected price. This usually occurs during periods of high market volatility or low liquidity when the market cannot match orders at the preferred price. Slippage can be positive or negative. Positive slippage means that the order is executed at a better price than expected, while negative slippage means that the order is executed at a worse price than expected.
Intent-based trading can set conditions and goals to achieve on-chain operations and has many potential applications. For example, setting limit orders to buy tokens at the target price, setting slippage (acceptable difference range), regularly buying tokens at a fixed time, automatically transferring when the balance is insufficient, and buying or selling tokens in time according to significant events reported by the oracle. Or, using the oracle method, when an event (economic event, political event) occurs, immediately execute an operation, such as automatically selling when the stock market falls to a certain level, automatically buying Bitcoin when a candidate Terry successfully takes the position of president.
The current traditional trading model has issues with opacity and centralized risks - users have limited understanding of the actual execution process when submitting transactions. The transaction results are largely affected by factors such as network congestion at specific execution times, the behavior of miners or validators, and the overall state of the blockchain. This opacity makes users vulnerable to front-running, back-running, and other "Maximal Extractable Value" (MEV) techniques. In addition, the high degree of transaction freedom given to miners, validators, and relayers allows them to easily extract value through reordering, censorship, and other techniques. The lack of execution visibility exacerbates users' vulnerability to MEV attacks.
MEV attacks are a phenomenon in the cryptocurrency and blockchain field that exploits information asymmetry and transaction privileges to obtain excessive profits. This type of attack affects the user experience, undermines market fairness, threatens system stability, and wastes resources. Common forms include front-running, sandwich attacks, liquidation arbitrage, back-running transactions, and miner self-interested behavior, etc.
Taking the sandwich attack as an example, it usually involves a malicious trader in a decentralized finance (DeFi) protocol or service, manipulating asset prices by placing orders before and after a user's transaction at the same time. This attack method not only affects the price of transaction execution but may also affect the commission earned by liquidity providers.
To guard against sandwich attacks, some platforms such as 1inch have introduced new order types called "flashbot transactions," which are not broadcast to the transaction pool but are only visible after being mined, thus protecting transactions from being seen and exploited by malicious traders. In addition, users can keep their transactions private by using custom RPC endpoints, avoiding being seen and exploited by sandwich bots.
Random time trading, as a strategy, is based on the core idea of making transaction times unpredictable, increasing the difficulty of market manipulation. By executing transactions at different times randomly, the risk of being predicted and exploited by malicious traders can be reduced. However, it is worth noting that although random time trading can serve as a preventive measure, whether sandwich attacks are worth doing by attackers also depends on whether the cost of executing these transactions exceeds the financial benefits the attackers can obtain from other traders. Therefore, random time trading combined with other protective measures can more effectively prevent market manipulation and sandwich attacks.
Intentional Trading Case: UniswapX
Introduction to Uniswap
Uniswap was individually invented by Hayden Adams, a former mechanical engineer. After becoming unemployed in 2017, Hayden Adams was inspired by the concept of Automated Market Maker (AMM) by Ethereum co-founder Vitalik Buterin. He began to self-study the smart contract programming language Solidity and started developing Uniswap. In November 2018, the first version of Uniswap, V1, was launched on the Ethereum mainnet, providing decentralized token exchange services based on AMM. Subsequently, Uniswap developed rapidly, launching V2 and V3 versions, continuously optimizing the trading experience and liquidity provision mechanisms.
Introduction to UniswapX
UniswapX is an innovative decentralized trading protocol that uses a permissionless, open-source (GPL) auction mechanism, allowing users to trade between different AMMs and other liquidity sources. The core of this protocol is intentional trading, where users only need to express their trading intentions without worrying about the specific execution process of the trade. Users only need to clarify their intent, and a single signature can complete all operations.
In UniswapX, there are three different types of reactors: Limit Order Reactor, Dutch Order Reactor, and Exclusive Dutch Order Reactor (Dutch and Exclusive Dutch order reactors), which are responsible for processing different types of orders that participants may place. Among them, the Exclusive Dutch Order is a new type of order, similar to the Dutch auction, but with a limit on the number of participants.
When users place Dutch or Exclusive Dutch orders through UniswapX, they will contract with Permit2, allowing the transfer of their tokens. Once signed, these orders are published and available for anyone to take and complete. Traders only need to indicate their willingness to trade and receive within a specified time, and 'fillers' can complete the order.
The basis of intentional trading is to allow participants to focus on their desired goals rather than the specific trading process. The premise of intention-based trading is that participants do not have to handle the trade themselves but list the goals they want to achieve. In this way, 'fillers' can use various methods to complete the trade, allowing UniswapX to benefit from a variety of liquidity pools, including decentralized exchanges (DEXs), centralized exchanges (CEXs), cross-chain liquidity networks, native bridging, stablecoin pools, etc., to ensure the best price.
In addition, 'fillers' are motivated to complete the trade as quickly as possible to benefit from higher prices and higher fees per transaction. 'Fillers' will complete the trade as quickly as possible to obtain a higher price and higher fees per transaction. Reactors will verify the contract to ensure that the output of tokens meets expectations.
In summary, UniswapX provides users with a more efficient, transparent, and user-friendly trading environment through its innovative auction mechanism and the concept of intentional trading, while solving some of the problems faced by traditional AMMs, such as trading costs, MEV attacks, and slippage wear and tear.
What is an AI-Agent?
AI-Agent, also known as an Artificial Intelligence Agent, is a computer program capable of making decisions autonomously and executing tasks based on the environment, inputs, and predefined goals. The core components of an AI-Agent include a Large Language Model (LLM) acting as its "brain," enabling it to process information, learn from interactions, make decisions, and take action; observation and perception mechanisms, allowing it to sense the environment; reasoning processes, which involve analyzing observations and memory content and considering possible actions; action execution, as an explicit response to thinking and observation; and memory and retrieval, storing past experiences for learning purposes.
AI-Agents can be reactive, proactive, learning, or collaborative, and they typically operate independently to perform complex tasks. LLMs are trained on vast datasets that include books, articles, websites, and various user inputs.
Some common examples of AI-Agents include ChatGPT, Tesla's Autopilot, and Netflix's recommendation engine. Traditional LLMs are generally used for generating text dialogues, while the concept of an AI-Agent emphasizes the ability to use and control other tools. ChatGPT is a virtual assistant that uses Natural Language Processing (NLP) to learn how to understand text. During training, the LLM learns to predict the next word in a sentence, helping it understand context, grammar, and meaning. In contrast, Tesla's Autopilot makes calculations in milliseconds to determine the car's speed and angle of travel. It is trained on images and videos to determine distances between objects and what the objects might be. On the road, the agent uses all cameras to identify different objects and generate a virtual map of its surroundings to accurately determine how to drive. Netflix's AI-Agent recommends movies to users based on what they have previously watched. It collects a large amount of data on how users interact with different types of movies, such as viewing times, search queries, and ratings. It also analyzes information about the genre, actors, directors, release year, and more of the movies. By combining these two types of data, the recommendation engine recommends movies to users based on the viewing records of similar users.
On a mature AI-Agent platform, users simply need to give instructions to the Agent, and the LLM, like the brain, will smartly call upon various tools, like limbs, to present content to the user or meet their requirements.
The application scenarios for AI-Agents are very broad, covering e-commerce, education, real estate, travel, finance, healthcare, transportation, government services, media, and entertainment, among other fields. They can provide personalized recommendations, intelligent customer service, market trend analysis, property valuation, travel marketing optimization, customer service and support, educational data analysis, medical image analysis, and intelligent recommendation systems. The functions of AI-Agents include perceiving environmental changes, responsive actions, reasoning and interpretation, problem-solving, reasoning and learning, action and result analysis, etc. They can automate repetitive tasks, provide personalized experiences, achieve seamless and cost-effective scalability, improve usability, save costs, and provide data-driven insights.
AI-Agents offer many benefits and have completely transformed the way businesses and services operate. Their efficiency and consistency in handling repetitive tasks ensure accurate execution of processes, unaffected by fatigue affecting human workers. Through personalization and dynamic adjustment, AI-Agents tailor experiences to individual user preferences, adapting in real-time to ensure relevance and engagement. Their scalability and availability allow them to manage a large number of tasks around the clock, providing seamless service without downtime. Additionally, AI-Agents excel at complex pattern recognition, identifying subtle trends in data, which drives wiser decision-making. This significantly reduces costs by optimizing processes and reducing the need for a large workforce. Furthermore, AI-Agents are catalysts for innovation, creating new business models and services, enhancing competitive advantage. They also enhance security through risk and fraud detection, monitoring suspicious activities, and protecting against threats. Finally, their ability to optimize resources contributes to more sustainable and efficient operations, making them an indispensable asset in various industries. As a new technology based on LLM, AI-Agents can make decisions and execute actions based on specific scenarios, "transforming large language models from stateless APIs into stateful tools."
The relationship between AI-Agent and Intentional Trading
In intentional trading, an AI-Agent would be an intelligent personal assistant designed to help users complete various tasks by understanding natural language inputs. The Large Language Model (LLM) can be integrated into an intentional architecture, allowing users to express their needs without considering how to achieve them. In the trading field, intentional trading allows users to declare the expected outcome of a trade, with the process of constructing the actual trade handled by a third-party solver. The integration of an AI-Agent can enhance the efficiency and intelligence of this process. For example, the AI-Agent can leverage its capabilities in perception, planning, memory, tool use, etc., to interact with the solver, automatically execute trading strategies, and optimize the price and timing of trade execution.
After the AI can interpret the user's intent, it can quickly communicate with the solver and generate results. If the solver is integrated into the interface, the trading speed may be faster. The solver processes through multiple sources, such as different centralized exchanges, on-chain/off-chain liquidity sources, so it can find the best trading exchange rate because it can compare all prices faster than anyone else.
In addition to speed, the solver can also connect to various liquidity pools. This will also reduce the gas costs of cross-chain transactions because the solver automatically finds the best way to execute the intent.
Future Prospects
Companies like Circle have been researching how to combine these two concepts. They created a prototype called TXT2TXN, which allows users to exchange and transfer funds on some EVM chains. Users need to log in and connect to their wallets, then enter their intent. After writing down the intent, the LLM will identify whether the input/intent is a transfer or a swap; if the intent is not recognized, it will show "No matches." Then it will fill in a structure to create a CowSwap order for swapping, or create a transaction payload for transfer. Users will receive and sign a contract to complete the transaction. During the transaction processing, the interface will display a confirmation link to verify the transaction or swap so that users can track.
We believe there are areas that can be improved. For example, it would be very beneficial for the AI to ask questions to ensure that the AI-Agent can correctly understand the intent. If the intent is misunderstood, it could lead to problems, as this process involves fund transfers and could lead to legal issues in the future. We hope to see AI-Agents perform new functions, such as purchasing NFTs or tokens through dApps. This would greatly increase their practicality as users can perform more tasks without constant updates to the interface by programmers. Circle is considering adding a new feature, which is to integrate a personal address book into the AI-Agent to enhance the user experience, making the input of intent clearer and more convenient.
By allowing the solver to help realize your intent, we must also consider the problems discovered by the counterparty. Because the solver collects a lot of user intent information, in addition to general information and data leakage risks, they also trade strategically to manipulate the market to obtain MEV, which could lead to market fragmentation and liquidity issues. If the solver chooses to use this data without restrictions, it could lead to a loss of trust in the decentralized financial ecosystem among community members.
References:
https://cointelegraph.com/learn/intent-based-architectures-and-applications-in-blockchain
https://www.halborn.com/blog/post/intent-centric-blockchain-are-intents-the-next-big-thing-in-web3
https://docs.uniswap.org/contracts/uniswapx/overview
https://blog.li.fi/uniswapx-a-deep-dive-4b4ea7673dc1
https://www.circle.com/blog/txt2txn-using-ai-llms-for-internet-based-applications
https://anoma.net/blog/an-introduction-to-intents-and-intent-centric-architectures
https://www.paradigm.xyz/2023/06/intents