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

Bigz/amm repegged min max bar fix #282

Merged
merged 7 commits into from
Dec 7, 2022

Conversation

0xbigz
Copy link
Member

@0xbigz 0xbigz commented Dec 7, 2022

No description provided.

let per_peg_cost = if quote_asset_reserve != terminal_quote_asset_reserve {
quote_asset_reserve
.cast::<i128>()?
.safe_sub(terminal_quote_asset_reserve.cast::<i128>()?)?
.safe_div(AMM_RESERVE_PRECISION_I128 / PEG_PRECISION_I128)?
.safe_add(1)?
.safe_div_ceil(AMM_RESERVE_PRECISION_I128 / PEG_PRECISION_I128)?
Copy link
Member Author

Choose a reason for hiding this comment

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

@crispheaney this will make negative number "larger negative" than otherwise?

Copy link
Member

Choose a reason for hiding this comment

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

it rounds to positive infinity

@crispheaney crispheaney merged commit ed4047c into master Dec 7, 2022
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