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 symbol mapping bug?

See original GitHub issue

Looks like the fetchMyTrades method for bitfinex (v1) is reverse mapping the symbol using values in commonCurrencies, so the symbol BCH/USD gets mapped to BABUSD. However, it looks like the underlying API call is expecting BCHUSD to be used (otherwise I get zero results).

I don’t know if this is caused by a symbol change maybe?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
npomfretcommented, Feb 22, 2019

@kroitor i think i’m done with this https://github.com/ccxt/ccxt/pull/4712 for now. It doesn’t quite solve the problem because it still can’t map delisted symbols to their new names (like tBCHUSD). However, you can get these trades back now by omitting the symbol parameter.

I’ve not yet figured out how their own reporting system does the mapping (and it’s using the same api). Will have another look soon.

1reaction
kroitorcommented, Feb 20, 2019

I suggest that we start with verifying the following:

mbp:ccxt igorkroitor$ node examples/js/cli.js bitfinex fetchMarkets
bitfinex.fetchMarkets ()
    id |             symbol |           base | quote | baseId | quoteId | active |              precision |                                                                                              limits
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
...
BABUSD |            BCH/USD |            BCH |   USD |    BAB |     USD |   true | {"price":5,"amount":5} |                                                                                     [object Object]
BABBTC |            BCH/BTC |            BCH |   BTC |    BAB |     BTC |   true | {"price":5,"amount":5} |                                                                                     [object Object]
...
339 objects
mbp:ccxt igorkroitor$

and this:

mbp:ccxt igorkroitor$ node examples/js/symbols.js bitfinex
Instantiating bitfinex exchange

Symbols:

tierBased | percentage | taker | maker | tiers           | id     | symbol             | base           | quote | baseId | quoteId | active
-------------------------------------------------------------------------------------------------------------------------------------------
...
true      | true       | 0.002 | 0.001 | [object Object] | BABBTC | BCH/BTC            | BCH            | BTC   | BAB    | BTC     | true
true      | true       | 0.002 | 0.001 | [object Object] | BABUSD | BCH/USD            | BCH            | USD   | BAB    | USD     | true
...

---------------------------------------------------------------

Currencies:

id  | numericId | code           | precision
--------------------------------------------
BAB |           | BCH            | 5
...
---------------------------------------------------------------
bitfinex has 339 symbols and 127 currencies

↑ This shows that we are taking those symbols from bitfinex itself, and we’re not inventing them. So, in case of bitfinex, BAB = BCH ABC = BCH. That is effective since the most recent ABC/SV fork. However, previously, they had a BCH market, that is delisted and is not returned from the fetchMarkets endpoint now, and your trades seem to be dated long before the most recent fork. So it was BCH in April 2018, but then it became BAB.

Proof: https://api.bitfinex.com/v1/symbols_details ← you won’t find any mention of BCH or bch here, but you will find bab.

Let’s think on how we should handle this and where the CCXT could guess that delisted market from…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Symbol Details - Bitfinex API
Get a list of valid symbol IDs and the pair details.
Read more >
تويتر \ Bitfinex على تويتر: "The Bitfinex Change Log provides ...
The Bitfinex Change Log provides insights into the most recent ... Add symbol mapping for the second currency of the pair - wrote...
Read more >
Exchanges — ccxt 2.4.71 documentation
markets mapping, indexed by symbol. This would cause a naming conflict for futures and other derivatives that have the same symbol as their...
Read more >
cryptofeed - PyPI
Bugfix: Fix test data generation, fix Binance test cases, ... Bugfix: correct USDT symbol mappings for Bitfinex ... Bugfix: fix symbol in Bitfinex...
Read more >
What's New in the Versions - MultiCharts
Fixed the bug in which the open position marker disappeared from the chart when an unrelated Symbol Mapping entry was removed.
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