question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bitfinex returns negative balance

See original GitHub issue

Biftinex returns negative balance.

  • OS: Linux protagonist 4.14.5-1-ARCH #1 SMP PREEMPT Sun Dec 10 14:50:30 UTC 2017 x86_64 GNU/Linux
  • Programming Language: python
  • CCXT version: 1.10.593
  • Exchange: Bitfinex
  • Method: fetch_balance

Reproduction requires private API keys.

From info field:

{'type': 'exchange', 'currency': 'eos', 'amount': '-0.00000032', 'available': '0.0'}

which goes to

{'free': 0.0, 'used': -3.2e-07, 'total': -3.2e-07}

after ccxt mangling.

This is definitely a bug on Bitfinex side…I’m not sure what to think of it.

I’d suggest max(0, amount) though am not sure if this the right call (since this error shall fall silently). Comments?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mkutnycommented, Jan 8, 2018

Some time ago I’ve got a similar issue. I saw a negative amount via their UI but haven’t come up with an idea to check what would ccxt return.

I’m not sure we need to max(0, amount) though. The balance is negative. We need to reflect the reality to users even if we don’t like it.

0reactions
kroitorcommented, Jan 8, 2018

I would agree with @mkutny here, it’s obviously coming from their API, and we would not want to change values implicitly. I would suggest to account for that in logic, as we most likely cannot workaround this in the lib, better leave it for the user to decide. Closing this for now, until we have some followup on this. Feel free to reopen it if needed, or just continue posting here, we will be happy to answer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is a settlement on Bitfinex
If you have a negative amount in your wallet, Bitfinex will take a currency with a positive balance and exchange it with a...
Read more >
Bitfinex Withdrawal not possible due to Negative Balance
Hot to get rid of this situation when you want to withdraw your money from Bitfinex. In the video I'm showing you what...
Read more >
Bitfinex - Negative balance | Waltio Help Center
On Bitfinex, it is possible that your balance becomes "fictionally" negative. If this happens to you, Bitfinex will then create a Settlement type...
Read more >
Negative Balance with Open Margin Positions : Support Desk
Negative amounts are correct, if you have open margin positions. Lets imagine you have $100 USD. And you buy 0.3 btc for 300USD...
Read more >
Bitfinex on Twitter: "The platform is returning to normal ...
The platform is returning to normal operations. We will keep monitoring the situation closely. ... pls next time let me realise there is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found