Fig 3 - uploaded by James Hsin-yu Chiang
Content may be subject to copyright.
The constant product invariant I(x, y) = x · y is swap-rate-consistent (left), demand-sensitive (center), non-depletable, funds-consistent (right) and swap-rate consistent (right).

The constant product invariant I(x, y) = x · y is swap-rate-consistent (left), demand-sensitive (center), non-depletable, funds-consistent (right) and swap-rate consistent (right).

Source publication
Chapter
Full-text available
Automated market makers (AMMs) are one of the most prominent decentralized finance (DeFi) applications. They allow users to exchange units of different types of crypto-assets, without the need to find a counter-party. There are several implementations and models for AMMs, featuring a variety of sophisticated economic mechanisms. We present a theory...

Contexts in source publication

Context 1
... left swap rate limit for the constant product invariant and φ = 1 is lim ε→0 XL swap (ε, r 0 , r 1 ) = r 1 /r 0 , while for the right swap we have lim ε→0 XR swap (ε, r 0 , r 1 ) = r 0 /r 1 . Coinciding left swap limit and right swap limit inverse are illustrated as the slope of the product constant curve at a selected point in Figure 3 (left). The constant product invariant satisfies (14), i.e. it is swap-rate continuous. ...
Context 2
... implicitly require that (15) and the subsequent properties stated for the left version of an exchange rate also hold for the right version. Figure 3 (center) depicts two points (r 0 , r 1 ), (r 0 , r 1 ) on the constant product curve, which satisfy x · y = k for identical k. For the constant product invariant, the left swap limit can be expressed as lim ε→0 XL swap (ε, r 0 , r 1 ) = φ · r 1 /r 0 . ...
Context 3
... the constant product invariant, the left swap limit can be expressed as lim ε→0 XL swap (ε, r 0 , r 1 ) = φ · r 1 /r 0 . For the given k and points in Figure 3 (center): ...

Similar publications

Article
Full-text available
Automated market makers (AMMs) are one of the most prominent decentralized finance (DeFi) applications. AMMs allow users to trade different types of crypto-tokens, without the need to find a counter-party. There are several implementations and models for AMMs, featuring a variety of sophisticated economic mechanisms. We present a theory of AMMs. Th...

Citations

...  DEX Utilizing AMMs: AMMs such as Uniswap have transformed the old order book paradigm, which is prone to front-running, into a liquidity pool model. However, this does not completely solve the problem because there is still potential for arbitrage, which can result in front-running [39].  Sandwich Attack Prevention: Sandwich attacks are a type of front-running in which a malicious ac-tor places a transaction both before (front-running) and after (back-running) a victim's transaction. ...
Article
Full-text available
The Metaverse is a developing mirror of the real world that promises to revolutionize socializing, business, and digital asset connections. Such technology will change the physical world and its environment. Decentralized Finance (DeFi) will completely transform the global financial system. Recent years have seen DeFi transform the financial industry. Since DeFi expanded, banking, insurance, and investing have changed significantly. The decentralized finance sector is growing rapidly, showing that digital currencies and platforms could replace the old financial system. It eliminates expensive intermediaries, lowers transaction costs, and increases financial services access for all, regardless of location or income. Decentralization could provide a risk-free and efficient solution for Metaverse's financial ecosystem, but it has drawbacks. Before implementing financial decentralization, security risks were the main concern. The review paper discusses DeFi's main role in the Metaverse financial ecosystem and security concerns. Front-running attacks are one of the biggest security risks in DeFi, which could cost investors a lot of funds as well as damage the ecosystem.
... Compound operates close to a traditional banking model, aggregating funds deposited by depositors in a liquid pool and lending them to borrowers, algorithmically balancing supply and demand and setting interest rates [12]. The Compound platform is designed to be free of counterparty risk, with depositors contributing crypto assets to the pool and receiving interest, and borrowers lending tokens to the pool and paying interest. ...
Article
Decentralised finance (DeFi) is a decentralised peer-to-peer system based on blockchain technology that facilitates lending and borrowing through smart contract code and lending protocols replacing traditional financial activities that typically require trusted intermediaries such as brokers or banks. In this essay, the four factors of collateral presentation, borrowing rate, lending relationship, and subject of legal connection are compared between decentralized and centralized financial lending models. This paper illustrates the entire DeFi lending model using Compound as a real-world example. The borrowing interest rate is decided in real time by Compound's smart contract according to the supply and demand of funds in the market, so the borrower does not need to bargain with the lender. The smart contract will automatically match the money market. Additionally introduced are the DeFi innovation's concept and features. The paper concludes by discussing the advantages of DeFi lending and borrowing, the hazards associated with doing so, and providing an outlook on the future path of DeFi research.
... An auto market maker (AMM) is a type of algorithm used on decentralized exchanges (DEXs) to automate the process of providing liquidity. AMMs are designed to automatically adjust the supply and demand of assets on a DEX to ensure that users can always trade the assets they want to trade (Bartoletti et al., 2021). AMMs utilize arithmetic to set DEX asset prices. ...
Article
Full-text available
div class="WordSection1"> One of the platforms in the blockchain is a decentralized exchange. The existence of these platforms helps exchange crypto assets instantly in the blockchain ecosystem without having to exchange them at a central exchange. The liquidity guarantors of decentralized exchanges are liquidity providers. This study aims to assess liquidity providers' legal safety on Vexanium, Indonesia's first public blockchain. The normative method employed in this analysis of the laws and regulations related to blockchain in Indonesia involves a preliminary examination of the liquidity provision process. This study found that the decentralized exchange platform on the Vexanium blockchain still needs to meet the criteria as an electronic system following the laws and regulations. In addition, the absence of clear information about the parties in the platform makes the liquidity provision contract voidable. This research can be utilized for platform developers in the Vexanium blockchain to pay more attention to legal aspects in creating their platforms.. </div
... Fees-optimizationbased techniques, such as [12] and [13], regulated transaction fees to lower user expenses. In [12] and [14], the authors presented an automated market maker (AMM) to reduce users' costs by leveraging smart contracts (SCs) to alter gas fees upon incoming transaction requests autonomously. The authors of [13] introduced an automated arbitrage market maker (A2MM) that selects the best-effort two-point arbitrage among various AMMs based on transaction costs. ...
... The authors of [13] introduced an automated arbitrage market maker (A2MM) that selects the best-effort two-point arbitrage among various AMMs based on transaction costs. Generally, in fees-optimization-based systems, fees cannot be forecasted with 100% accuracy before submitting an order since requests may be executed on bridge reserves with higher fees without the user's knowledge [14]. ...
... Miner's utility achieves the highest under the complete information scenario contract and the lowest under no contract. From Fig. 4b, the users' payoff is high under complete information scenario contract followed by incomplete information scenario contract and uniform contract 14 . This trend's deduction can be attributed to the suitable contract design for each user type under the complete information scenario to produce maximal utility and vice versa. ...
Article
Full-text available
Decentralized exchanges (DEXes) provide effective price discovery and fair trading while dealing with the drawbacks of centralized exchanges, e.g., lack of transaction transparency and exclusive control of user assets and transaction fees. However, many DEXes suffer from frontrunning and transaction reordering, which fundamentally flaw their design. In this paper, we present a novel incentive mechanism design for mitigating frontrunning and transaction reordering even if frontrunners pay high transaction fees in DEXes. We utilize a weighted counting sort algorithm to order transactions based on the users’ multi-dimensional private information (e.g., transaction delay and confidentiality). To elicit users’ private information, we consider a multi-dimensional contract-theoretic design based on the users’ willingness to share their private information. We show that the miner can always maximize its utility under the complete and incomplete information scenarios. We implement solutions to our multi-dimensional contract and sorting algorithm on a decentralized oracle network to create a decentralized system and design a web application to extensively evaluate the performance of our proposed incentive mechanism. We further show that ordering transactions based on users’ private information increases the miner’s utility by 78.42%-84.57% and reduces the users’ cost by 64.47% compared with the state-of-the-art fair sequencing services, automated arbitrage market maker, and miner extractable value auctions.
... As one of the earliest DeFi application categories, AMM-based DEXs also constitute the most fundamental and crucial building blocks of the DeFi ecosystem. Their importance prompts the emergence of studies covering various aspects of AMM-based DEXs: economics [25], security [219,227,228], privacy [27,32], etc. While there has arisen a large number of surveys on general DeFi [177,180] as well as various DeFi applications [24,50], there is a dearth of literature that systematically studies and critically examines DEXs with AMM protocols in a comprehensive manner. ...
... With an output-bounded AMM, there is always a sufficient quantity of output tokens for a swap, i.e. a user can never deplete one side of the pool reserve. An AMM with this feature usually constructs its bonding curve such that, when one reserve token is close to depletion (approaching 0), its price-denominated in the other reserve token of the pool-becomes astronomically high (approaching infinity) [25]. ...
... 5: User back-runs by selling XYZ at an average price of ′ , with 2 > ′ > due to slippage. This paper An SoK on AMM-based DEX protocols that uses state space modeling to abstract their mechanics and surveys their security and privacy issues [25] A theoretical framework with parametric characterization of AMM-based DEX's fundamental properties and behaviors, with a focus on their structural and economic aspects [26] An SoK on front-running mitigation in DeFi especially AMMs [130] An overview of security challenges and design principles of order-book-based DEX [177] An SoK on various DeFi applications drawing the distinction between their technical and economic security aspects, with a focus on the latter [24] An SoK on decentralized lending protocols proposing a formalization of their archetypal implementations and properties in the context of the broader DeFi ecosystem [50] An SoK on DeFi yield aggregators providing a general framework for yield farming strategies with numerical simulations and an empirical evaluation on their profitability [70] An SoK on various front-running attacks providing a taxonomy exemplified with case studies and summarizing preventative measurements [163] A quantitative study that examines various forms of Blockchain Extractable Value (BEV) and estimate historical attack profit through exploitation of BEV [162] A study that systematizes lending protocols with a focus on liquidation mechanisms, and empirically assesses the liquidation risk of decentralized lending protocols [93] A study that provides a generalization of the financial risk existent on DeFi lending protocols and stress-tests their robustness under various scenarios [18] A survey of Ethereum smart contract attacks with a taxonomy of common programming pitfalls and their minimum working examples [103] A survey of vulnerabilities, threats, and defenses of different security reference architecture (SRA) layers of a blockchain using a stacked model [43] A survey of vulnerabilities, attacks, and defenses of decentralized applications (DApps) running on top of the Ethereum blockchain GLOSSARY call option. a financial derivative instrument giving its owner the right to buy an asset at a given price hedging. ...
Article
Full-text available
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.
... There are many papers on the theory and design of AMMs, with some of the most important including [2,1,17,3,4]. The only peer-reviewed AMM design claiming protection against LVR [14] is based on live price oracles. ...
Preprint
Full-text available
The always-available liquidity of automated market makers (AMMs) has been one of the most important catalysts in early cryptocurrency adoption. However, it has become increasingly evident that AMMs in their current form are not viable investment options for passive liquidity providers. This is because of the cost incurred by AMMs providing stale prices to arbitrageurs against external market prices, formalized as loss-versus-rebalancing (LVR) [Milionis et al., 2022]. In this paper, we present Diamond, an automated market making protocol that aligns the incentives of liquidity providers and block producers in the protocol-level retention of LVR. In Diamond, block producers effectively auction the right to capture any arbitrage that exists between the external market price of a Diamond pool, and the price of the pool itself. The proceeds of these auctions are shared by the Diamond pool and block producer in a way that is proven to remain incentive compatible for the block producer. Given the participation of competing arbitrageurs, LVR is effectively prevented in Diamond. We formally prove this result, and detail an implementation of Diamond. We also provide comparative simulations of Diamond to relevant benchmarks, further evidencing the LVR-protection capabilities of Diamond. With this new protection, passive liquidity provision on blockchains becomes rationally viable, beckoning a new age for decentralized finance.
... We now formalise the one-step relation T − − → through rewriting rules, inspired by [9]. We use the standard notation σ{ v /x} to update a partial map σ at point x: namely, σ{ v /x}(x) = v, while σ{ v /x}(y) = σ(y) for y = x. ...
... those used by Curve Finance and SushiSwap. A uniform framework where to address this problem is that in [9], where swap invariants are abstracted as functions subject to a given set of constraints. ...
... Proof. Follows from Lemma 3 (preservation of net worth) in [9]. ...
Preprint
Full-text available
Automated Market Makers (AMMs) are decentralized applications that allow users to exchange crypto-tokens without the need to find a matching exchange order. AMMs are one of the most successful DeFi use case so far, as the main AMM platforms UniSwap and Balancer process a daily volume of transactions worth billions of dollars. Despite this success story, AMMs are well-known to suffer from transaction-ordering issues: indeed, adversaries can frontrun user transactions to increase their gain to the detriment of honest users. Being specifically designated to arrange user transactions into blocks, miners can easily play the role of adversary, by suitably selecting and ordering transactions - and possibly inserting their own - to increase their gain. In this paper we formally characterize rational miners as players which follow an optimal strategy in the mining game. We identify relevant variants of the game, corresponding to specific real-world constraints that a miner might have. We devise effective procedures to construct solutions to mining game, both in its most general form and in some relevant variants. Most notably, miners can exploit these solutions to maximize the value extracted from user transactions.
... In particular, there are few studies on decentralized crypto exchanges, primarily from practitioners and the Computer Science community. Angeris et al. (2021) shows that the AMM can track the market price closely under no-arbitrage conditions; Bartoletti, Chiang, and Lluch-Lafuente (2021) abstracts the AMM away from the actual underlying economic mechanisms and studies its mathematical properties; Daian et al. (2020) provides empirical evidence for the existence of arbitrage at AMM. Harvey, Ramachandran, and Santoro (2021) provides a good survey of the DeFi applications. Our paper is the first to explore the fundamental market micro-structure problems concerning AMM, such as adverse selection, market breakdown, execution cost, investor decisions, and liquidity provider incentives (adoption problem). ...
Preprint
Full-text available
We analyze the market microstructure of Automated Market Maker (AMM) with constant product function, the most prominent type of blockchain-based decentralized crypto exchange. We show that, even without information asymmetries, the order execution mechanism of the blockchain-based exchange induces adverse selection problems for liquidity providers if token prices are volatile. AMM is more likely to be adopted for pairs of coins which are stable or of high personal use for investors. For high volatility tokens, there exists a market breakdown such that rational liquidity providers do not deposit their tokens in the first place. The adoption of AMM leads to a surge of transaction fees on the underlying blockchain if token prices are subject to high fluctuations.