Workspace / Research tools
Data analysis

Grid Inventory Stress Calculator

Inspect the inventory a buy grid could accumulate during a decline. Define its price range, number of levels, quote budget, entry fee, scenario low and final marking price. The model funds equal base quantities at each level and counts a buy as filled when the scenario low reaches that level. It then values acquired inventory plus remaining cash. All calculations run locally. The example is illustrative, and this deliberately narrow stress model includes no sell cycles, automatic rebalancing, live prices or executed orders.

Explicit assumptionsFormula & methodology includedNo account required

Enable JavaScript to analyze data in this browser. The methodology and worked example remain available below.

Worked example — illustrative data
Marked portfolio P&L$-280.84
BTC inventory held0.10334493 BTC
Unspent quote balance$2,278.33
Filled buy levels6
Inventory market value$7,440.84
Equal base quantity = total budget / [sum(all buy prices) × (1 + buy fee)]. Fill buys crossed during descent. Final value = remaining cash + filled BTC × ending mark.

One downward path from above the highest buy; fills at limit prices and no sells. This stress test measures inventory exposure, not grid-cycle profit or a bot backtest. Ending mark must be at least the path low. Exit fees and partial fills are excluded.

LevelBuy limitStatusBTC filledCash spent
165000Unfilled00
267,142.857143Unfilled00
369,285.714286Filled on descent0.0172241,194.581281
471,428.571429Filled on descent0.0172241,231.527094
573,571.428571Filled on descent0.0172241,268.472906
675,714.285714Filled on descent0.0172241,305.418719
777,857.142857Filled on descent0.0172241,342.364532
880000Filled on descent0.0172241,379.310345

Fund equal base quantities

The grid uses equally spaced buy prices that include both endpoints. If every level buys quantity q, the required budget is q multiplied by the sum of all level prices and by (1 + entry fee rate). Solving that equation gives one common base quantity for the full grid. Higher levels therefore consume larger quote amounts. This allocation differs from an equal-budget ladder, which buys more units at lower prices. Compare the two models only after checking which quantity convention you intend to use.

Mark the filled inventory

The scenario assumes price approaches the grid from above. A level is treated as filled when the chosen low is at or below its buy price. For those fills, subtract price times quantity plus entry fee from cash and add the common quantity to inventory. Final modeled equity equals remaining cash plus acquired units multiplied by the final marking price. Profit or loss is that value minus the original budget. The final marking price should not be below the scenario's stated low.

Recognize what the stress path omits

No grid sells occur in this model, even if the final price has recovered. The result therefore isolates accumulated inventory and capital use rather than estimating a complete grid bot's revenue. It does not simulate the time spent at each level, available depth, queue priority or partial fills. Marked inventory is also not equivalent to realized exit proceeds: selling can incur fees and slippage. Use several lows and final prices to inspect exposure outside the intended range before evaluating any separate selling or replenishment logic.

Your research workspace

Save selected inputs and research notes explicitly in this browser. Compare assumptions and restore a saved setup without submitting a trade. JavaScript enables the controls.

Find a tool or explanation