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 decimals on ratio outputs #176

Merged
merged 2 commits into from
Sep 15, 2020
Merged

Fix decimals on ratio outputs #176

merged 2 commits into from
Sep 15, 2020

Conversation

tomlinton
Copy link
Contributor

Fix scaling on ratio outputs

Copy link
Contributor

@mikeshultz mikeshultz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment inline

adjustment = uint256(-outputValueDiff)
.div(combinedAssetValue)
.divPrecisely(redeemAssetCount)
.scaleBy(int8(assetDecimals[i] - 18));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any circumstance where combinedAssetValue would be greater than outputValueDiff?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I had this wrong though, should be updated now

@tomlinton tomlinton merged commit 127f211 into master Sep 15, 2020
@tomlinton tomlinton deleted the tomlinton/ratio-fix branch September 16, 2020 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants