Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: insufficient liquidity checks #190

Merged

Conversation

dib542
Copy link
Collaborator

@dib542 dib542 commented Nov 24, 2022

The insufficient liquidity checks appear to be incorrect. this should fix these issues.

  • the maxIn check was removed: I think the root of this cause is the current denom order of magnitude issues, these can be resolve better there: Fix: Coin denomination bugs #170
  • added another check that at the end of the calculation if not all token has been traded then there is not enough tokenOut available to cover the trade.

    - calculateOut may have an amountOut cap of maxOut
@dib542 dib542 linked an issue Nov 24, 2022 that may be closed by this pull request
@dib542 dib542 merged commit 0f4682d into main Nov 26, 2022
@dib542 dib542 deleted the 182-check-and-add-tests-for-insufficient-liquidity-checks branch November 26, 2022 05:47
dib542 pushed a commit that referenced this pull request Nov 26, 2022
## [0.1.46](v0.1.45...v0.1.46) (2022-11-26)

### Fixes

* insufficient liquidity checks ([#190](#190)) ([0f4682d](0f4682d))
@dib542
Copy link
Collaborator Author

dib542 commented Nov 26, 2022

🎉 This PR is included in version 0.1.46 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check and add tests for insufficient liquidity checks
1 participant