Artur Sepp Blog on Quantitative Investment Strategies

  • Blog
  • Research
  • About
  • Paper on Automated Market Making for DeFi: arbitrage-fee exchange between on-chain and traditional markets

    Posted at 2:37 pm by artursepp, on September 29, 2021

    I have been delighted to collaborate with Alexander Lipton on a paper where we develop a quantitative approach for making arbitrage-free pricing between decentralized exchanges (DEX), relying on Automated Market Making (AMM), and traditional exchanges, relying on the order book. As a very relevant case for developing central bank digital coins (CBDC) on interoperable blockchains, we simulated our model using high-frequency FX data from a traditional exchange to validate our approach.

    This post is a small communication of the background and key results from our paper that can be downloaded from SSRN https://ssrn.com/abstract=3939695

    Automated Market Making

    Automated market making (AMM) for crypto asset has become one of the most interesting developments in the Decentralized Finance (DeFi) space.

    Vitalik Buterin, the founder of Ethereum protocol, originally proposed AMM in 2016 as a concept to exchange on-chain assets on decentralized exchanges which operate entirely on-chain . The purpose was to reduce the spreads and gas fees, that had been excess of 10% at the time. The solution was suggested to create two-sided pools of different coins (for an example, ETH vs BTC) and to fix the exchange rate relative to the pool depth (liquidity).

    This concept was formalized by the Uniswap protocol that introduced the so-called constant function market maker (CFMM) using product rule as for marginal pricing of one token vs the other by mean of smart contracts (SC).

    The AMM is an interesting concept like a dark pool (in a good sense) where investors can place a large orders and get immediate executions without revealing their intentions prior to their trades.

    In Figure 1, I show the relative pricing of a representative USDC-EUDC (US Dollar – Euro) pool (the initial parameters are EUR/USD rate of 1.25) using the three CFMM rules:

    1. Sum rule that allows to swap full balances of one token into another so that the change in the relative rate is a constant.
    2. Product rule that fixes the relative exchange rate inversely proportional to pool balances. Outside of the equilibrium rate of 0.8 EUDC per 1.0 USDC, the relative rate of EUDC will decline or increase faster than the constant exchange rate
    3. Mixed rule with a parameter alpha which is a blended rule between the sum and the product rule.

    Bid/Ask marginal rates

    Using the CFMM we can derive the marginal exchange rates as functions of the ratio of the order size to the pool liquidity. This is a very convenient feature that enables to explicitly assign the exchange rate to each order size.

    In Figure 2, I show the marginal AMM rates as functions of the CFMM specification. I use the EUR-USD FX spot of 1.25 and equivalent USD-EUR spot of 0.8. Then we can present a representative bid/ask book for trading in both EUDC and USDC from the same USDC-EUDC pool.

    It follows that the sum rule enforces no feedback from pool liquidity for the marginal exchange (zero slippage costs) while the product rule produces strong feedback from the pool liquidity (slippage costs proportional to the ratio of traded order to the pool liquidity). By introducing the mixed rule with a parameter alpha between 0 (product rule) and infinity (sum rule), we can design flexible CFMM.

     

    Pool arbitrage

    One of the most interesting challenges for on-chain exchanging of different CBDCs is how to avoid arbitrage opportunities between on-chain exchanges and traditional markets. We solve this problem by introducing a pool arbitrageur (either a pool operator or designated market-maker) who follows an optimization problem to arbitrage opportunities between the on-chain pool and traditional markets. Because of the pool arbitrageur, the pool bid/ask spreads for small orders are consistent with a traditional exchange.

    We apply our model for simulation of hypothetical CBDC pools using actual high-frequency data FX data. In Figure 3, I show the simulation of USDC-EUDC pool using intraday EUR-USD FX spot rate on 3rd June 2021. For convenience, I normalize the sport FX rate to 1.0 at the start of the trading session. I apply the constant product CFMM.

    In the first panel I show the optimal pool balances that are determined by the pool arbitrageur to exclude arbitrage between the pool and the FX spot rate. In the second panel I show the bid/ask spreads for trading 1bp of the pool liquidity. We see that the actual FX spot rate is sandwiched between the AMM bid/ask rates. The final figure is the arbitrage profits.

     

    Application to G-10 currencies

    As as a final validation, we also included the volumes for simulations of CBDC pools using the actual FX buy and sell orders. Intraday volumes are normalized so that the pool daily turnover is 100% for each day in our sample of last 3 years of FX data.

    In the Figure 4, I show the boxplot of key variables from the simulation of the CBDC pools for G-10 currencies including the Chinese Yuan. I apply the mixed rule CFMM with alpha equal to 5 and the transaction fees of 1bp.

    In the first panel, I show the volume-weighted average bid-ask spread. The average spread is about 1.3 across all FX pair, which is competitive to traditional FX markets. The second panel shows the annual P&L (daily P&L multiplied by 260). The last panel shows the Hedged P&L which is produced by hedging the spot exposure or equivalent by allocation to the pool using borrowed CBDCs. It is clear that liquidity providers benefit from both pool fees and the convexity generated by the trading volumes

     

    Summary

    Automated market making is one of the core elements for on-chain exchange of digital assets. Of course, one of the most important questions is the arbitrage between on-chain and off-chain exchanges. Alexander Lipton and myself have developed a quantitative approach in this direction.

     

    References

    Lipton, A. and Sepp, A., Automated Market-Making for Fiat Currencies (2021). Working Paper, available at SSRN: https://ssrn.com/abstract=3939695

    Share this:

    • Share on LinkedIn (Opens in new window) LinkedIn
    • Share on X (Opens in new window) X
    • Share on WhatsApp (Opens in new window) WhatsApp
    • Email a link to a friend (Opens in new window) Email
    • Print (Opens in new window) Print

    Like this:

    Like Loading…
    • ← Tail risk of systematic investment strategies and risk-premia alpha
    • Toward an efficient hybrid method for pricing barrier options on assets with stochastic volatility – research paper →

    Author: artursepp

    Posted in Crypto, Decentralized Finance, Uncategorized | 2 Comments |

    2 thoughts on “Paper on Automated Market Making for DeFi: arbitrage-fee exchange between on-chain and traditional markets”

    • Pingback: Professional Update: Systematic solutions for crypto and digital assets at Sygnum Bank’s Asset Management | Artur Sepp Blog on Quantitative Investment Strategies

    • plumbers alexandria va

      September 28, 2022 at 3:50 pm

      Detailed graph and data. Helps well with the research

      Reply

    Leave a Reply Cancel reply

    • Receive notifications of new posts by email

      Join 348 other subscribers
    • Recent Posts

      • The Science and Practice of Trend-following Systems: paper and presentation
      • Lognormal Stochastic Volatility – Youtube Seminar and Slides
      • Optimal allocation to cryptocurrencies in diversified portfolios – update on research paper
      • Unified Approach for Hedging Impermanent Loss of Liquidity Provision – Research paper
      • Log-normal stochastic volatility with quadratic drift – open access publication
      • Stochastic Volatility for Factor Heath-Jarrow-Morton Framework – research paper
      • AD Derivatives podcast on volatility modeling and DeFi
      • What is a robust stochastic volatility model – research paper
      • Robust Log-normal Stochastic Volatility for Interest Rate Dynamics – research paper
      • Optimal Allocation to Cryptocurrencies in Diversified Portfolios – research paper
      • Log-normal Stochastic Volatility Model for Assets with Positive Return-Volatility Correlation – research paper
      • Developing systematic smart beta strategies for crypto assets – QuantMinds Presentation
      • Toward an efficient hybrid method for pricing barrier options on assets with stochastic volatility – research paper
      • Paper on Automated Market Making for DeFi: arbitrage-fee exchange between on-chain and traditional markets
      • Tail risk of systematic investment strategies and risk-premia alpha
      • Trend-Following CTAs vs Alternative Risk-Premia (ARP) products: crisis beta vs risk-premia alpha
      • My talk on Machine Learning in Finance: why Alternative Risk Premia (ARP) products failed
      • Why Python for quantitative trading?
      • Machine Learning for Volatility Trading
      • Trend-following strategies for tail-risk hedging and alpha generation
    • Categories

      • Asset Allocation (10)
      • Crypto (8)
      • Decentralized Finance (5)
      • Python (4)
      • Quantitative Strategies (17)
      • Trend-following (4)
      • Uncategorized (20)
      • Volatility Modeling (18)
      • Volatility Trading (13)

Loading Comments...
%d