You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Factoring out this binary search logic would simplify stableswap solver code drastically and would give us access to a BigDec binary search solver to use elsewhere later if needed
Progress towards: #2794 and #2702
## What is the purpose of the change
This PR implements a `BigDec` binary search function for our general osmoutils package.
## Brief Changelog
- Add `BinarySearchBigDec` to osmoutils
- Add `CompareBigDec` to osmoutils
- Refactor existing and new tests to be more readable (string map names, `t.Run` etc.)
## Testing and Verifying
This change added tests for both new functions in `osmoutils/binary_search_test.go`
## Documentation and Release Note
- Does this pull request introduce a new feature or user-facing behavior changes? (no)
- Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? (no)
- How is the feature or change documented? (not documented)
…rch (#2816)
Progress towards: #2794
## What is the purpose of the change
This PR replaces our stableswap two-asset CFMM solver to use the `BigDec` binary search implementation in #2802
Note: most of the diff is tests merged from #2697 and the core binary search logic from #2802, both of which had to be merged into this branch
## Brief Changelog
- Replace binary search solver logic with our `BigDec` binary search implementation
## Testing and Verifying
- All two-asset CFMM test cases were set up to test this implementation in `amm_test.go`
## Documentation and Release Note
- Does this pull request introduce a new feature or user-facing behavior changes? (no)
- Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? (no)
- How is the feature or change documented? (not documented)
Background
Factoring out this binary search logic would simplify stableswap solver code drastically and would give us access to a
BigDec
binary search solver to use elsewhere later if neededSuggested Design
BigDec
version ofBinarySearch
here:osmosis/osmoutils/binary_search.go
Lines 62 to 68 in 0378e54
Acceptance Criteria
The text was updated successfully, but these errors were encountered: