Pricing Engine
The Pricing Engine is the module’s key component. Its principle: the price must account not only for the market, but also for the system’s position. Beyond the market rate and the base spread, the price includes an adjustment for the current inventory state — turning price into a position-balancing tool.
Final rate formula
final_rate = market_rate * (1 + base_spread) * (1 + inventory_skew)
- market_rate — the pair’s market rate.
- base_spread — the base spread: the system’s margin on the trade.
- inventory_skew — the inventory state adjustment (positive or negative).
Inventory skew
The adjustment is proportional to the relative deviation of inventory from the target level:
inventory_skew = k * (inventory_delta / target_balance)
where:
k # sensitivity coefficient: how strongly the position affects price
inventory_delta = current_balance – target_balance # see Inventory Model
target_balance # target inventory level
- The larger k, the more aggressively price reacts to position skew.
- At inventory_delta = 0 the adjustment is zero: final_rate = market_rate * (1 + base_spread).
System behavior
| Inventory state | Skew sign | Effect on BTC price | Client incentive |
| BTC surplus (inventory_delta > 0) | skew > 0 → adjustment lowers the asset price | BTC price ↓ | Stimulate clients buying BTC (Release phase) |
| BTC deficit (inventory_delta < 0) | skew < 0 → adjustment raises the asset price | BTC price ↑ | Stimulate clients selling BTC (Fill phase) |
Loop logic: an asset surplus makes buying it more attractive to clients — buy flow grows, inventory is unloaded. A deficit raises the price — clients are better off selling the asset to the system, inventory is replenished. Price itself returns the position to the target level.
Numeric example
market_rate = 100000 USDT/BTC
base_spread = 0.004 # 0.4%
current_balance = 3.2 BTC
target_balance = 2.5 BTC
inventory_delta = 0.7 BTC # surplus
k = 0.05
inventory_skew = 0.05 * (0.7 / 2.5) = 0.014
final_rate = 100000 * (1 + 0.004) * (1 – 0.014)
= 100400 * 0.986
= 98994.4 USDT/BTC
Interpretation: with a BTC surplus, the final rate ends up below the market rate with base spread (100,400 → 98,994.4) — buying BTC becomes more attractive for clients, and the system unloads inventory. The sign of the skew application depends on the trade side: when the client buys the asset, the adjustment lowers the price; when selling, it works in mirror; the deterministic result is visible in the rate calculation for a specific direction.
Practical notes
- Tuning k. A small k makes price nearly insensitive to the position (slow balancing); a large one moves the rate aggressively and can hurt your monitoring position. Start with conservative values.
- Interaction with rate layers.inventory_skew is applied on top of the platform’s base pricing model (see Rate Formation): market rate and spreads first, then the inventory adjustment.
- Risk Engine additionally limits deviation: price balancing is an economic mechanism, while risk contours insure against extreme position growth (see Architecture).
See also