Commit Graph

4 Commits

Author SHA1 Message Date
Jon Cinque f8ba091a36
Fix bpf build, need to fully reference u128::MAX (#946) 2020-12-14 18:06:38 +01:00
Jon Cinque 8233d35fda
token-swap: Refactor math into sqrt function and add proptest (#943)
* Refactor into sqrt function and add proptest

* Run cargo fmt + clippy

* Address review feedback
2020-12-14 17:48:41 +01:00
Jon Cinque 087ae2e242
token-swap: Add offset curve and math (#935)
* Add offset curve

* Fix for math

* Add PreciseNumber

* Use Balancer formulation for trading token -> pool token conversion

* Add round-trip conversion testing

* Add offset curve to JS

* Run cargo fmt

* Update JS test numbers for new calcs

* Integrate review feedback

* Allow for withdrawals when one side is 0

* Run cargo fmt

* Disallow deposits for offset curve

* Run cargo fmt

* Allow for withdrawals through 0
2020-12-10 18:31:21 +01:00
Yuriy Savchenko a0d0ae63ca
token-swap stable curve: 256-bit math added with tests (#886)
* Stable curve math rewritten to 256-bit, reference simulation added with test integration

* Formatting error fixed

* Clippy warnings fixed

* Fixed dependencies to remove crates not supportinf bpf

* Fixed indentations

* Fixed lint errors

* Fixed format warnings

* Fixing clippy lint errors

* U256 math and simulation library refactoring, checked math used everywhere, other small fixes

* Fixed conversion to optional u128
2020-11-25 21:19:25 +01:00