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

Missing factor in PricerRule:convertPayCurrencyToToken #164

Closed
benjaminbollen opened this issue Feb 28, 2019 · 1 comment
Closed

Missing factor in PricerRule:convertPayCurrencyToToken #164

benjaminbollen opened this issue Feb 28, 2019 · 1 comment

Comments

@benjaminbollen
Copy link
Contributor

Missing factor in PricerRule:convertPayCurrencyToToken:
https://github.com/OpenSTFoundation/openst-contracts/blob/develop/contracts/rules/PricerRule.sol#L397

misses the factor 10**PriceOracleDecimals. Correction reads:

_payCurrencyAmount
            .mul(
                conversionRateFromBaseCurrencyToToken
            )
            .mul(
                requiredPriceOracleDecimals
            )
            .div(
                10 ** conversionRateDecimalsFromBaseCurrencyToToken
            )
            .div(
                _baseCurrencyPriceInPayCurrency
            );
@benjaminbollen
Copy link
Contributor Author

above is wrong; UT.decimals must be used. Improved documentation is helpful. The PriceOracle pricePoint is input as u$/OST (not u$/attoOST), which caused the discrepancy. Hotpatched in #161 but leaving this ticket open to re-examine and tidy-up in calmer times

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

No branches or pull requests

1 participant