# A comprehensive guide to Avellaneda & Stoikovs market-making strategy

Avellaneda and Stoikov have revised the study of Ho and Stoll building a practical model that considers a single dealer trading a single stock facing with a stochastic demand modeled by a continuous time Poisson process. The literature on the optimal market making problem has been burgeoning since 2008 with the work of Avellaneda and Stoikov , inspiring Guilbaud and Pham to derive a model involving limit and market orders with optimal stochastic spreads. Bayraktar and Ludkovski have considered the optimal liquidation problem where they model the order arrivals ETH with intensities depending on the liquidation price. More advanced models have been developed with adverse selection effects and stronger market order dynamics, see for example the paper of Cartea et al. .

- But suppose you have fun reading intricate scientific papers (I do!).
- The DQN computes an approximation of the Q-values as a function, Q(s, a, θ), of a parameter vector, θ, of tractable size.
- You will need to hold a sufficient inventory of quote and or base currencies on the exchange to place orders of the exchange’s minimum order size.
- Alpha-AS-1 had 11 victories and placed second 16 times (losing to Alpha-AS-2 on 14 of these).
- Table 6 compares the results of the Alpha-AS models, combined, against the two baseline models and Gen-AS.
- That is introduced with quadratic utility function and solved by providing a closed-form solution.

The central notion is that, by relying on a procedure developed to minimise inventory risk (the Avellaneda-Stoikov procedure) by way of prior knowledge, the RL agent can learn more BTC quickly and effectively. Gen-AS performs better than the baseline models, as expected from a model that is designed to place bid and ask prices that minimize inventory risk optimally given a set of parameter values that are themselves optimized periodically from market data using a genetic algorithm. Genetic algorithms compare the performance of a population of copies of a model, each with random variations, called mutations, in the values of the genes present in its chromosomes. This process of random mutation, crossover, and selection of the fittest is iterated over a number of generations, with the genetic pool gradually evolving.

## Deep LOB trading: Half a second please!

That is because avellaneda and stoikov value depends on the market price movement, and it isn’t a factor defined by the market maker. If the market volatility increases, the distance between reservation price and market mid-price will also increase. For example, if the BTC-USDT market price enters a downtrend and the trader uses the symmetrical approach, his buy orders will be filled more often than the sell orders. At the end of the day, the market maker will be loaded with BTC, and his total inventory will have a smaller value. The max_order_age parameter allows you to set a specific duration when resetting your order’s age. It refreshes your orders and automatically creates an order based on the spread and movement of the market.

### Should you hedge or should you wait? – Risk.net

Should you hedge or should you wait?.

Posted: Wed, 24 Aug 2022 07:00:00 GMT [source]

Α is the learning rate (α∈), which reduces to a fraction the amount of change that is applied to Qi from the observation of the latest reward and the expectation of optimal future rewards. This limits the influence of a single observation on the Q-value to which it contributes. The first chart shows price, indiference price and bid, ask quotes evolution. The reservation price is highly influenced by the election of the parameter T isn’t it? So, if T is high enough, each step in which q is not zero, the reservation price could be too high , and so the election of bid and ask quotes (both above or below the mid-price). Optimal strategies for market makers have been studied by academic researchers for a very long time now, with Thomas Ho and Hans Stoll starting to write about market dealers dynamics in 1980.

## Appendix: Numerical Solution of the Optimal Stochastic Control Problem

By truncating we also limit potentially spurious effects of noise in the data, which can be particularly acute with cryptocurrency data. In this section, we compare the existing optimal market making models based on the stock price impacts with the models that we introduce in the previous sections. Numerical experiments are carried out on two different types of utility functions, i.e., quadratic and exponential utility functions. Recently, there have been crucial developments in quantitative financial strategies to execute the orders driven in markets by computer programs with a very high speed .

As defined above, this action consists in setting the value of the risk aversion parameter, γ, in the Avellaneda-Stoikov formula to calculate the bid and ask prices, and the skew to be applied to these. The agent will place orders at the resulting skewed bid and ask prices, once every market tick during the next 5-second time step. One of the most active areas of research in algorithmic trading is, broadly, the application of machine learning algorithms to derive trading decisions based on underlying trends in the volatile and hard to predict activity of securities markets.

In addition to the programming code, the web site provides data samples on selected instruments, well suited for testing the algorithms and for developing new trading models. Trading strategy with stochastic volatility in a limit order book market. Hence, the optimal spreads which maximize the supremums in the verification Eq. Is Markovian, the optimization problem can be solved using the stochastic control approach (Bates 2016; Björk 2012; Pham 2009). The solution will be based on two different choices of utility functions, quadratic and exponential, in the sequel.

Localised excessive risk-taking by the Alpha-AS models, as reflected in a few heavy dropdowns, is a source of concern for which possible solutions are discussed. In most of the many applications of RL to trading, the purpose is to create or to clear an asset inventory. The more specific context of market making has its own peculiarities. DRL has been used generally to determine the actions of placing bid and ask quotes directly [23–26], that is, to decide when to place a buy or sell order and at what price, without relying on the AS model. Spooner proposed a RL system in which the agent could choose from a set of 10 spread sizes on the buy and the sell side, with the asymmetric dampened P&L as the reward function (instead of the plain P&L). Combining a deep Q-network (see Section 4.1.7) with a convolutional neural network , Juchli achieved improved performance over previous benchmarks.

To achieve this, the strategy will optimize both bid and ask spreads and their order amount to maximize profitability. Consequently, she will sell the assets with a lower price on the positive inventory levels to reduce both the price risk and liquidation risk. On the other hand, she does not face with the liquidation risk on the negative inventory levels but wants to receive higher amount for selling the assets. While the market maker wants to maximize her profit from the transactions over a finite time horizon, she also wants to keep her inventories under control and get rid of the remaining inventories at the final time T by the penalization terms. Random forest is an efficient and accurate classification model, which makes decisions by aggregating a set of trees, either by voting or by averaging class posterior probability estimates. However, tree outputs may be unreliable in presence of scarce data.

We employ Poisson jump processes in modelling such market condition changes. We provide closed form optimal bidding and asking strategies of the market maker, and analyze the market maker’s inventory changes accordingly. In the training phase we fit our two Alpha-AS models with data from a full day of trading . In this, the most time-consuming step of the backtest process, our algorithms learned from their trading environment what AS model parameter values to choose every five seconds of trading (in those 5 seconds; see Section 4.1.3).

## Figures and Tables from this paper

It https://www.beaxy.com/s a target of base asset balance in relation to a total asset allocation value . It works the same as the pure market making strategy’s inventory_skew feature in order to achieve this target. An amount in seconds, which is the duration for the placed limit orders. The limit bid and ask orders are canceled, and new orders are placed according to the current mid-price and spread at this interval.

In particular, a new definition of fair price, which we call the Volume Adjusted Mid Price consistently outperforms the mid price, from the perspective of a market maker. In this paper, we investigated the high-frequency trading strategies for a market maker using a mean-reverting stochastic volatility models that involve the influence of both arrival and filled market orders of the underlying asset. First, we design a model with variable utilities where the effects of the jumps corresponding to the orders are introduced in returns of the asset and generate optimal bid and ask prices for trading.

By our numerical results, we deduce that the jump effects and comparative statistics metrics provide us with the information for the traders to gain expected profits. For instance, the model given by has a considerable Sharpe ratio and inventory management with a lower standard deviation comparing to the symmetric strategy. Besides, we further quantify the effects of a variety of parameters in models on the bid and ask spreads and observe that the trader follows different strategies on positive and negative inventory levels, separately.

The truth is that AMM is an advanced strategy and there’s a risk of loss. But it’s based on state of the art research (Avellaneda & Stoikov 2008). Thanks for the citation @Panama_TJ

— chris (@ybchri_) April 13, 2019

Table11 which is obtained from all simulations depicts the results of these two strategies. We can see that when the jumps occur in volatility, it causes not only larger profits but also larger standard deviation of the profit and loss function. With the same assumptions and quadratic utility function as in Case 1 in Sect.

Fortunately, the stochastic control theory helps to handle such kind of optimization problem by seeking an optimal strategy in order to maximize the trader’s objective function and to face a dyadic problem for the high-frequency trading. The theory encourages the study of optimizing activities in financial markets as it allows to accomplish the complex optimization problems involving constraints that are consistent with the price dynamics while managing the inventory risk. In order to detect the optimal quotes in the market, it is, therefore, necessary to solve the corresponding nonlinear Hamilton-Jacobi-Bellman equation for the optimal stochastic control problem.

Try to make an Avellaneda and Stoikov MM with an alpha model and see for yourself. You will either make money from the cheap alpha execution (which isn’t actually liquidity provision at all just stat arb) or you will lose money because actual ‘liquidity’ providers will chew

— Stat Arb (@quant_arb) January 23, 2022