Market Making Mechanics and Strategies

Idrees
BlockApex
Published in
10 min readJul 13, 2023

Introduction

In tradFi market makers are large financial institutions, who act as intermediaries between buyers and sellers by providing liquidity to traders and reducing the difference between ask and bid price of given assets. They act as ‘makers’ and ‘takers’ by continuously fulfilling buy and sell orders in the market. “Maker” places an order (buy/sell) by adding that order in the order book of exchange, while “taker” places an order(buy/sell) by filling an already existing order on the order book. These orders are usually placed at a very high frequency and their scale allows them to reduce volatility in the market. By doing so market makers make profit from bid ask spreads.. Spreads are usually very small but high volume of trading can amplify the profits from very small spreads. Thickness of the the order books enable execution of big orders at fair price, results in lower price impact and volatility

Risks Associated with market making

All kinds of financial operations come with a degree of risk associated with them and market making is not an exception. Market making involves risk as buy/sell orders aren’t executed simultaneously and market makers make guesses on directional market movement. While informed traders always have the advantage of participating in the market with a strong opinion which is contrary to market makers.

The ideal scenario for market makers is when prices are not following a trend (no significant directional movements). Prices fluctuating within a range increases the probability of filling buy/sell orders of Market makers, hence making more profit from small spreads.

Directional movements result in accumulation of inventory of assets in market makers portfolio which is losing its value while selling those assets which are appreciating in price, resulting in a decrease in inventory value.

Inventory risk is an adverse selection cost a market maker pays for holding an inventory at the wrong time while not being able to sell it.

Fat tail events are another risk a market maker faces, which can result in loss of value for the market. These events are very rare but they can impose sudden imbalance in order books and result in substantial inventory risk. Tail hedges with options, providing liquidity in mean reverting range tail hedging, these risks could be mitigated.

If the asset’s price breaks above or below the mean-reverting range, indicating a potential trend or significant price movement, the market maker implements a tail hedge. A tail hedge involves purchasing options contracts that protect against extreme price movements. These options act as insurance to hedge the market maker’s underlying positions and mitigate potential losses

Market Making Strategies

As we established earlier, market marking is exposed to a lot of risks imposed by dynamics of the market. These risks are encountered by proactive market making, which involves continuously adjusting bid ask spreads based on dynamics of the market.

By dynamically adjusting these bid ask spreads market makers maximize their profits and also limit their exposure to risk. Market making strategies, apart from dynamically adjusting bid — ask spreads, also involve strategic pulling of bid and ask orders by timely evaluating fat tail events and iceberg orders

Different risk management strategies used by market makers are discussed following:

Delta neutral Market making

A Market Maker earns from spread (difference in bid and ask prices) and volume, however when he holds an asset, he is exposed to price movement of asset in opposite direction. This risk of downward price movement is hedged, offloading risk and applying a delta neutral strategy.

This can be explained by following example:

When an order placed by the market maker on exchange A gets filled, he places an order on Exchange B in the opposite direction. Having equal and opposite positions on both exchanges, cancels the risk of loss on one Exchange by a profit on exchange B, resulting in zero sum on asset price movement while earning from spread.

High Frequency market Making (The Stoikov Market Maker)

The Stoikov model focuses on a key aspect of market making: setting optimal bid and ask prices to maximize the market maker’s expected profit while managing inventory risk. The model takes into account statistical probabilities and optimization techniques to determine these optimal prices.

Stoikov addressed the inventory risk problem in market making by calculating a new reference price for creating buy and sell orders. It considers the execution probability, price impact, and inventory risk to determine this reference price. By incorporating these factors, it aims to optimize the trading strategy and manage inventory imbalances effectively.

Assuming Price movement is random walk

Strategy loses money if the volume of trades in one direction becomes greater than the volume of another direction’s volume. Intensity (lambdas) of execution of market orders increases as distances (deltas) get closer the market price hence lopsided market dynamics doesn’t favor this strategy

Using the stoikov model to optimize bid and ask prices by trading off between profit and risk. The model seeks to strike a balance between profit and risk. It recognizes that market makers need to generate profit from bid-ask spreads while carefully managing the potential losses resulting from adverse price movements.

The Stoikov model focuses on a key aspect of market making: setting optimal bid and ask prices to maximize the market maker’s expected profit while managing inventory risk. The model takes into account statistical probabilities and optimization techniques to determine these optimal prices. As a continuous update of reference prices, lessens the gap between posted prices and updated reference prices, it increases the probability of order execution.

Here are the main components and considerations of the Stoikov model:

Inventory Risk: Market makers face the risk of holding inventory as the price of the underlying asset fluctuates. If the market maker holds a long position (buy inventory), they risk losses if the price falls. If they hold a short position (sell inventory), they risk losses if the price rises. The Stoikov model aims to manage this inventory risk effectively by calculating new reference price where the buy and sell orders will be created around, based on three main factors

Where s is current market mid price, q is amount of assets in inventory of base asset, T closing time and t is current time, gamma is risk aversion parameter specified by market maker and sigma is volatility. Q measures how far (number of units) market maker inventory is from desired targeted inventory

Estimating Price Changes: The model incorporates statistical analysis to estimate the probability distribution of price changes in the underlying asset. It takes into account factors such as historical price data, volatility, and other relevant market information to create a model of expected price movements.

Optimal Bid and Ask Prices: The model uses optimization techniques to determine the optimal bid and ask prices that maximize the market maker’s expected profit. It considers factors such as the current market price, the desired spread, transaction costs, and the estimated probability of price changes. By finding the optimal prices, the market maker aims to attract trading activity while minimizing the impact of adverse price movements on their inventory.

Where delta_a and delta_b are spreads, gamma is risk parameter which MM is willing to take, T is time frame of trading session (For cryptocurrency markets Timeframe could be considered as infinite as there is no limit of time frame of trading activity),k is

Continuous Adaptation: The Stoikov model emphasizes the dynamic nature of market making. It recognizes that market conditions change rapidly, and the market maker needs to continuously adapt their bid and ask prices to maintain competitiveness and manage risk effectively.

Grid Trading

The Grid Trading strategy is an extension of the Stoikov strategy. It involves placing limit orders of increasing size throughout the orderbook, with a spacing of moving average of price. As the price walks through the placed orders through the trading period, the market maker earns profit. Market maker strategy is to capture these spreads repeatedly as price fluctuates. Grid trading strategy exhibits a martingale effect, by increasing exposure as price deviates from average price. To take advantage of potential price reversals, the doubling down effect is created by increasing the size of orders as price moves away from average price.

Due to the wider spacing of the orders, fills (execution of orders) occur less frequently compared to the Stoikov strategy. However, the spreads between the buy and sell orders are larger. This means that profits can be substantial when orders are executed.

To implement Grid Trading effectively, several considerations are important:

Calculation of Average Price

Calculating the average price is critical for placing the limit orders. Market makers typically use moving averages of prices to determine the average price. Some variations may involve incorporating a jump function that resets the average after sudden price spikes.

Periodic Reset of Best Bid-Offer Price

The current best bid-offer price is periodically reset based on a high-frequency algorithm, similar to the Stoikov strategy. This ensures that the market maker remains competitive and adjusts to changing market conditions.

Consideration of Other Exchanges/Instruments

Market makers may also examine prices on other exchanges or related instruments to identify potential pricing discrepancies or opportunities for statistical arbitrage.

In summary, Grid Trading builds upon the Stoikov strategy by spacing out orders of increasing size around a moving average of the price. The goal is to earn profits from the spreads as the price moves through the placed orders. With the martingale effect, the strategy doubles down on exposure as prices deviate. Although fills may occur less frequently, the larger spreads can lead to substantial profits. Effective calculation of the average price, periodic resets of the bid-offer price, and considerations of other market factors contribute to the success of this strategy.

Future Work

This research is intended to provide a comprehensive understanding of market making, its mechanics, and various liquidity management strategies. Following are some prospects of future work in this domain:

Innovative Approaches to Liquidity Management in Multi-Chain Environment: Explore cutting-edge topics in liquidity management, including cross-chain liquidity mirroring and automated liquidity rebalancing.

Intelligent Liquidity Provisioning: Explore the dynamics of intelligent liquidity provisioning leveraging Reinforcement Learning to enhance liquidity providers’ abilities to optimize their objective functions, aligning with their intents and preferences. Our forthcoming research aims to explore the intricate domain of Intelligent Liquidity Provisioning (ILP) within the dynamic environment of Uniswap v3. Utilizing cutting-edge Reinforcement Learning (RL) algorithms, we intend to develop a robust and efficient liquidity management system. Here’s a brief roadmap of our planned future work:

  1. Environment Definition: A meticulous representation of Uniswap v3’s pool dynamics, encompassing factors such as liquidity ranges, fee accruals, price volatility, and more.
  2. State and Action Space Design: Creating a comprehensive state representation, including essential features like current liquidity position, recent price movements, and accumulated fees. The action space will encapsulate critical actions like adding/removing liquidity and specifying exact liquidity ranges.
  3. RL Algorithm Selection: Exploration of advanced algorithms like Proximal Policy Optimization (PPO), Soft Actor-Critic (SAC), Deep Deterministic Policy Gradient (DDPG), and Q-Learning to find the optimal fit for the problem’s complexity.
  4. Implementation and Training: A systematic approach to training the RL agent on historical data, using iterative refinement of action space, entropy regularization, feature engineering, and hyperparameter tuning.
  5. Simulations and Backtesting: Rigorous testing of the agent’s behavior in various market scenarios, including comprehensive backtesting on historical data and implementing safety nets to mitigate financial risks.
  6. Continuous Learning and Adaptation: A commitment to ongoing training to adapt the agent to the ever-volatile crypto market.
  7. Evaluation and Scaling: Monitoring performance using metrics like risk-adjusted returns and drawdowns, with a long-term view of scaling liquidity provisioning.

Conclusion

This introductory article provided an overview of market making mechanics and strategies. Market makers play a crucial role in providing liquidity and reducing volatility in the market. We discussed the risks associated with market making, including inventory risk and fat tail events. Various strategies such as delta neutral market making and high-frequency market making (Stoikov model) were explored to manage these risks and optimize profits. We also introduced the grid trading strategy, which builds upon the Stoikov model by spacing out orders around a moving average of the price.

By bridging the gap between theoretical concepts and practical applications, our research on Intelligent Liquidity Provisioning aims to revolutionize the way liquidity is managed in decentralized finance. This future work will build on the foundation laid in the current research, exploring new horizons in market making and liquidity management in the DeFi landscape.

References:

Avellaneda, M., & Stoikov, S. (2008). High-frequency trading in a limit order book. Quantitative Finance, 8(3), 217–224: link

Comparison of different market making strategies for high frequency traders: link

High-frequency market-making with inventory constraints and directional bets (Pietro Fodra, Mauricio Labadie: link

--

--