-
Notifications
You must be signed in to change notification settings - Fork 0
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
Inconsistency when using calculate_open_short
and calculate_max_short
together
#185
Comments
We're currently not passing a conservative_price argument to
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background
The sdk's
calculate_max_short
method takes abudget
and returns a bond amount.The
calculate_open_short
takes a bond amount and returns the trader deposit (ie:budget
).We expect that the outputs of one would reflect the inputs of the other, however the steps below show that this is not the case.
Steps to reproduce
calculate_max_short
with a max uint256 budget to get the pool's max short (in bonds).calculate_open_short
to get the actualtraderDeposit
needed.traderDeposit
back intocalculate_max_short
as the budget.Expected
The bond amount returned from
calculate_max_short
should be the same as the bond amount we gave tocalculate_open_short
.Actual
Feeding the
traderDeposit
back intocalculate_max_short
results in significantly fewer bonds shorted.Usecase:
In the Open Short form, users can input either an amount to pay (budget) or the number of bonds to short.
Depending on which one they type into, either
calculate_max_short
orcalculate_open_short
will be called to update the form.The text was updated successfully, but these errors were encountered: