Skip to content

feat(currency-math): move discrete bonding curve engine to shared KMP module - #1423

Open
bmc08gt wants to merge 12 commits into
code/cashfrom
feat/shared-core-discrete-curve
Open

feat(currency-math): move discrete bonding curve engine to shared KMP module#1423
bmc08gt wants to merge 12 commits into
code/cashfrom
feat/shared-core-discrete-curve

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add :libs:currency-math:discrete-curve, a new KMP commonMain module holding the discrete bonding curve engine (table parsing, high-precision arithmetic, binary-search/step pricing).
  • Port the curve math from the JVM-only implementation, folding in two precision-bug fixes found during the port.
  • Port the curve.json/curve_fractional.json fixture vectors to commonTest, plus a valueToTokens/tokensForValueExchange edge-case gate.
  • Export the module through SharedCore via a SharedDiscreteCurve Kotlin/Native facade, with a cross-platform gate test.
  • Reduce Android's DiscreteBondingCurve to a thin adapter that delegates pricing to the shared engine and converts to/from java.math.BigDecimal at the boundary; the deleted LazyBigDecimalTable/TableLoader are replaced by AndroidTableLoader/ClasspathTableLoader/FileTableLoader (TableByteLoader).

This is one of two companion PRs — the other is in code-ios-app — for the shared bonding-curve migration. Landing requires: this PR merging to code/cash, then a SharedCore publish (new flipcash-shared-core-spm version), then the iOS PR's pin bump to that version.

@bmc08gt
bmc08gt requested a review from jeffyanta as a code owner September 6, 2026 13:05
@bmc08gt bmc08gt self-assigned this Sep 6, 2026
@github-actions github-actions Bot added type: feature New functionality area: build-system Gradle, convention plugins, build-logic labels Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build-system Gradle, convention plugins, build-logic type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant