 |
August 06, 2026, 01:15:39 PM |
|
Hey all,
I've been developing a custom market-making bot in Node.js and recently I've been experimenting with different liquidity modules. I wanted to share an approach I call the "Ladder + Shift" (or Spread Shift liquidity) and see how others are tackling this.
The core challenge for any MM bot is obvious: maintaining a healthy, thick order book and keeping the spread tight, without getting your balances completely drained during strong one-sided market movements (pumps or dumps).
Here's a breakdown of the algorithm I've been refining: Instead of just blindly replacing orders at a fixed percentage from the mid-price, the bot tracks an "index" for the order ladder. When orders are filled on one side (let's say buys are filled), the module applies a "shift".
Depending on the fill volume, we recalculate the spread using the VWAP of the filled orders. Then, we apply a dynamic factor like a Buy Price Adjustment (BPA) and Sell Price Adjustment (SPA). For instance, if the standard order step is 5%, after a significant fill, the shift might trigger an additional 10% SPA. So the new orders on the opposite side are placed at Step (5%) + SPA (10%), aggressively widening the gap and preventing the bot from getting steamrolled by momentum.
In most normal or slow-ranging market conditions, this method works decently well. It shifts the spread organically and keeps both balances relatively stable.
However, here is my bottleneck: during extremely fast, high-volume trading on a specific pair, this approach still breaks down and gives failures. The bot either lags behind the market and ends up bleeding out the base/quote balance, or it halts due to inventory depletion on one side.
Does anyone here have experience building a custom liquidity module for their bots? What algorithms do you use to protect your inventory during sudden, massive volume spikes while still keeping the bot operational?
Would love to hear some technical insights or ideas on this. Thanks!
|