Skip to content

Dynamic Pricing

DynamicShop Admin edited this page Jul 17, 2026 · 3 revisions

Dynamic Pricing System

DynamicShop 2.6.4 calculates regular-item buy and sell totals from base price, stock, optional shortage time, and price clamps. Fixed-price special items use their configured price instead.

Feature Toggles

  • dynamic-pricing.enabled disables all stock and shortage multipliers when false. Regular items then use base price, with sell tax still applied to sales.
  • use-stock-curve controls the positive-stock curve.
  • use-time-inflation controls the shortage-time multiplier.
  • min-price-multiplier and max-price-multiplier clamp the price used inside each bulk-price integral. Bundled defaults are 0.01 and 2.0.

Price Regions

For base price B, current stock s, pricing boundary m, max-stock boundary L, curve strength k, shortage rate r, and time multiplier t:

q = 1 + r / 100

s <= m:       price = B * t * q ^ (-(s - m))
m < s < L:    price = B * t * (1 - 0.5 * k * (s - m) / (L - m))
s >= L:       price = B * t * (1 - k)

The result is clamped between B * min-price-multiplier and B * max-price-multiplier.

Important details:

  • An item's min-stock defaults to 0 and moves the boundary where exponential shortage pricing begins. It is not a storage limit.
  • An item's max-stock overrides the global pricing boundary. It is not a storage limit.
  • An item's rate overrides negative-stock-percent-per-item.
  • With the bundled curve-strength: 0.9, the middle branch approaches 55% of base price near max-stock, while the high-stock branch uses 10%. The implementation therefore has a step at that boundary; it is not one continuous curve.
  • Setting use-stock-curve: false makes k zero, leaving a flat base-price branch while any enabled shortage-time multiplier still applies.

Storage Controls

Pricing boundaries and transaction limits are separate:

  • min-stock-storage is a hard purchase floor. A purchase cannot leave stock below this value.
  • max-stock-storage is a hard sale ceiling. A sale cannot leave stock above this value.
  • Without an item-specific purchase floor, restrict-buying-at-zero-stock: true prevents normal purchases from taking stock below zero.
  • dynamicshop.bypass.stock bypasses the GUI stock floor and ceiling checks. It does not override disable-buy or disable-sell.

Shortage Time

Stock at or below zero accumulates shortage hours. The time multiplier is:

t = (1 + hourly-increase-percent / 100) ^ shortageHours

The configured maximum price multiplier still caps the resulting price.

When stock is positive, shortage hours decay over real time. shortage-decay-percent-per-hour is the number of shortage hours removed per real hour at full max-stock; the rate scales by stock / max-stock.

A player transaction that crosses from non-positive stock to positive stock can apply the configured high-inflation correction. Directly setting regular stock to a positive value with the admin setter resets shortage hours to zero.

Bulk Transactions

DynamicShop integrates over the stock path instead of multiplying one displayed quote:

  • Buying amount integrates from currentStock - amount to currentStock.
  • Selling amount integrates from currentStock to currentStock + amount.
  • Clamps are applied within each price region's integral.
  • Sell tax is applied to the completed sell-side integral.

This is why a bulk sell value is not necessarily the displayed one-item buy price multiplied by the quantity and tax rate.

Clone this wiki locally