Stefan Loesch, Nate Hindman, Mark B Richardson, Nicholas Welch
AMMs are autonomous smart contracts deployed on a blockchain that make markets between different assets that live on that chain. In this paper we are examining a specific class of AMMs called Constant Function Market Makers whose trading profile, ignoring fees, is determined by their bonding curve. This class of AMM suffers from what is commonly referred to as Impermanent Loss, which we have previously identified as the Gamma component of the associated self-financing trading strategy and which is the risk that LP providers wager against potential fee earnings. The recent Uniswap v3 release has popularized the concept of leveraged liquidity provision - wherein the trading range in which liquidity is provided is reduced and achieves a higher degree of capital efficiency through elimination of unused collateral. This leverage increases the fees earned, but it also increases the risk taken, ie the IL. Fee levels on Uniswap v3 are well publicized so, in this paper, we focus on calculating the IL. We found that for the 17 pools we analyzed, covering 43% of TVL and chosen by size, composite tokens and data availability, total fees earned since inception until the cut-off date was $199.3m. We also found that the total IL suffered by LPs during this period was USD 260.1m, meaning that in aggregate those LPs would have been better off by USD 60.8m had they simply HODLd.
Xiao-Yang Liu, Hongyang Yang, Jiechao Gao, Christina Dan Wang
Deep reinforcement learning (DRL) has been envisioned to have a competitive edge in quantitative finance. However, there is a steep development curve for quantitative traders to obtain an agent that automatically positions to win in the market, namely \textit{to decide where to trade, at what price} and \textit{what quantity}, due to the error-prone programming and arduous debugging. In this paper, we present the first open-source framework \textit{FinRL} as a full pipeline to help quantitative traders overcome the steep learning curve. FinRL is featured with simplicity, applicability and extensibility under the key principles, \textit{full-stack framework, customization, reproducibility} and \textit{hands-on tutoring}. Embodied as a three-layer architecture with modular structures, FinRL implements fine-tuned state-of-the-art DRL algorithms and common reward functions, while alleviating the debugging workloads. Thus, we help users pipeline the strategy design at a high turnover rate. At multiple levels of time granularity, FinRL simulates various markets as training environments using historical data and live trading APIs. Being highly extensible, FinRL reserves a set of user-import interfaces and incorporates trading constraints such as market friction, market liquidity and investor's risk-aversion. Moreover, serving as practitioners' stepping stones, typical trading tasks are provided as step-by-step tutorials, e.g., stock trading, portfolio allocation, cryptocurrency trading, etc.
Danial Saef, Odett Nagy, Sergej Sizov, Wolfgang Karl Härdle
While attention is a predictor for digital asset prices, and jumps in Bitcoin prices are well-known, we know little about its alternatives. Studying high frequency crypto data gives us the unique possibility to confirm that cross market digital asset returns are driven by high frequency jumps clustered around black swan events, resembling volatility and trading volume seasonalities. Regressions show that intra-day jumps significantly influence end of day returns in size and direction. This provides fundamental research for crypto option pricing models. However, we need better econometric methods for capturing the specific market microstructure of cryptos. All calculations are reproducible via the quantlet.com technology.
We examine how the introduction of concentrated liquidity has changed the liquidity provision market in automated market makers such as Uniswap. To this end, we compare average liquidity provider returns from trading fees before and after its introduction. Furthermore, we quantify the performance of a number of fundamental concentrated liquidity strategies using historical trade data. We estimate their possible returns and evaluate which perform best for certain trading pairs and market conditions.
We present an automated market-making (AMM) cross-settlement mechanism for digital assets on interoperable blockchains, focusing on central bank digital currencies (CBDCs) and stable coins. We develop an innovative approach for generating fair exchange rates for on-chain assets consistent with traditional off-chain markets. We illustrate the efficacy of our approach on realized FX rates for G-10 currencies.
In this paper we extend the analysis of an agent-based model for adaptive trading, called asynchronous stochastic price pump (ASPP) introduced by Perepelitsa and Timofeyev (2019), to the model with heterogeneous distribution of psychological parameters of speculative optimism and pessimism across the population of traders. We show that the new model has a range of qualitatively different dynamics when the correlation between those factors ranges from low negative to large positive values. A statistical parameter estimation suggests a heterogeneous ASPP with negative correlation as a model of price variations of Bitcoin.
We study recurrent patterns in volatility and volume for major cryptocurrencies, Bitcoin and Ether, using data from two centralized exchanges (Coinbase Pro and Binance) and a decentralized exchange (Uniswap V2). We find systematic patterns in both volatility and volume across day-of-the-week, hour-of-the-day, and within the hour. These patterns have grown stronger over the years and can be related to algorithmic trading and funding times in futures markets. We also document that price formation mainly takes place on the centralized exchanges while price adjustments on the decentralized exchanges can be sluggish.
The rise of Ethereum and other blockchains that support smart contracts has led to the creation of decentralized exchanges (DEXs), such as Uniswap, Balancer, Curve, mStable, and SushiSwap, which enable agents to trade cryptocurrencies without trusting a centralized authority. While traditional exchanges use order books to match and execute trades, DEXs are typically organized as constant function market makers (CFMMs). CFMMs accept and reject proposed trades based on the evaluation of a function that depends on the proposed trade and the current reserves of the DEX. For trades that involve only two assets, CFMMs are easy to understand, via two functions that give the quantity of one asset that must be tendered to receive a given quantity of the other, and vice versa. When more than two assets are being exchanged, it is harder to understand the landscape of possible trades. We observe that various problems of choosing a multi-asset trade can be formulated as convex optimization problems, and can therefore be reliably and efficiently solved.
Over 90% of exchange trading on crypto options has always been on the Deribit platform. This centralised crypto exchange only lists inverse products because they do not accept fiat currency. Currently, fiat-based traders can only make deposits in bitcoin, although they can withdraw both bitcoin and ether to their on-chain wallets. Likewise, other major crypto options platforms only list crypto--stablecoin trading pairs in so-called direct options, which are similar to the standard crypto options listed by the CME except the U.S. dollar is replaced by a stablecoin version. Until now a clear mathematical exposition of these products has been lacking. We discuss the sources of market incompleteness in direct and inverse options and compare their pricing and hedging characteristics. Then we discuss the useful applications of currency protected "quanto" direct and inverse options for fiat-based traders and describe their pricing and hedging characteristics, all in the Black-Scholes setting.
Purpose This paper aims to demonstrate a dynamic cointegration-based pairs trading strategy, including an optimal look-back window framework in the cryptocurrency market and evaluate its return and risk by applying three different scenarios. Design/methodology/approach This study uses the Engle-Granger methodology, the Kapetanios-Snell-Shin test and the Johansen test as cointegration tests in different scenarios. This study calibrates the mean-reversion speed of the Ornstein-Uhlenbeck process to obtain the half-life used for the asset selection phase and look-back window estimation. Findings By considering the main limitations in the market microstructure, the strategy of this paper exceeds the naive buy-and-hold approach in the Bitmex exchange. Another significant finding is that this study implements a numerous collection of cryptocurrency coins to formulate the model’s spread, which improves the risk-adjusted profitability of the pairs trading strategy. Besides, the strategy’s maximum drawdown level is reasonably low, which makes it useful to be deployed. The results also indicate that a class of coins has better potential arbitrage opportunities than others. Originality/value This research has some noticeable advantages, making it stand out from similar studies in the cryptocurrency market. First is the accuracy of data in which minute-binned data create the signals in the formation period. Besides, to backtest the strategy during the trading period, this study simulates the trading signals using best bid/ask quotes and market trades. This study exclusively takes the order execution into account when the asset size is already available at its quoted price (with one or more period gaps after signal generation). This action makes the backtesting much more realistic.
Does the proof-of-work consensus protocol serve its intended purpose of supporting decentralized cryptocurrency mining? To address this question, we develop a game-theoretical model in which miners first invest in hardware to improve the efficiency of their operations and then compete for mining rewards in a rent-seeking game. We show that centralization grows with heterogeneity in mining costs, but hardware capacity constraints prevent the most efficient miners from monopolizing the mining process. Investment leads to a more decentralized network unless larger miners have a significant comparative advantage in acquiring new hardware. Our model generates empirically supported implications: (i) mining centralization is countercyclical with respect to mining reward, and (ii) a change in mining reward leads to a less-than-proportional change in hash rates. This paper was accepted by David Simchi-Levi, Special Section of Management Science: Blockchains and Crypto Economics. Supplemental Material: The data file is available at https://doi.org/10.1287/mnsc.2023.4840 .
We suggest a framework to determine optimal trading fees for constant function market makers (CFMMs) in order to maximize liquidity provider returns. In a setting of multiple competing liquidity pools, we show that no race to the bottom occurs, but instead pure Nash equilibria of optimal fees exist. We theoretically prove the existence of these equilibria for pools using the constant product trade function used in popular CFMMs like Uniswap. We also numerically compute the equilibria for a number of examples and discuss the effects the equilibrium fees have on capital allocation among pools. Finally, we use our framework to compute optimal fees for real world pools using past trade data.
AI and data driven solutions have been applied to different fields and achieved outperforming and promising results. In this research work we apply k-Nearest Neighbours, eXtreme Gradient Boosting and Random Forest classifiers for detecting the trend problem of three cryptocurrency markets. We use these classifiers to design a strategy to trade in those markets. Our input data in the experiments include price data with and without technical indicators in separate tests to see the effect of using them. Our test results on unseen data are very promising and show a great potential for this approach in helping investors with an expert system to exploit the market and gain profit. Our highest profit factor for an unseen 66 day span is 1.60. We also discuss limitations of these approaches and their potential impact on Efficient Market Hypothesis.
Bitcoin, one of the major cryptocurrencies, presents great opportunities and challenges with its tremendous potential returns accompanying high risks. The high volatility of Bitcoin and the complex factors affecting them make the study of effective price forecasting methods of great practical importance to financial investors and researchers worldwide. In this paper, we propose a novel approach called MRC-LSTM, which combines a Multi-scale Residual Convolutional neural network (MRC) and a Long Short-Term Memory (LSTM) to implement Bitcoin closing price prediction. Specifically, the Multi-scale residual module is based on one-dimensional convolution, which is not only capable of adaptive detecting features of different time scales in multivariate time series, but also enables the fusion of these features. LSTM has the ability to learn long-term dependencies in series, which is widely used in financial time series forecasting. By mixing these two methods, the model is able to obtain highly expressive features and efficiently learn trends and interactions of multivariate time series. In the study, the impact of external factors such as macroeconomic variables and investor attention on the Bitcoin price is considered in addition to the trading information of the Bitcoin market. We performed experiments to predict the daily closing price of Bitcoin (USD), and the experimental results show that MRC-LSTM significantly outperforms a variety of other network structures. Furthermore, we conduct additional experiments on two other cryptocurrencies, Ethereum and Litecoin, to further confirm the effectiveness of the MRC-LSTM in short-term forecasting for multivariate time series of cryptocurrencies.
Ye Wang, Yan Chen, Haotian Wu, Liyi Zhou · 6 authors
Decentralized Exchanges (DEXes) enable users to create markets for exchanging any pair of cryptocurrencies. The direct exchange rate of two tokens may not match the cross-exchange rate in the market, and such price discrepancies open up arbitrage possibilities with trading through different cryptocurrencies cyclically. In this paper, we conduct a systematic investigation on cyclic arbitrages in DEXes. We propose a theoretical framework for studying cyclic arbitrage. With our framework, we analyze the profitability conditions and optimal trading strategies of cyclic transactions. We further examine exploitable arbitrage opportunities and the market size of cyclic arbitrages with transaction-level data of Uniswap V2. We find that traders have executed 292,606 cyclic arbitrages over eleven months and exploited more than 138 million USD in revenue. However, the revenue of the most profitable unexploited opportunity is persistently higher than 1 ETH (4,000 USD), which indicates that DEX markets may not be efficient enough. By analyzing how traders implement cyclic arbitrages, we find that traders can utilize smart contracts to issue atomic transactions and the atomic implementations could mitigate users' financial loss in cyclic arbitrage from the price impact.
First, a big data analysis of the transactions and smart contracts made on the Ethereum blockchain is performed, revealing interesting trends in motion. Next, these trends are compared with the public's interest in Ether and Bitcoin, measured by the volume of online searches. An analysis of the crypto prices and search trends suggests the existence of big players (and not the regular users), manipulating the market after a drop in prices. Lastly, a cross-correlation study of crypto prices and search trends reveals the pairs providing more accurate and timely predictions of Ether prices.
Constant Function Market Makers (CFMMs) are a family of automated market makers that enable censorship-resistant decentralized exchange on public blockchains. Arbitrage trades have been shown to align the prices reported by CFMMs with those of external markets. These trades impose costs on Liquidity Providers (LPs) who supply reserves to CFMMs. Trading fees have been proposed as a mechanism for compensating LPs for arbitrage losses. However, large fees reduce the accuracy of the prices reported by CFMMs and can cause reserves to deviate from desirable asset compositions. CFMM designers are therefore faced with the problem of how to optimally select fees to attract liquidity. We develop a framework for determining the value to LPs of supplying liquidity to a CFMM with fees when the underlying process follows a general diffusion. Focusing on a popular class of CFMMs which we call Geometric Mean Market Makers (G3Ms), our approach also allows one to select optimal fees for maximizing LP value. We illustrate our methodology by showing that an LP with mean-variance utility will prefer a G3M over all alternative trading strategies as fees approach zero.
Johannes Rude Jensen, Mohsen Pourpouneh, Kurt Nielsen, Omri Ross
Automated market makers (AMM) have grown to obtain significant market share within the cryptocurrency ecosystem, resulting in a proliferation of new products pursuing exotic strategies for horizontal differentiation. Yet, their theoretical properties are curiously homogeneous when a set of basic assumptions are met. In this paper, we start by presenting a universal approach to deriving a formula for liquidity provisioning for AMMs. Next, we show that the constant function market maker and token swap market maker models are theoretically equivalent when liquidity reserves are uniform. Proceeding with an examination of AMM market microstructure, we show how non-linear price effect translates into slippage for traders and impermanent losses for liquidity providers. We proceed by showing how impermanent losses are a function of both volatility and market depth and discuss the implications of these findings within the context of the literature.
Jiahua Xu, Krzysztof Paruch, Simon Cousaert, Yebo Feng
As an integral part of the decentralized finance (DeFi) ecosystem, decentralized exchanges (DEXs) with automated market maker (AMM) protocols have gained massive traction with the recently revived interest in blockchain and distributed ledger technology (DLT) in general. Instead of matching the buy and sell sides, automated market makers (AMMs) employ a peer-to-pool method and determine asset price algorithmically through a so-called conservation function. To facilitate the improvement and development of automated market maker (AMM)-based decentralized exchanges (DEXs), we create the first systematization of knowledge in this area. We first establish a general automated market maker (AMM) framework describing the economics and formalizing the system's state-space representation. We then employ our framework to systematically compare the top automated market maker (AMM) protocols' mechanics, illustrating their conservation functions, as well as slippage and divergence loss functions. We further discuss security and privacy concerns, how they are enabled by automated market maker (AMM)-based decentralized exchanges (DEXs)' inherent properties, and explore mitigating solutions. Finally, we conduct a comprehensive literature review on related work covering both decentralized finance (DeFi) and conventional market microstructure.
We investigate the market microstructure of Automated Market Makers (AMMs), the most prominent type of blockchain-based decentralized exchanges. We show that the order execution mechanism yields token value loss for liquidity providers if token exchange rates are volatile. AMMs are adopted only if their token pairs are of high personal use for investors, or the token price movements of the pair are highly correlated. A pricing curve with higher curvature reduces the arbitrage problem but also investors' surplus. Pooling multiple tokens exacerbates the arbitrage problem. We provide statistical support for our main model implications using transaction-level data of AMMs.
This paper studies to what extent the cost of operating a proof-of-work blockchain is intrinsically linked to the cost of preventing attacks, and to what extent the underlying digital ledger security budgets are correlated with the cryptocurrency market outcomes. We theoretically derive an equilibrium relationship between the cryptocurrency price, mining rewards and mining costs, and blockchain security outcomes. Using daily crypto market data for 2014-2021 and employing the autoregressive distributed lag approach - that allows treating all the relevant moments of the blockchain series as potentially endogenous - we provide empirical evidence of cryptocurrency price and mining rewards indeed being intrinsically linked to blockchain security outcomes.
Yusuke Ikeno, James Angel, Shin'ichiro Matsuo, Ryosuke Ushida
This paper proposes an auction type resolution for smart derivatives. It has been discussed to migrate derivatives contracts to smart contracts (smart derivatives). Automation is often discussed in this context. It is also important to prepare to avoid disputes from practical perspectives. There are controversial issues to terminate the relationship at defaults. In OTC derivative markets, master agreements define a basic policy for the liquidation process but there happened some disputes over these processes. We propose to define an auction type resolution in smart derivatives, which each participant would find beneficial.
Flash Loan attack can grab millions of dollars from decentralized vaults in one single transaction, drawing increasing attention from the Decentralized Finance (DeFi) players. It has also demonstrated an exciting opportunity that a huge wealth could be created by composing DeFi's building blocks and exploring the arbitrage change. However, a fundamental framework to study the field of DeFi has not yet reached a consensus and there's a lack of standard tools or languages to help better describe, design and improve the running processes of the infant DeFi systems, which naturally makes it harder to understand the basic principles behind the complexity of Flash Loan attacks. In this paper, we are the first to propose Flashot, a prototype that is able to transparently illustrate the precise asset flows intertwined with smart contracts in a standardized diagram for each Flash Loan event. Some use cases are shown and specifically, based on Flashot, we study a typical Pump and Arbitrage case and present in-depth economic explanations to the attacker's behaviors. Finally, we conclude the development trends of Flash Loan attacks and discuss the great impact on DeFi ecosystem brought by Flash Loan. We envision a brand new quantitative financial industry powered by highly efficient automatic risk and profit detection systems based on the blockchain.
Fabin Shi, Nathan Aden, Shengda Huang, Neil F. Johnson · 10 authors
Understanding the emergence of universal features such as the stylized facts in markets is a long-standing challenge that has drawn much attention from economists and physicists. Most existing models, such as stochastic volatility models, focus mainly on price changes, neglecting the complex trading dynamics. Recently, there are increasing studies on order books, thanks to the availability of large-scale trading datasets, aiming to understand the underlying mechanisms governing the market dynamics. In this paper, we collect order-book datasets of Bitcoin platforms across three countries over millions of users and billions of daily turnovers. We find a 1+1D field theory, govern by a set of KPZ-like stochastic equations, predicts precisely the order book dynamics observed in empirical data. Despite the microscopic difference of markets, we argue the proposed effective field theory captures the correct universality class of market dynamics. We also show that the model agrees with the existing stochastic volatility models at the long-wavelength limit.