osmosis-labs / isotonic

Smart Contracts for the Lendex Protocol
MIT License
1 stars 0 forks source link

user cannot withdraw amount listed on the screen #125

Closed ks-victor closed 2 years ago

ks-victor commented 2 years ago
Screenshot 2022-03-29 at 13 19 31

Once I type in the number listed, I get an error

uint commented 2 years ago

@msteiner96 How do you determine the withdrawable amount, actually? Is this the right line? https://github.com/confio/isotonic-demo-app/blob/main/src/components/modal/actions/withdraw.js#L58

msteiner96 commented 2 years ago

@uint yep it's that line. But you told me that I could also directly query it without any calculation. Have to update that.

uint commented 2 years ago

@msteiner96 Please do! I think the formula there might be the cause of this bug.

hashedone commented 2 years ago

@msteiner96 also make sure nothing is rounded up for purpose of displaying it. It would also cause this error. If you really want to trim some numbers, then trim it, not round.

msteiner96 commented 2 years ago

I don't think that I rounded or trimmed anything. All I calculated there was actually getting deposited amount and subtract the debt.

uint commented 2 years ago

Update: turned out there's no good query for this yet on backend side. I implemented it here: #133 . Frontend should switch to using it once merged.