C rypto T rade: A Reflective LLM -based Agent to Guide Zero-shot Cryptocurrency Trading (2024)

Abstract: The utilization of Large Language Models (LLMs) in financial trading has primarily been concentrated within the stock market, aiding in economic and financial decisions. Yet, the unique opportunities presented by the cryptocurrency market, noted for its on-chain data’s transparency and the critical influence of off-chain signals like news, remain largely untapped by LLMs. This work aims to bridge the gap by developing an LLM-based trading agent, CryptoTrade, which uniquely combines the analysis of on-chain and off-chain data. This approach leverages the transparency and immutability of on-chain data, as well as the timeliness and influence of off-chain signals, providing a comprehensive overview of the cryptocurrency market. CryptoTrade incorporates a reflective mechanism specifically engineered to refine its daily trading decisions by analyzing the outcomes of prior trading decisions. This research makes two significant contributions. Firstly, it broadens the applicability of LLMs to the domain of cryptocurrency trading. Secondly, it establishes a benchmark for cryptocurrency trading strategies. Through extensive experiments, CryptoTrade has demonstrated superior performance in maximizing returns compared to time-series baselines, but not compared to traditional trading signals, across various cryptocurrencies and market conditions. Our code and data are available at https://github.com/Xtra-Computing/CryptoTrade

## introduction large language models (llms) have revolutionized financial decision-making and stock market prediction by excelling in tasks such as sentiment analysis @xcite and explanation generation @xcite . specialized models like fingpt and bloomberggpt @xcite demonstrate this capability. recent research highlights their ability to interpret financial time-series and enhance cross-sequence * equal contribution, ordered alphabetically reasoning @xcite @xcite @xcite . furthermore, the development of llm-based trading agents like sociodojo @xcite underscores the potential for innovating investment strategies. however, the application of llms in the cryptocurrency market remains underexplored, yet this field holds great potential for future development for three main reasons. first, the cryptocurrency market is characterized by high market value, volatility, and uncertainty, which challenge traditional trading signals @xcite @xcite . second, llms have demonstrated their ability to understand and analyze financial markets by leveraging large volumes of multimodal data, such as news and price information @xcite . third, the cryptocurrency market includes open-sourced on-chain data, such as gas prices and total transaction values, providing insights beyond just price movements @xcite @xcite . to bridge this gap, we introduce cryp-totrade. by integrating on-chain data, including market data and transaction records, with off-chain information like financial news, cryptotrade leverages both dimensions to execute daily trading strategies, taking full advantage of the transparency of on-chain data and the immediacy of off-chain information. we detail the structure of cryptotrade in figure 1 . cryptotrade consists of a three-part framework. initially, we collect data where on-chain details such as transactions and broader market data are aggregated alongside off-chain data from established financial news outlets like bloomberg and yahoo finance. after data collection, we perform statistical analyses to calculate indicators such as moving averages, and apply text processing techniques for news summarization using the same gpt models that will later be employed for analysis: gpt-3.5-turbo 1 , gpt-4 2 , and gpt-4o 3 . finally, we enhance day-to-day decision-making with specialized analytical agents: market analyst agent evaluates market trends, news analyst agent interprets recent news impacts, and trading agent deliberates on investment cryptotrade makes day-to-day trading decisions. ## cryptotrade framework this section details the components employed to develop the cryptotrade agent, including data collection, market dynamics analysis, and agents development. figure 1 shows an overview of cryptotrade. ## experiments in this section, we detail the experiments designed to evaluate the efficacy of our proprietary cryptotrade agent in comparison to established baseline strategies within the trading domain. ## related work llms for economics and financial decisions recent advancements in llms have significantly influenced economics and financial decision-making. specialized llms like fingpt, bloomberggpt, finma @xcite @xcite are tailored for finance, handling tasks such as sentiment analysis, entity recognition, and question-answering. another research direction uses llms for financial time-series forecasting. a notable contribution by @xcite employed zero-shot or few-shot inference with gpt-4 and instruction-based fine-tuning with llama to enhance cross-sequence reasoning and multi-modal signal integration. additionally, the development of llmbased agents for financial trading has gained attention. sociodojo @xcite created analytical agents for stock portfolio management, showing the potential for generating "hyperportfolios." despite these advancements, the focus has largely been on the stock market @xcite , leaving a gap in the exploration of the cryptocurrency market where the on-chain data is approachable and with much information. our work aims to address this gap by leveraging both on-chain and off-chain data to navigate the dynamic cryptocurrency market. time-series forecasting for financial markets time-series forecasting has long been a cornerstone of research in economics and financial markets. early studies focused on predicting stock market prices using methodologies such as machine learning @xcite , reinforcement learning (lee, 2001), and traditional time-series models @xcite . the long short-term memory (lstm) model has emerged as particularly influential @xcite for its capability to process and analyze time-series data. with the rise of blockchain technology and cryptocurrencies, these techniques have been extended to crypto assets @xcite . re-cent research has evaluated the impact of various predictors on cryptocurrency pricing and returns, using both on-chain data-such as historical transactions and market volume @xcite -and off-chain factors like social media trends and news sentiment @xcite . these studies underscore the effectiveness of integrating diverse data sources for forecasting the volatile dynamics of the cryptocurrency market. apart from above, transformerbased models have shown particular promise in this area, with state-of-the-art models like informer @xcite , autoformer @xcite , patchtst @xcite , and timesnet @xcite further advancing time-series forecasting. ## conclusion we propose the cryptotrade agent, an innovative approach to cryptocurrency trading that leverages advanced data analysis and llms. by integrating both on-chain and off-chain data, along with a self-reflective component, the cryptotrade agent demonstrates a sophisticated understanding of market dynamics and achieves relatively high returns in cryptocurrency trading. our comprehensive experiments comparing the cryptotrade agent to traditional trading strategies and time-series models reveal its superior ability to navigate the volatile cryptocurrency market, consistently achieving relatively high returns on investment under different market conditions over time-series models while not superior than traditional trading signals: buy and hold and slma. this research underscores the significant potential of llm-driven strategies in enhancing trading performance and sets a new benchmark for cryptocurrency trading with llms.