Ccxt: Bitcoin Gold and Nimiq on Coinmarketcap not found

Created on 10 Jan 2018  路  3Comments  路  Source: ccxt/ccxt

Hello,

i have a problem, when i try to get the current price for bitcoin gold and nimiq.
When i call fetch_ticker i get Bitgem and NetCoin. It seems this is the same problem as https://github.com/ccxt/ccxt/issues/348 , https://github.com/ccxt/ccxt/issues/1147 and
https://github.com/ccxt/ccxt/issues/867

At this moment there are 1398 currencys listed on coinmarketcap. I think name overlappings are not exclusive in the future. But how to deal with them?

In https://github.com/ccxt/ccxt/issues/348 you told, that the coin with the higher marketcap wins. But it seems it doesn't work in PHP.

Thanks in advance

  • OS: Debian
  • Programming Language: PHP
  • CCXT version: "1.10.579
  • Exchange: Coinmarketcap
  • Method: fetch_ticker
$cmc = new \ccxt\coinmarketcap();
print_r($cmc->fetch_ticker('BTG/USD'));

print_r($cmc->fetch_ticker('NET/USD'));

$found = false;
foreach ($cmc->fetch_tickers() as $ticker) {
    if($ticker['info']['id'] == 'nimiq') {
        $found = true;
    }
}

var_export($found);
(
    [symbol] => BTG/USD
    [timestamp] => 1515601740000
    [datetime] => 2018-01-10T16:29:00.000+00:00
    [high] => 
    [low] => 
    [bid] => 
    [ask] => 
    [vwap] => 
    [open] => 
    [close] => 
    [first] => 
    [last] => 11.1172
    [change] => 11.21
    [percentage] => 
    [average] => 
    [baseVolume] => 
    [quoteVolume] => 17999.5
    [info] => Array
        (
            [id] => bitgem
            [name] => Bitgem
            [symbol] => BTG
            [rank] => 828
            [price_usd] => 11.1172
            [price_btc] => 0.00075009
            [24h_volume_usd] => 17999.5
            [market_cap_usd] => 664864.0
            [available_supply] => 59805.0
            [total_supply] => 59805.0
            [max_supply] => 
            [percent_change_1h] => 3.64
            [percent_change_24h] => 11.21
            [percent_change_7d] => 95.0
            [last_updated] => 1515601740
        )

)
Array
(
    [symbol] => NET/USD
    [timestamp] => 1515601741000
    [datetime] => 2018-01-10T16:29:01.000+00:00
    [high] => 
    [low] => 
    [bid] => 
    [ask] => 
    [vwap] => 
    [open] => 
    [close] => 
    [first] => 
    [last] => 0.00844807
    [change] => -11.78
    [percentage] => 
    [average] => 
    [baseVolume] => 
    [quoteVolume] => 112679
    [info] => Array
        (
            [id] => netcoin
            [name] => NetCoin
            [symbol] => NET
            [rank] => 568
            [price_usd] => 0.00844807
            [price_btc] => 0.00000057
            [24h_volume_usd] => 112679.0
            [market_cap_usd] => 6649702.0
            [available_supply] => 787126712.0
            [total_supply] => 787126712.0
            [max_supply] => 
            [percent_change_1h] => 3.11
            [percent_change_24h] => -11.78
            [percent_change_7d] => 298.4
            [last_updated] => 1515601741
        )

)
false

All 3 comments

Thank you very much 馃槃

@slideup-benni thank you for reporting!

No Problem
Unfortunately, i found an other one just now: BAT for Basic Attention Token, but it returns BatCoin.

Was this page helpful?
0 / 5 - 0 ratings