Preserve a manual account’s cash and holdings with cash anchors

VL
5d ago
+998-74

Upstream native PR #5671 · Upstream tracker.

Bitcoin wallet stack, part 1 of 5. Base stack/bitcoin-main · Head feat/cash-anchor-accounting.

Upstream discussion and review · Feature and dependency order.

A cash anchor preserves manually tracked cash and holdings when position tracking starts. Imported observations survive trade cleanup. Correcting a split recomputes the carried quantity and inherited cost while preserving explicit cost overrides.

Validation

  • Rails suite on the rebased head passed with 18,543 tests, 113,714 assertions, 9 skips, zero failures or errors.
  • Chromium: 450 runs, 2527 assertions, 0 failures, 0 errors, 0 skips.
  • RuboCop, full ERB lint, Biome and Brakeman passed.