-
Notifications
You must be signed in to change notification settings - Fork 7
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
Pool Stable: replaces Decimal with Decimal256 #377
base: main
Are you sure you want to change the base?
Conversation
8018e66
to
58a4802
Compare
), | ||
], | ||
) | ||
.to_u128() | ||
.expect("Pool stable: provide_liquidity: conversion to u128 failed"); | ||
.to_u128_with_precision(DECIMAL_PRECISION as i32); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this
.expect("Pool stable: provide_liquidity: conversion to u128 failed") | ||
- initial_invariant, | ||
); | ||
let invariant_delta = new_invariant - initial_invariant; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those should stay decimals
(Decimal256::raw(U256::from_u128(&env, invariant_delta)).div( | ||
&env, | ||
Decimal256::raw(U256::from_u128(&env, initial_invariant)), | ||
)) | ||
.mul_u128(&env, convert_i128_to_u128(total_shares)) | ||
.to_u128() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this should later be converted to u128_with_precision (greatest_precision)
No description provided.