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

Can't withdraw full balance at once #27

Open
xapss opened this issue Feb 9, 2022 · 4 comments
Open

Can't withdraw full balance at once #27

xapss opened this issue Feb 9, 2022 · 4 comments

Comments

@xapss
Copy link

xapss commented Feb 9, 2022

I put 100.5 UST in my Anchor. I check the balance over time and it's increasing.
10 minutes in, I try to withdraw the 100.5. By now it's 100.500454.

However, I can only withdraw 80 UST at this time.
It throws me an error: Error: Cannot withdraw more than balance. 100500000 > 83228385

I withdraw 80.5 UST.
Then I try to withdraw the other 20 UST. I can withdraw only 16 UST now.
It throws me an error: Error: Cannot withdraw more than balance. 20000000 > 16563164

What am I missing? Why can't I withdraw the full balance?

(using 2.0.0 alpha1)

@nimishpatel19
Copy link
Contributor

@xapss Yes I am also facing the same issue. I think SDK has issue and It is comparing user's aUST token even if we pass currency as UST (Same here using 2.0.0-alpha1).

@nimishpatel19
Copy link
Contributor

nimishpatel19 commented Feb 17, 2022

I put 100.5 UST in my Anchor. I check the balance over time and it's increasing. 10 minutes in, I try to withdraw the 100.5. By now it's 100.500454.

However, I can only withdraw 80 UST at this time. It throws me an error: Error: Cannot withdraw more than balance. 100500000 > 83228385

I withdraw 80.5 UST. Then I try to withdraw the other 20 UST. I can withdraw only 16 UST now. It throws me an error: Error: Cannot withdraw more than balance. 20000000 > 16563164

What am I missing? Why can't I withdraw the full balance?

(using 2.0.0 alpha1)

I did quick fix

Remove this line from here : https://github.com/Anchor-Protocol/anchor-earn/blob/4c43c6f35381603d58c2f33f61ccb61c7477c68e/src/facade/terra-anchor-earn.ts#L251

and paste it here:
https://github.com/Anchor-Protocol/anchor-earn/blob/4c43c6f35381603d58c2f33f61ccb61c7477c68e/src/facade/terra-anchor-earn.ts#L280

@nimishpatel19
Copy link
Contributor

I put 100.5 UST in my Anchor. I check the balance over time and it's increasing. 10 minutes in, I try to withdraw the 100.5. By now it's 100.500454.
However, I can only withdraw 80 UST at this time. It throws me an error: Error: Cannot withdraw more than balance. 100500000 > 83228385
I withdraw 80.5 UST. Then I try to withdraw the other 20 UST. I can withdraw only 16 UST now. It throws me an error: Error: Cannot withdraw more than balance. 20000000 > 16563164
What am I missing? Why can't I withdraw the full balance?
(using 2.0.0 alpha1)

I did quick fix

Remove this line from here : https://github.com/Anchor-Protocol/anchor-earn/blob/4c43c6f35381603d58c2f33f61ccb61c7477c68e/src/facade/terra-anchor-earn.ts#L251 and paste it here: https://github.com/Anchor-Protocol/anchor-earn/blob/4c43c6f35381603d58c2f33f61ccb61c7477c68e/src/facade/terra-anchor-earn.ts#L280

Reason: Actually in code, it is comparing UST deposits with aUST. So that's why assert creating insufficient balance error while withdrawing full deposits.
@MSNTCS You can solve it by doing it.

cosullivan added a commit that referenced this issue Feb 22, 2022
Bug #27 Can't withdraw full balance at once solved
@nimishpatel19
Copy link
Contributor

@xapss Issue is solved in latest version : '2.0.0'. Install it. Thanks.

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

2 participants