{"action":"created","issue":{"url":"https://api.github.com/repos/ccxt-dev/ccxt/issues/401","repository_url":"https://api.github.com/repos/ccxt-dev/ccxt","labels_url":"https://api.github.com/repos/ccxt-dev/ccxt/issues/401/labels{/name}","comments_url":"https://api.github.com/repos/ccxt-dev/ccxt/issues/401/comments","events_url":"https://api.github.com/repos/ccxt-dev/ccxt/issues/401/events","html_url":"https://github.com/ccxt-dev/ccxt/issues/401","id":268449112,"number":401,"title":"Duplicate pairs in exchanges","user":{"login":"uvidusvermis","id":33096585,"avatar_url":"https://avatars3.githubusercontent.com/u/33096585?v=4","gravatar_id":"","url":"https://api.github.com/users/uvidusvermis","html_url":"https://github.com/uvidusvermis","followers_url":"https://api.github.com/users/uvidusvermis/followers","following_url":"https://api.github.com/users/uvidusvermis/following{/other_user}","gists_url":"https://api.github.com/users/uvidusvermis/gists{/gist_id}","starred_url":"https://api.github.com/users/uvidusvermis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uvidusvermis/subscriptions","organizations_url":"https://api.github.com/users/uvidusvermis/orgs","repos_url":"https://api.github.com/users/uvidusvermis/repos","events_url":"https://api.github.com/users/uvidusvermis/events{/privacy}","received_events_url":"https://api.github.com/users/uvidusvermis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"kroitor","id":1294454,"avatar_url":"https://avatars3.githubusercontent.com/u/1294454?v=4","gravatar_id":"","url":"https://api.github.com/users/kroitor","html_url":"https://github.com/kroitor","followers_url":"https://api.github.com/users/kroitor/followers","following_url":"https://api.github.com/users/kroitor/following{/other_user}","gists_url":"https://api.github.com/users/kroitor/gists{/gist_id}","starred_url":"https://api.github.com/users/kroitor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kroitor/subscriptions","organizations_url":"https://api.github.com/users/kroitor/orgs","repos_url":"https://api.github.com/users/kroitor/repos","events_url":"https://api.github.com/users/kroitor/events{/privacy}","received_events_url":"https://api.github.com/users/kroitor/received_events","type":"User","site_admin":false},"assignees":[{"login":"kroitor","id":1294454,"avatar_url":"https://avatars3.githubusercontent.com/u/1294454?v=4","gravatar_id":"","url":"https://api.github.com/users/kroitor","html_url":"https://github.com/kroitor","followers_url":"https://api.github.com/users/kroitor/followers","following_url":"https://api.github.com/users/kroitor/following{/other_user}","gists_url":"https://api.github.com/users/kroitor/gists{/gist_id}","starred_url":"https://api.github.com/users/kroitor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kroitor/subscriptions","organizations_url":"https://api.github.com/users/kroitor/orgs","repos_url":"https://api.github.com/users/kroitor/repos","events_url":"https://api.github.com/users/kroitor/events{/privacy}","received_events_url":"https://api.github.com/users/kroitor/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2017-10-25T15:44:51Z","updated_at":"2017-10-25T18:32:41Z","closed_at":"2017-10-25T16:06:08Z","author_association":"NONE","body":"It seems, that some exchanges in `.markets` have duplicated (but reversed) pairs.\r\nI checked only exchanges, that allow market loading without private keys.\r\nTested with python ccxt v.1.9.260:\r\n```python\r\nimport ccxt\r\nfor ex in ccxt.exchanges:\r\n    exobj=getattr(ccxt,ex)()\r\n    try:\r\n        exobj.load_markets(True)\r\n    except:\r\n        continue\r\n    for m1 in exobj.markets:\r\n        for m2 in exobj.markets:\r\n            if exobj.markets[m1]['id']!=exobj.markets[m2]['id']:\r\n                if (exobj.markets[m1]['base']==exobj.markets[m2]['quote']) and (exobj.markets[m2]['base']==exobj.markets[m1]['quote']):\r\n                    print('Dup pair in',exobj.id,':',exobj.markets[m1]['base'],'<->',exobj.markets[m2]['base'])\r\n```\r\nOutput:\r\n```\r\nDup pair in livecoin : RUR/USD <-> USD/RUR\r\nDup pair in livecoin : USD/RUR <-> RUR/USD\r\nDup pair in tidex : eth_waves <-> waves_eth\r\nDup pair in tidex : waves_eth <-> eth_waves\r\nDup pair in yobit : doge_eth <-> eth_doge\r\nDup pair in yobit : waves_eth <-> eth_waves\r\nDup pair in yobit : eth_doge <-> doge_eth\r\nDup pair in yobit : waves_doge <-> doge_waves\r\nDup pair in yobit : doge_waves <-> waves_doge\r\nDup pair in yobit : eth_waves <-> waves_eth\r\n```"},"comment":{"url":"https://api.github.com/repos/ccxt-dev/ccxt/issues/comments/339427324","html_url":"https://github.com/ccxt-dev/ccxt/issues/401#issuecomment-339427324","issue_url":"https://api.github.com/repos/ccxt-dev/ccxt/issues/401","id":339427324,"user":{"login":"kroitor","id":1294454,"avatar_url":"https://avatars3.githubusercontent.com/u/1294454?v=4","gravatar_id":"","url":"https://api.github.com/users/kroitor","html_url":"https://github.com/kroitor","followers_url":"https://api.github.com/users/kroitor/followers","following_url":"https://api.github.com/users/kroitor/following{/other_user}","gists_url":"https://api.github.com/users/kroitor/gists{/gist_id}","starred_url":"https://api.github.com/users/kroitor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kroitor/subscriptions","organizations_url":"https://api.github.com/users/kroitor/orgs","repos_url":"https://api.github.com/users/kroitor/repos","events_url":"https://api.github.com/users/kroitor/events{/privacy}","received_events_url":"https://api.github.com/users/kroitor/received_events","type":"User","site_admin":false},"created_at":"2017-10-25T18:32:41Z","updated_at":"2017-10-25T18:32:41Z","author_association":"OWNER","body":"I added the [examples/php/arbitrage-pairs.php](https://github.com/ccxt-dev/ccxt/blob/master/examples/php/arbitrage-pairs.php).\r\nSee the [examples/php] on how to run them.\r\nIt needs a few ids for exchanges in question and it generated a cross-table of arbitrage pairs for you, like this one:\r\n\r\n```\r\nmbp:ccxt igorkroitor$ php -f examples/php/arbitrage-pairs.php kraken bittrex poloniex bitfinex liqui\r\nkraken has 59 symbols\r\nbittrex has 261 symbols\r\npoloniex has 101 symbols\r\nbitfinex has 61 symbols\r\nliqui has 205 symbols\r\nLoaded all markets\r\n+-----------+--------+---------+----------+----------+-------+\r\n| symbol    | kraken | bittrex | poloniex | bitfinex | liqui |\r\n+-----------+--------+---------+----------+----------+-------+\r\n| BCH/BTC   | kraken | bittrex | poloniex | bitfinex | liqui |\r\n| BCH/ETH   |        | bittrex | poloniex | bitfinex | liqui |\r\n| BCH/USDT  |        | bittrex | poloniex |          | liqui |\r\n| BTC/USDT  |        | bittrex | poloniex |          | liqui |\r\n| CVC/BTC   |        | bittrex | poloniex |          | liqui |\r\n| CVC/ETH   |        | bittrex | poloniex |          | liqui |\r\n| DASH/BTC  | kraken | bittrex | poloniex | bitfinex | liqui |\r\n| DASH/USDT |        | bittrex | poloniex |          | liqui |\r\n| EOS/BTC   | kraken |         |          | bitfinex | liqui |\r\n| EOS/ETH   | kraken |         |          | bitfinex | liqui |\r\n| ETC/BTC   | kraken | bittrex | poloniex | bitfinex |       |\r\n| ETC/ETH   | kraken | bittrex | poloniex |          |       |\r\n| ETH/BTC   | kraken | bittrex | poloniex | bitfinex | liqui |\r\n| ETH/USDT  |        | bittrex | poloniex |          | liqui |\r\n| GNO/BTC   | kraken | bittrex | poloniex |          | liqui |\r\n| GNO/ETH   | kraken | bittrex | poloniex |          | liqui |\r\n| GNT/BTC   |        | bittrex | poloniex |          | liqui |\r\n| GNT/ETH   |        | bittrex | poloniex |          | liqui |\r\n| LTC/BTC   | kraken | bittrex | poloniex | bitfinex | liqui |\r\n| LTC/USDT  |        | bittrex | poloniex |          | liqui |\r\n| MLN/BTC   | kraken | bittrex |          |          | liqui |\r\n| OMG/BTC   |        | bittrex | poloniex | bitfinex | liqui |\r\n| OMG/ETH   |        | bittrex | poloniex | bitfinex | liqui |\r\n| QTUM/BTC  |        | bittrex |          | bitfinex | liqui |\r\n| QTUM/ETH  |        | bittrex |          | bitfinex | liqui |\r\n| REP/BTC   | kraken | bittrex | poloniex |          | liqui |\r\n| REP/ETH   | kraken | bittrex | poloniex |          | liqui |\r\n| SBD/BTC   |        | bittrex | poloniex |          | liqui |\r\n| STEEM/BTC |        | bittrex | poloniex |          | liqui |\r\n| XMR/BTC   | kraken | bittrex | poloniex | bitfinex |       |\r\n| XRP/BTC   | kraken | bittrex | poloniex | bitfinex |       |\r\n| ZEC/BTC   | kraken | bittrex | poloniex | bitfinex |       |\r\n+-----------+--------+---------+----------+----------+-------+\r\n```\r\n\r\nThe script also contains a `$min_exchanges` setting of how many the pair should cover to be listed out in the resulting table. The above table was generated with a setting of 3. So each pair in the table is present on at least three of input exchanges specified by the user."}}
{"actor":{"display_login":"kroitor"}}