anchor-earn icon indicating copy to clipboard operation
anchor-earn copied to clipboard

Can't withdraw full balance at once

Open xapss opened this issue 2 years ago • 4 comments

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)

xapss avatar Feb 09 '22 15:02 xapss

@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 avatar Feb 17 '22 04:02 nimishpatel19

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 avatar Feb 17 '22 06:02 nimishpatel19

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.

nimishpatel19 avatar Feb 17 '22 06:02 nimishpatel19

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

nimishpatel19 avatar Feb 22 '22 10:02 nimishpatel19