Skip to content
All library documents

Dynamic Rebalancing Market Maker Using Inventory Value and Spread Quotes

Article Strategy library · Author: gaotiansong

Summary

This market-making bot adjusts its orders according to the relative value of its coin inventory and cash balance. It values inventory using prices offset from the best ask and bid by a configured percentage spread. When coin value is high relative to cash, it calculates a sell amount; when cash is high relative to coin value, it calculates a buy amount. Order sizes are rounded to the configured amount increment and must exceed a minimum size.

The loop checks existing orders before placing new ones: it waits when two are open, cancels excess orders, and may cancel a single order when market prices move past its spread-based condition. It periodically logs account balances and an estimated profit based on holdings and the current bid. The document supplies implementation parameters but no backtest results or evidence of profitability. It also does not explain safeguards for inventory limits, exchange errors, fees, or adverse selection, all of which can affect a live market maker.

Key ideas

  • The bot uses account inventory value and cash balance to decide whether to buy or sell.
  • Quote prices are offset from the best bid and ask by a configured percentage spread.
  • Order quantity is rounded to an amount increment and must exceed a minimum size.
  • The loop monitors open orders and cancels or waits based on their count and price conditions.
  • The document offers no performance evidence or discussion of several live trading risks.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.