-
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: Replace belief_price
with minimum expected amount
#280
Conversation
… the amount of tokens expected to be returned
…urn an error during do_swap if the return is not what is expected
I had to stop by and check this. One small discrepancy between In pub fn compute_swap(
offer_pool: i128,
ask_pool: i128,
offer_amount: i128,
commission_rate: Decimal,
referral_fee: i64,
) -> ComputeSwap { while in pub fn compute_swap(
env: &Env,
offer_pool: i128,
ask_pool: i128,
offer_amount: i128,
commission_rate: Decimal,
) -> (i128, i128, i128) {
I have knowingly left that as is, because I think it's okay and better to readability |
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.
LGTM
4d74226
to
c0073f9
Compare
This change set replaces the
belief_price
argument with the amount expected to receive in return after the swap.Rationale: It's easier and more straightforward both implementation-wise and for the user to specify those amounts directly.