Skip to content

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.

3 participants