cake-tech / cake_wallet

The open source repository for Cake Wallet, a noncustodial multi-currency wallet, and Monero.com, a noncustodial Monero-only wallet. Need help? Check out https://guides.cakewallet.com
https://cakewallet.com
MIT License
669 stars 175 forks source link

Incorrect fiat balance in Android app #795

Closed meyou69 closed 1 year ago

meyou69 commented 1 year ago

Hello,

I noticed that my current version of the Android app (version 4.5.6) has a bug where, when displaying my Monero wallet balance, it shows a balance which is not consistent with the fiat balance shown right under it.

The fiat currency chosen by me is Romanian RON. When I go to Google and manually convert my XMR balance to RON, the amount calculated is very different (way higher) than the one shown in the Cake Wallet.

This looks like a simple exchange rate bug. Can you look into it, please?

SamsungGalaxyPlayer commented 1 year ago

Hello, thanks for reporting this! We will look into the issue, and we should push an update to our API later this week.

tannerdsilva commented 1 year ago

Thank you @meyou69 for bringing this to our attention. I found a few very subtle flaws in the logic needed to produce this particular quote.

After making (and then deleting) two invalid response, I believe I finally have the issue nailed down.

Our service is now quoting XMR / RON at a much more reasonable rate, and I will be closing this ticket.

Thanks again.

tannerdsilva commented 1 year ago

I am actually going to reopen this issue because OKX is still trading RON / USDT at a super wacky rate (seemingly) and I am not going to be able to solve for that.

tannerdsilva commented 1 year ago

Aside from the bugs I have resolved, this is a primary reason the price continues to be incorrect.

https://www.okx.com/trade-spot/ron-usdt

tannerdsilva commented 1 year ago

I am exploring a possible adjustment to my algorithm that will direct the pricing outcome away from this fluke OKX pricing phenomena we are seemingly dealing with.

Not willing to hard-code anything for this particular use-case (since OKX is seemingly providing a valid market) but I believe I might be able to tweak some conditions around this.

Will continue to post updates.

SamsungGalaxyPlayer commented 1 year ago

Found the issue. OKX has a market for RON that's for some silly other "Ronin" coin. Name overlap. Will fix :)

tannerdsilva commented 1 year ago

Thank you, Justin. Great find.

Blacklist applied in production, pricing for XMR / RON now reflective of general market quotes.

SamsungGalaxyPlayer commented 1 year ago

@meyou69 this should work now, thanks for reporting!

meyou69 commented 1 year ago

I can confirm that the bug doesn't exist for me, anymore. Thank you for fixing this!