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

Rotki 1.33.0 not displaying cryptocurrency balance on OKX TR #7915

Closed
izzetemredemir opened this issue May 10, 2024 · 6 comments
Closed

Rotki 1.33.0 not displaying cryptocurrency balance on OKX TR #7915

izzetemredemir opened this issue May 10, 2024 · 6 comments

Comments

@izzetemredemir
Copy link
Contributor

Problem Definition

I am experiencing an issue with Rotki where it does not display my cryptocurrency balance on OKX, specifically the Turkish version available at https://tr.okx.com/. The expected behavior is that Rotki should be able to show all balances from supported exchanges, including OKX TR.

System Description

Operating system: MacOS on Apple Silicon MacBook Pro
Rotki version: 1.33.0

@LefterisJP
Copy link
Member

hey @izzetemredemir thanks for the issue and welcome!

Did 1.32.2 or previous versions work with that exchange. Rotki supports OKX normally and it should work. Previous OKX users have confirmed it.

If there is a separate exchange for Turkey, then we do not have any specific support for it and would probably need work to add it. If it's the same one but just has a different api base url that work should not be hard.

But without a test api key it's hard to do so. We don't have any Turkish people in our dev team. Could you perhaps share a test read only key to see how we can support it? You can contact us in discord via DM here: https://discord.rotki.com/

@izzetemredemir
Copy link
Contributor Author

I think that only the API endpoint has changed, and that the API endpoints still work the same way. I believe a region selection feature should be added.

@LefterisJP
Copy link
Member

LefterisJP commented May 10, 2024

I think that only the API endpoint has changed, and that the API endpoints still work the same way. I believe a region selection feature should be added.

Sure but without the ability to test it we can't do it and hope it works. It woud be cool to get an api key to test this. And yes our first move would be to just add OKX TR as an option with identical api to OKX and hope it works.

Another option if you don't want to give a key is to just really just add a selection, create a test binary for you and send it to you and tell us if it works.

@izzetemredemir
Copy link
Contributor Author

I built and ran the code on my computer and tested it with OKX for the TR region. It turns out there was no need to change the endpoint. The reason I couldn't see my current balance on Rotki is because I had an active sell order in spot trading using all my funds. When you have an active trading order, it doesn't show up in the balance section, which might be a bug. After I canceled my sell order in spot trading, my balance appeared. This could be another bug; you may close the issue if you want, as I have completed the tests.

@LefterisJP
Copy link
Member

The reason I couldn't see my current balance on Rotki is because I had an active sell order in spot trading using all my funds. When you have an active trading order, it doesn't show up in the balance section

That means the api does not return it, or we use only the "available" part of the balance in the API. Did you say you managed to run rotki by source? That seems like a bug on our side.

Can you then tweak this area of the code:

amount = deserialize_asset_amount(currency_data['availBal'])
and run it with your account? It seems to indeed only get the available balance.

According to their API: https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-balance there is a lot more types of balance to get and I can't be sure which to try. I would guess that since we get availBal we should also get frozenBal to have it all but not 100% as the docs don't help.

If you can do this change and run the code to see it would help a lot!

@izzetemredemir
Copy link
Contributor Author

Okey I fixed pls check my pr

izzetemredemir added a commit to izzetemredemir/rotki that referenced this issue May 11, 2024
izzetemredemir added a commit to izzetemredemir/rotki that referenced this issue May 13, 2024
LefterisJP pushed a commit that referenced this issue May 13, 2024
* Okx frozen balance bug fix #7915

* Update docs/changelog.rst
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

Successfully merging a pull request may close this issue.

2 participants