Coder Social home page Coder Social logo

manu354 / cryptocurrency-arbitrage Goto Github PK

View Code? Open in Web Editor NEW
1.2K 145.0 333.0 1006 KB

A cryptocurrency arbitrage opportunity calculator. Over 800 currencies and 50 markets.

License: GNU General Public License v3.0

JavaScript 93.69% HTML 6.31%
arbitrage-opportunity trading-bot cryptocurrency altcoins ethereum cryptocurrency-arbitrage bitcoin litecoin

cryptocurrency-arbitrage's People

Contributors

gilrosenthal avatar manu354 avatar primly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cryptocurrency-arbitrage's Issues

data.result is not iterable

I added a market

{
marketName: 'market',
URL: 'https://market.net/api/ticker/adt_eth',
toBTCURL: false,
pairURL : '',
last: function (data, coin_prices) { //Where to find the last price of coin in JSON data
return new Promise(function (res, rej) {
try {
for (let obj of data.result) {
if(obj["MarketName"].includes('BTC-')) {
let coinName = obj["MarketName"].replace("BTC-", '');
if (!coin_prices[coinName]) coin_prices[coinName] = {};
coin_prices[coinName].market= obj.Last;
}
}
res(coin_prices);
}
catch (err) {
console.log(err);
rej(err);
}

        })
    },

},

Which returns for https://market.net/api/ticker/adt_eth

{"adt_eth":{"high":0.00022014,"low":0.00022014,"avg":0.00022014,"vol":0,"vol_cur":0,"last":0.00022014,"buy":0.00002016,"sell":0.00040400,"updated":1514361578},

but when i run the bot i get

TypeError: data.result is not iterable
at /root/arb/settings.js:101:42
at new Promise ()
at Object.last (/root/arb/settings.js:99:20)
at Request._callback (/root/arb/main.js:51:49)
at Request.self.callback (/root/arb/node_modules/request/request.js:186:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request. (/root/arb/node_modules/request/request.js:1163:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage. (/root/arb/node_modules/request/request.js:1085:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1056:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)

the return result is valid JSON. how do i process the API call result to make it digestible?

calculator bug

I went to the hosted site today and it seems to have a bug in the calculation. It's telling me to trade

TRANSFER BSTY FROM BLEUTRADE TO CRYPTOPIA (15.56%)
BSTY
15.56%
Bleutrade: 0.00617  Cryptopia: 0.00713

then

SELL FOR BITB AND TRANSFER BACK TO CRYPTOPIA (4.71%)
BITB
4.71%
Bleutrade: 0.000890  Cryptopia: 0.000850

obviously this trade makes zero sense and it seems all the trades available have the same issue. Seems like we've broken something in the calculation. Or could this be related to memory leak issues?

Jubi/BTC38 Exchanges are infeasible

I know that the program converts CNY to BTC for value, but ATM it would be very hard to actually try and do these trades because

  1. Jubi is in Chinese, and not sure about others but I certainly don't speak Mandarin ๐Ÿ˜†
  2. BTC38 has very little Alt/BTC pairs, so one would have to settle for CNY
  3. Once you make the transaction, you have CNY, and I'm not quite sure what to do with that

Just some thoughts, let me know!

Issues running locally

I've not been able to get the data to refresh on UI page when running locally. This may be due to Azure problem you posted in issues #6, but I'm not sure.

As a workaround I've changed line 107 in script.js from

let socket = io('https://ccarbitrage.azurewebsites.net/');

to

let socket = io("http://localhost:3000");

This keeps my data up to date, but still doesn't get the local index.html page to refresh, so I've added:

<meta http-equiv="refresh" content="25" >

to docs/index.html to force the page to refresh every 25 secs (10 is too annoying).

Obviously not helpful for hosted instance, but may be helpful getting some folks running locally for debug and testing purposes.

frontend do not work

Hi,
I download and install your code in a server with node >8, i navigate in /docs to see the frontend and work normally, but it do not let you select exchange or money, and do not dysplay the aritrage oportunities.
If i use localhost:3000 works fine, but i want to use with your fronend, any guide how?
Your site is not working either in the frontend. how can i fix?
sin titulo

Link to exchange/market

It would be nice to have a link to each exchange/market. Probably make the name of the exchange for each coin a hyperlink directly to that coin's market on that exchange.

Front End Doesnt Load

Front end doesnt load with markets and prices of coins through the website link. How can I fix this?

Error: [email protected] start: `node main`

When running npm start, this is the output log :

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]
6 silly lifecycle [email protected]
prestart: no script for prestart, continuing
7 info lifecycle [email protected]start: [email protected]
8 verbose lifecycle [email protected]
start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]start: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/root/cryptocurrency-arbitrage/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin
10 verbose lifecycle [email protected]
start: CWD: /root/cryptocurrency-arbitrage
11 silly lifecycle [email protected]start: Args: [ '-c', 'node main' ]
12 silly lifecycle [email protected]
start: Returned: code: 1 signal: null
13 info lifecycle [email protected]~start: Failed to exec start script
14 verbose stack Error: [email protected] start: node main
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:920:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
15 verbose pkgid [email protected]
16 verbose cwd /root/cryptocurrency-arbitrage
17 error Linux 3.10.0-514.el7.x86_64
18 error argv "/usr/bin/node" "/usr/bin/npm" "start"
19 error node v6.11.3
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error [email protected] start: node main
22 error Exit status 1
23 error Failed at the [email protected] start script 'node main'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the cryptocurrency-arbitrage package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error node main
23 error You can get information on how to open an issue for this project with:
23 error npm bugs cryptocurrency-arbitrage
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls cryptocurrency-arbitrage
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

Issue when starting

main-1 (err): at tryModuleLoad (module.js:446:12)
main-1 (err): at Function.Module._load (module.js:438:3)
main-1 (err): at Module.runMain (module.js:604:10)
main-1 (err): at run (bootstrap_node.js:394:7)
main-1 (err): at startup (bootstrap_node.js:149:9)
main-1 (err): at bootstrap_node.js:509:3
main-1 (err): /Users/amol/projects/cryptocurrency-arbitrage/main.js:73
main-1 (err): async function computePrices(data) {
main-1 (err): ^^^^^^^^
main-1 (err): SyntaxError: Unexpected token function
main-1 (err): at Object.exports.runInThisContext (vm.js:76:16)
main-1 (err): at Module._compile (module.js:542:28)
main-1 (err): at Object.Module._extensions..js (module.js:579:10)
main-1 (err): at Module.load (module.js:487:32)
main-1 (err): at tryModuleLoad (module.js:446:12)
main-1 (err): at Function.Module._load (module.js:438:3)
main-1 (err): at Module.runMain (module.js:604:10)
main-1 (err): at run (bootstrap_node.js:394:7)
main-1 (err): at startup (bootstrap_node.js:149:9)
main-1 (err): at bootstrap_node.js:509:3

Price for exchanges seems swapped

Hi,

In the image below, the price for the first line is:
Bittrex: 0.144mBTC
Poloniex: 0.152mBTC

and the price for the second line is the opposite:
Poloniex: 0.144mBTC
Bittrex: 0.152mBTC

image

I assume it's pulling the prices incorrectly. I haven't had a look yet at the source code but am willing to help out.

Love the idea and the look of the site Manu,

Tom

installing error

`npm ERR! Linux 4.4.0-45-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node main
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'node main'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the cryptocurrency-arbitrage package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node main
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs cryptocurrency-arbitrage
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls cryptocurrency-arbitrage
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/coin/cryptocurrency-arbitrage/npm-debug.log
`

i have 16.04 ubuntu version
the installation give me this
npm WARN optional Skipping failed optional dependency /chokidar/fsevents: npm WARN notsup Not compatible with your operating system or architecture: [email protected] npm WARN [email protected] license should be a valid SPDX license expression

Numbers never seem to match up

Am I using this wrong or are the numbers wrong? For example, EXP on bittrex to Poloniex shows 0.757 to 0.779. But in reality, the prices are currently 0.78 (bitrex) to 0.777(Poloniex). So not only are the numbers not accurate, but the wrong exchange is placed as the lower price. And this is pretty much the norm, not the exception for almost every time I look up the actual prices vs. what your site says they're currently at for whichever coin I look up. I just don't see where your numbers are coming from instead because they don't match up with the sell, buy, 24-high, 24-low prices in the charts either.

So either, I am totally using your site wrong, or something is really off with the way they are gathering the current prices on their respective markets.

Hosted nodejs instance stopped updating with live data after being on for a couple days

The hosted instance on azure for some weird reason started emitting old data via websockets. It was as expected emitting data every 10s, however the data it was emitting wasn't new (im pretty sure it was results from around 2 hours ago. I'm not sure if this is a bug in the code or a one off thing with azure. Maybe it's a setting on azure.

I fixed it that time by restarting the server, but I cant do that every time I have this problem. Anyone know what might be wrong?

Problems with getting data from Poloniex

Hi,
after starting parser it can't get data from Poloniex:

Error getting JSON response from https://poloniex.com/public?command=returnTicker SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse ()
at Request._callback (/opt/arbitrage/main.js:41:33)
at Request.self.callback (/opt/arbitrage/node_modules/request/request.js:186:22)
at Request.emit (events.js:159:13)
at Request. (/opt/arbitrage/node_modules/request/request.js:1163:10)
at Request.emit (events.js:159:13)
at IncomingMessage. (/opt/arbitrage/node_modules/request/request.js:1085:12)
at Object.onceWrapper (events.js:254:19)
at IncomingMessage.emit (events.js:164:20)
at endReadableNT (_stream_readable.js:1054:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

Getting data from other markets working fine.

BTC is currently not being displayed in results since it is always the neutral pair

Not sure what the best way to fix this is,

All cryptocurrency prices are converted to BTC - even BTC. Which means the price of 1BTC is always 1. Because of this you can't see any arbitrage opportunities for BTC.

Possible solutions;

  1. Convert every single cryptocurrency into the price of a fiat - most likely USD.
  2. only convert BTC to USD for every exchange.

Basically do we wantl prices to be in USD or in BTC?

Wrong price - read please

Hello
It is not the same as issue 18(#18), please read.
Generally you make great program, but still have some bugs, as I think.
1.
On markets where are no volume, spreads can be very big, and these spreads will kill all profit.
So if we want to buy on one exchange and sold on another, we need to check not buy_price on first exchange and sell_price on second, but sell_price on first and buy_price on second. Because sell_price will be our buy price and buy_price will be our sell price.
For example:
http://joxi.ru/8AnWlgvtqy9njr
On this printscreen we are going to buy on Cryptopia for 0.0163 and sell on Bittrex for 0.0236, but when will try to buy on Cryptopia you will see big spread
http://joxi.ru/Rmz5ydWcWMLJ0r
And you will buy for the first sell_price, on this printscreen it is 0.00002292.
2.
http://joxi.ru/vAWM8Q0tkOxlZm
In my opinion you need to change this two prices, because Cryptopia have price 0.0163 and Bittrex 0.0236.
Why there are contrariwise?

Thank you.

Option to manually remove a price difference pair

The trading of some cryptocurrencies is paused on some websites, so some invalid trade opportunities are generated based on old data, e.g., UNB: Cryptopia -> Bittrex. It would be useful to have an option to manually remove a pairing from the listing.

npm start error - gil-dev branch

Has anyone successfully installed and run the gil-dev branch to take care of the bid/ask price instead if the latest_price. I installed the latest nodejs V9.4.0 and get the following error: (I would appreciate any pointers on this)
+++++++++++++++++
D:\Bitcoin\arb\main.js:164
})
^
SyntaxError: Unexpected token )
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:599:28)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node main
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Jannie\AppData\Roaming\npm-cache_logs\2018-01-19T04_43_31
_878Z-debug.log

D:\Bitcoin\arb>
+++++++++++++++++

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.