GithubHelp home page GithubHelp logo

bmino / binance-triangle-arbitrage Goto Github PK

View Code? Open in Web Editor NEW
1.1K 72.0 336.0 702 KB

Detect in-market cryptocurrency arbitrage

License: MIT License

JavaScript 100.00%
javascript binance binance-api binance-crytpocurrency-exchange cryptocurrency arbitrage arbitrage-bot nodejs triangle-arbitrage crypto

binance-triangle-arbitrage's People

Contributors

bmino avatar mino-brandon 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

binance-triangle-arbitrage's Issues

Mirrored Order Execution Loss

I have been testing this project for a week, and first I had the following error "Account has insufficient balance for requested action", then I implemented method to apply the rates, and worked, but did not make a profit:
{"level":"info","time":"2019-3-15 00:33:37","msg":"Buying 0.408000000000 ETHBTC @ market price","v":1}
{"level":"info","time":"2019-3-15 00:33:38","msg":"Buying 15409.000000000000 STORMETH @ market price","v":1}
{"level":"info","time":"2019-3-15 00:33:38","msg":"Selling 15409 STORMBTC @ market price","v":1}
{"level":"info","time":"2019-3-15 00:33:39","msg":"15409","v":1}
{"level":"info","time":"2019-3-15 00:33:39","msg":"[object Object]","v":1}
{"level":"info","time":"2019-3-15 00:33:39","msg":"Executed BTC-ETH-STORM position in 1616 ms","v":1}
{"level":"info","time":"2019-3-15 00:33:39","msg":"BTC delta: -0.0000997800000000007","v":1}
{"level":"info","time":"2019-3-15 00:33:39","msg":"ETH delta: 0.00057895","v":1}
{"level":"info","time":"2019-3-15 00:33:39","msg":"BNB delta: -0.008126319999999992","v":1}
{"level":"error","time":"2019-3-15 00:33:40","msg":"Cannot exceed execution cap of 1 execution","v":1}

I would like to know if you have had reports of someone who has made a profit from this system, and if so, what configurations the person used, since I can not do it, I know about the issue of runtime, so I wonder if anyone could find one configuration that can make profit, thank you.

JavaScript heap out of memory

The program crashes with this error after running for a prolonged period of time:

<--- Last few GCs --->

[3570:0x3b24b80]  3363864 ms: Mark-sweep 1326.5 (1577.0) -> 1326.5 (1577.5) MB, 1142.6 / 0.1 ms  allocation failure GC in old space requested
[3570:0x3b24b80]  3364776 ms: Mark-sweep 1326.5 (1577.5) -> 1326.4 (1478.5) MB, 911.2 / 0.0 ms  last resort GC in old space requested
[3570:0x3b24b80]  3365795 ms: Mark-sweep 1326.4 (1478.5) -> 1326.4 (1446.5) MB, 1019.0 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x1cb9778a55e9 <JSObject>

    1: depthData(aka depthData) [/home/brandon/github/binance-triangle-arbitrage/node_modules/node-binance-api/node-binance-api.js:~666] [pc=0x14a07df7cea8](this=0x510273822d1 <undefined>,data=0x2a92f1411ff1 <Object map = 0x21fa18bbf191>)
    2: /* anonymous */(aka /* anonymous */) [/home/brandon/github/binance-triangle-arbitrage/node_modules/node-binance-api/node-binance-api.js:1673] [bytecode=...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Error when npm start. Error: Cannot find module '../../config/live.config'

(peregrine) ytigiev@instance-1:~/binance-triangle-arbitrage$ npm start

[email protected] start /home/ytigiev/binance-triangle-arbitrage
node src/main/Main.js

internal/modules/cjs/loader.js:583
throw err;
^

Error: Cannot find module '../../config/live.config'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (/home/ytigiev/binance-triangle-arbitrage/src/main/ArbDisplay.js:2:16)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node src/main/Main.js
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 logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/ytigiev/.npm/_logs/2019-01-05T17_03_14_193Z-debug.log
(peregrine) ytigiev@instance-1:~/binance-triangle-arbitrage$

Explanation of config / extending logging

Hi,

I do have a few questions regarding the values in the config.

 INVESTMENT: {
    // Symbol which all triangle trades must start and end with
    BASE: 'BTC',
    MIN: 0.0,
    MAX: 0.15,
    STEP: 0.001
},

The MIN and MAX settings, are only regarding the base currency and the first trade from A (BTC in that case) to B?
That means, the bot is looking to use between 0 and 0.15BTC to buy any altcoin. Afterwards, those settings do not matter anymore, as it is tried to always trade all of B into C and all of C into A again, correct?

// Parallel: all three legs of the triangle arbitrage are executed in parallel
EXECUTION_STRATEGY: 'Parallel',

Does that mean, that it is tried to trade
A to B
B to C
C to A

at the very same time? I assume this would require me to have a balance of B and C already, before that trade is initiated?


Could you extend the logging into the execution.log with additions like:

Found profitable trade: BTC-ADA-BNB, expecting 2.00% profit
Used 0.023BTC to trade into 40 ADA: successful
Used 35 ADA to trade into 3 BNB: successful. 5 ADA could not be traded ({ORDERBOOK not sufficient or other reason named}), left to dust. Is tried to be picked up in next ADA trade.
Used 3 BNB to trade into 0.0235 BTC: successful: 2.17% Profit.

This makes it much clearer, what happened in the background and makes the trades much more comprehensible.

In addition, could you convert the unix timestamp into a human readable one, like UTC time?

{"level":"info","time":1549415784366,"msg":"Buying 4.42 EOSTUSD @ market price","v":1}

->

{"level":"info","time":02/06/2019 @ 1:16am (UTC),"msg":"Buying 4.42 EOSTUSD @ market price","v":1}

Cheers.

throw er; // Unhandled 'error' event

Hi!, thanks for sharing your proyect.

(I`m not a developer)

After edit the config.js, and set the API+KEY used to appears an error,

KEYS: {
API: undefined,
SECRET: undefined
},

I manage to figured out to solve it, I think, with the apostrophe enclosing the API and KEY, this problem is solved,

KEYS: {
API: 'XXXXXXXXXX',
SECRET: 'XXXXXXXX'
},

but later this error appears


WARNING! Order execution is enabled!
events.js:183
throw er; // Unhandled 'error' event


Any help would be apreciated.
Thanks in advance!

Request to add quantity

Hello. I would like to ask you to add a quantity parameter in the HUD in order to be able to filter arbitration with a small trade volume.Thank you!

Nothing happens

Hi,

Nothing happen, I executed the code on Git bash (windows), npm version 6.7, node version 11.8

1

2

My conf :

{

"KEYS": {
    "API": "xxx",
    "SECRET": "xxx"
},

"INVESTMENT": {
    "BASE": "BTC",
    "MIN": 0.011,
    "MAX": 0.018,
    "STEP": 0.005
},

"TRADING": {
    "ENABLED": false,
    "EXECUTION_STRATEGY": "parallel",
    "EXECUTION_CAP": 1,
    "PROFIT_THRESHOLD": 0.3,
    "AGE_THRESHOLD": 300,
    "WHITELIST": ["BTC","ETH","BNB","USDT","EOS"]
},

"HUD": {
    "ENABLED": true,
    "ARB_COUNT": 10
},

"LOG": {
    "LEVEL": "info",
    "PRETTY_PRINT": true
},

"DEPTH": {
    "SIZE": 50,
    "INITIALIZATION_INTERVAL": 50
},

"CALCULATION_COOLDOWN": 100

}

There is nothing in the logs in info mode.

Log in debug mode :

["2019-4-14 12:16:15"] DEBUG: Operating System: Windows_NT
["2019-4-14 12:16:15"] DEBUG: Cores Speeds: [3500,3500,3500,3500,3500,3500,3500,3500] MHz
["2019-4-14 12:16:19"] DEBUG: Completed 12/12 (100.0%) calculations in 2 ms
["2019-4-14 12:16:19"] DEBUG: Completed 12/12 (100.0%) calculations in 1 ms
["2019-4-14 12:16:19"] DEBUG: Completed 12/12 (100.0%) calculations in 1 ms
["2019-4-14 12:16:19"] DEBUG: Completed 12/12 (100.0%) calculations in 1 ms
["2019-4-14 12:16:19"] DEBUG: Completed 12/12 (100.0%) calculations in 1 ms
...

Thanks for your help

order stuck

hello , i running the execute branch , and using btc for trade , and the bot use btc buy eth and use eth buy altcoin and no sell it to btc , hope you can solve it , Thanks!

Config coins exclusion

If I would like to add some coins to be excluded of the triangular arbitrage, where do you think it would be the best place to perform that exclusion?

Thanks

Cannot read property '0' of undefined

hello i got this error after "npm start"

WARNING! Order execution is enabled!

Successfully pinged the Binance api in 593 ms
Found 461/502 currently trading tickers
TypeError: Cannot read property '0' of undefined
at Object.createTrade (PATH\src\main\MarketCache.js:66:46)
at MarketCache.symbols.forEach.symbol3 (PATH\src\main\MarketCache.js:56:43)
at Set.forEach ()
at MarketCache.symbols.forEach.symbol2 (PATH\src\main\MarketCache.js:55:33)
at Set.forEach ()
at Object.getTradesFromSymbol (PATH\src\main\MarketCache.js:54:29)
at Object.initialize (PATH\src\main\MarketCache.js:31:49)
at ArbitrageExecution.refreshBalances.then.then.then.then.exchangeInfo (PATH\src\main\Main.js:24:39)
at
a

triangle is cant be completed

execution.log :
["2019-3-19 04:26:03"] �[32mINFO �[39m: �[36mBuying 55.555 SKYBTC @ market price�[39m ["2019-3-19 04:26:04"] �[32mINFO �[39m: �[36mSelling 55.555 SKYETH @ market price�[39m ["2019-3-19 04:26:04"] �[31mERROR�[39m: �[36mAccount has insufficient balance for requested action.�[39m ["2019-3-19 04:26:05"] �[32mINFO �[39m: �[36mBTC delta: -0.015064409999999999�[39m ["2019-3-19 04:26:05"] �[32mINFO �[39m: �[36mSKY delta: 55.499445�[39m ["2019-3-19 04:50:36"] �[31mERROR�[39m: �[36mCannot exceed execution cap of 1 execution�[39m

API key

Hello,

In which file can I set-up the secret key? Could you provide an example?

HUD error

When I enter npm start, I see this error:
(my npm is 6.7.0 and node is 11.8.0)

> [email protected] start /Users/tom_ryzhkov/Desktop/binance-triangle-arbitrage-master
> node src/main/Main.js

Found 440/468 currently trading tickers.
Checking configuration ...
Opening 440 depth websockets ...

Execution Strategy:     linear
Optimization Ticks:     4
Execution Limit:        1 execution(s)
Profit Threshold:       0.30%
Age Threshold:          300 ms
Log Level:              info

TypeError: Cannot read property 'a' of undefined
    at arbs.forEach.arb (/Users/tom_ryzhkov/Desktop/binance-triangle-arbitrage-master/src/main/HUD.js:50:31)
    at Array.forEach (<anonymous>)
    at Object.displayArbs (/Users/tom_ryzhkov/Desktop/binance-triangle-arbitrage-master/src/main/HUD.js:48:14)
    at refreshHUD (/Users/tom_ryzhkov/Desktop/binance-triangle-arbitrage-master/src/main/Main.js:137:9)
    at Timeout.calculateArbitrage [as _onTimeout] (/Users/tom_ryzhkov/Desktop/binance-triangle-arbitrage-master/src/main/Main.js:78:29)
    at listOnTimeout (timers.js:324:15)
    at processTimers (timers.js:268:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node src/main/Main.js`
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 logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/tom_ryzhkov/.npm/_logs/2019-02-17T12_27_24_016Z-debug.log

What could be the problem?
Thanks.

Timestamp for this request was 1000ms ahead of the server's time

caseless:
Caseless {
dict:
{ 'content-type': 'application/json;charset=utf-8',
'transfer-encoding': 'chunked',
connection: 'close',
date: 'Sat, 27 Apr 2019 16:04:19 GMT',
server: 'nginx',
'x-mbx-used-weight': '5',
'strict-transport-security': 'max-age=31536000; includeSubdomains',
'x-frame-options': 'SAMEORIGIN',
'x-xss-protection': '1; mode=block',
'x-content-type-options': 'nosniff',
'content-security-policy': "default-src 'self'",
'x-content-security-policy': "default-src 'self'",
'x-webkit-csp': "default-src 'self'",
'cache-control': 'no-cache, no-store, must-revalidate',
pragma: 'no-cache',
expires: '0',
'x-cache': 'Error from cloudfront',
via:
'1.1 b3229c68bc96ea68371695efdc615317.cloudfront.net (CloudFront)',
'x-amz-cf-id': '6ZN6xzHzS2z0CqYUSoLeymcLKSwx3pEd3xRfZSbcorGHjvTK8daGJg==' } },
body:
{"code":-1021,"msg":"Timestamp for this request was 1000ms ahead of the server's time."} }

Error when npm start

Hi,

I use Mac
nmp 6.4.1
node 10.5.0

I run npm install ==> OK
But, when I run npm start ==> Error

Querying exchangeInfo
TypeError: Cannot read property 'indexOf' of undefined
at /Users/admin/Documents/Binance/binance-triangle-arbitrage-3.5.2/src/main/Main.js:25:75
at Array.forEach ()
at BinanceApi.exchangeInfo.then (/Users/admin/Documents/Binance/binance-triangle-arbitrage-3.5.2/src/main/Main.js:22:22)
at process.internalTickCallback (internal/process/next_tick.js:77:7)

Could you help me fix this bug?

Layman's Terms

How does one download and run the arbitrage bot? I am not a computer programmer and have no background in any of this language or these terms. Are there instructions for LAY PEOPLE? I have a MacBook, not sure if it makes a difference.

"Installing Prerequisites
The following dependencies are required to run an instance:
NodeJS
Npm
Install NodeJS and npm
brew install node"

HUH? I have zero clue what any of the above means.

Click this
Copy this
Download this
Paste this
Etc.. Is what I'm looking for.

support for auto triangular arbitrage

Hello Dear, if this project can do :
fully automatic monitoring and auto multiply total amount of btc(binance minimum order limit is 0.001 Btc) and auto order 3 or more profit road(after calc the higher profit of triangular arbitrage pair like :
road1 :BTC-XX1-ETH-BTC 0.02% profit
road2 : BTC-XX2-ETH-BTC 0.018% profit
road3 : BTC-XX3-BNB-BTC 0.011% profit ) on few second and 24/7. running without problem or crash , i will donate 0.005-0.01 BTC , Hope someone can do this work , Thanks You !

Job Pool Undefined Calculation

A job should either terminate by throwing an error (insufficient depth) or by returning a calculation.

The "done" callback is currently receiving an undefined amount instead of a calculation

its not buy or sell on lineer

seems : ["2019-3-27 23:31:41"] �[31mERROR�[39m: �[36mlineer is an invalid execution strategy�[39m ["2019-3-28 00:18:33"] �[32mINFO �[39m: �[36mTest: Buying 0.291 ETHBTC @ market price�[39m ["2019-3-28 00:18:34"] �[32mINFO �[39m: �[36mTest: Buying 1758 MTHETH @ market price�[39m ["2019-3-28 00:18:34"] �[32mINFO �[39m: �[36mTest: Selling 1758 MTHBTC @ market price�[39m ["2019-3-28 00:18:35"] �[32mINFO �[39m: �[36mTest: Executed BTC-ETH-MTH position in 1478 ms�[39m ["2019-3-28 00:46:33"] �[31mERROR�[39m: �[36mCannot exceed execution cap of 1 execution�[39m ["2019-3-28 02:30:41"] �[32mINFO �[39m: �[36mTest: Buying 830 BCPTBTC @ market price�[39m ["2019-3-28 02:30:41"] �[32mINFO �[39m: �[36mTest: Selling 830 BCPTETH @ market price�[39m ["2019-3-28 02:30:42"] �[32mINFO �[39m: �[36mTest: Selling 0.291 ETHBTC @ market price�[39m ["2019-3-28 02:30:42"] �[32mINFO �[39m: �[36mTest: Executed BTC-BCPT-ETH position in 1394 ms�[39m ["2019-3-28 03:18:33"] �[31mERROR�[39m: �[36mCannot exceed execution cap of 1 execution�[39m

Too Many Trades Per Second

Hello. While working with parallel execution. I have come upon a brick wall that is Binance limits.
With low profit settings and calculations you're able to execute more than 10 trades per second.
Is there a way to move the limit from 10 to 9 ? So they would finish how they started.

Orders Not Filled

When the script initiates the first BUY/SELL or last BUY/SELL orders might not be completely filled. That may or may not lead to the orders getting stuck, it depends on whether the program accounts for it.

Total here supposed to be 0.01 as in MAX
Screen Shot 2019-03-26 at 12 05 50

Total here supposed to be 45 as in MAX
Screen Shot 2019-03-26 at 12 06 11

Is there a way to let it overBuy and finish the triangle rather than underBuy?
Or somehow account for it when executing the trades?

about parallel arb

Watching 2 relationship(s) is not sufficient to engage in triangle arbitrage

    "INVESTMENT": {
        "BASE": "BTC",
        "MIN": 0.005,
        "MAX": 0.013,
        "STEP": 0.005
    },

    "TRADING": {
        "ENABLED": true,
        "EXECUTION_STRATEGY": "parallel",
        "EXECUTION_CAP": 3,
        "PROFIT_THRESHOLD": 0.3,
        "AGE_THRESHOLD": 300,
        "WHITELIST": ["BTC", "ETH", "BNB"]
    },

whats wrong with me

Its buys ARDR coin :S

Its buys ARDR coin, and not even sold on the stock market. I guess I'm gonna stop testing now.

The triangle cannot be completed.

The first operation is done when the transaction is captured, but the second operation is stuck because it does not expect the first operation to end.

Sell at loss with release 5.0

Hi,

With the release 5.0 it sell at loss again:

["2019-4-15 22:41:56"] �[32mINFO �[39m: �[36mAttempting to execute BTC-GRS-ETH with an age of 122 ms and expected profit of 0.3556%�[39m
["2019-4-15 22:41:56"] �[32mINFO �[39m: �[36mBuying 542 GRSBTC @ market price�[39m
["2019-4-15 22:41:56"] �[32mINFO �[39m: �[36mSuccessfully bought 542.00000000 GRSBTC @ a quote of 0.04506730�[39m
["2019-4-15 22:41:56"] �[32mINFO �[39m: �[36mSelling 542 GRSETH @ market price�[39m
["2019-4-15 22:41:56"] �[32mINFO �[39m: �[36mSuccessfully sold 542.00000000 GRSETH @ a quote of 1.40538142�[39m
["2019-4-15 22:41:56"] �[32mINFO �[39m: �[36mSelling 1.405 ETHBTC @ market price�[39m
["2019-4-15 22:41:57"] �[32mINFO �[39m: �[36mSuccessfully sold 1.40500000 ETHBTC @ a quote of 0.04474363�[39m
["2019-4-15 22:41:57"] �[32mINFO �[39m: �[36mExecuted BTC-GRS-ETH position in 880 ms�[39m
["2019-4-15 22:41:57"] �[32mINFO �[39m: �[36mBTC delta: -0.00032367 (-0.7182%)�[39m
["2019-4-15 22:41:57"] �[32mINFO �[39m: �[36mGRS delta: 0.00000000 ( 0.0000%)�[39m
["2019-4-15 22:41:57"] �[32mINFO �[39m: �[36mETH delta: 0.00038142 ( 0.0271%)�[39m
["2019-4-15 22:41:57"] �[32mINFO �[39m: �[36mBNB commission: -0.02655700�[39m
["2019-4-15 22:41:57"] �[32mINFO �[39m:
["2019-4-16 05:03:28"] �[32mINFO �[39m: �[36mAttempting to execute BTC-YOYO-BNB with an age of 52 ms and expected profit of 0.2862%�[39m
["2019-4-16 05:03:28"] �[32mINFO �[39m: �[36mBuying 8122 YOYOBTC @ market price�[39m
["2019-4-16 05:03:28"] �[32mINFO �[39m: �[36mSuccessfully bought 8122.00000000 YOYOBTC @ a quote of 0.04507710�[39m
["2019-4-16 05:03:28"] �[32mINFO �[39m: �[36mSelling 8122 YOYOBNB @ market price�[39m
["2019-4-16 05:03:28"] �[32mINFO �[39m: �[36mSuccessfully sold 8122.00000000 YOYOBNB @ a quote of 11.99619400�[39m
["2019-4-16 05:03:28"] �[32mINFO �[39m: �[36mSelling 11.99 BNBBTC @ market price�[39m
["2019-4-16 05:03:28"] �[32mINFO �[39m: �[36mSuccessfully sold 11.99000000 BNBBTC @ a quote of 0.04503444�[39m
["2019-4-16 05:03:28"] �[32mINFO �[39m: �[36mExecuted BTC-YOYO-BNB position in 903 ms�[39m
["2019-4-16 05:03:28"] �[32mINFO �[39m: �[36mBTC delta: -0.00004266 (-0.0946%)�[39m
["2019-4-16 05:03:28"] �[32mINFO �[39m: �[36mYOYO delta: 0.00000000 ( 0.0000%)�[39m
["2019-4-16 05:03:28"] �[32mINFO �[39m: �[36mBNB delta: 0.00619400 ( 0.0517%)�[39m
["2019-4-16 05:03:28"] �[32mINFO �[39m: �[36mBNB commission: -0.02701404�[39m

My conf

"INVESTMENT": {
"BASE": "BTC",
"MIN": 0.04,
"MAX": 0.05,
"STEP": 0.005
},

"TRADING": {
    "ENABLED": true,
    "EXECUTION_STRATEGY": "linear",
    "EXECUTION_TEMPLATE": ["BUY", "SELL", "SELL"],
    "EXECUTION_CAP": 10,
    "PROFIT_THRESHOLD": 0.28,
    "AGE_THRESHOLD": 300,
    "WHITELIST": [
    "xxx" 
    ]
},

"HUD": {
    "ENABLED": true,
    "ARB_COUNT": 5
},

"LOG": {
    "LEVEL": "info",
    "PRETTY_PRINT": true
},

"DEPTH": {
    "SIZE": 50,
    "INITIALIZATION_INTERVAL": 50
},

"CALCULATION_COOLDOWN": 100

}

Thanks for your help 👍

Triangle doesn't run full circle

Hello bmino. I can't help myself but feel like a customer at a restaurant who got three meals for free and now complaining because I didn't get a desert. So, let me say that this script is an absolute marvel. Especially at it's full potential.
I've run into an issue that I tried to deal with myself but couldn't. For some reason order execution stops after AB, sometimes even after BC, because it says there is no sufficient balance.

screen shot 2019-02-27 at 11 07 34

screen shot 2019-02-27 at 11 08 54

I made sure there is enough BNB for weeks. I tried changing AGE_THRESHOLD from min to max along with PROFIT_THRESHOLD. In my case EXECUTION_STRATEGY is linear and EXECUTION_CAP is 0. In addition STEPS ranged from 1 to 5, In the example above it was 1.
Also I know about Binance trading rule so I made sure there was always enough balance to meet the order requirements. I have been testing with BNB as a base and didn't seem to notice it having the same issue though.
Thank you.

Real Trading

Hello. Can it perform real trades? If yes, how? I did not find such setting in the conf. file.

Account has insufficient balance for requested action

Description:
This issue stems from the high latency it takes to execute three trades. The app can calculate profits in maybe 20ms, but then it takes almost 1000ms to execute the first trade and more time to execute the next two trades. By the time the first trade completes, too much time has passed and the market has shifted.

You can have market information that is 10ms old, and complete calculations in 20ms, but if it then takes 2500ms to execute the three trades, you are in a pickle :(

More Technical Description:
The bot calculates that with the current depth cache you should convert currency A into X amount of currency B and then X amount of currency B into Y amount of currency C, but by the time the first or second trade completes, that market depth cache information which the initial calculation was based on is stale so you can end up with less B or C than expected.

This error will occur when trying to perform the second or third leg of the triangle arbitrage.

Solutions:

  • Use the TRADING.EXECUTION_STRATEGY of "parallel"
  • Help me figure out a better alternative!

Although the rate of profit is 6.7, it is able to process losses. How do we get through this?

elta: -0.000430570000000019�[39m
["2019-3-2 07:31:55"] �[32mINFO �[39m: �[36mBNB delta: -1.0831205399999817�[39m
["2019-3-2 07:34:28"] �[32mINFO �[39m: �[36mBuying 116.26 BNBETH @ market price�[39m
["2019-3-2 07:34:28"] �[32mINFO �[39m: �[36mBuying 58.04 BNBBTC @ market price�[39m
["2019-3-2 07:34:28"] �[32mINFO �[39m: �[36mBuying 7995.8 BATBNB @ market price�[39m
["2019-3-2 07:34:28"] �[32mINFO �[39m: �[36mBuying 3991.7 BATBNB @ market price�[39m
["2019-3-2 07:34:29"] �[32mINFO �[39m: �[36mSelling 7995 BATETH @ market price�[39m
["2019-3-2 07:34:29"] �[32mINFO �[39m: �[36mSelling 3991 BATBTC @ market price�[39m
["2019-3-2 07:34:29"] �[32mINFO �[39m: �[36mExecuted ETH-BNB-BAT position in 1643 ms�[39m
["2019-3-2 07:34:29"] �[32mINFO �[39m: �[36mExecuted BTC-BNB-BAT position in 1676 ms�[39m
["2019-3-2 07:34:30"] �[32mINFO �[39m: �[36mBTC delta: -0.00023083999999995441�[39m
["2019-3-2 07:34:30"] �[32mINFO �[39m: �[36mETH delta: -0.05083829999999878�[39m
["2019-3-2 07:34:30"] �[32mINFO �[39m: �[36mBNB delta: -0.39297683000000916�[39m
["2019-3-2 07:34:30"] �[32mINFO �[39m: �[36mBAT delta: 1.5�[39m
["2019-3-2 07:34:30"] �[32mINFO �[39m: �[36mBTC delta: -0.00023083999999995441�[39m
["2019-3-2 07:34:30"] �[32mINFO �[39m: �[36mETH delta: -0.05083829999999878�[39m
["2019-3-2 07:34:30"] �[32mINFO �[39m: �[36mBNB delta: -0.39297683000000916�[39m
["2019-3-2 07:34:30"] �[32mINFO �[39m: �[36mBAT delta: 1.5�[39m
["2019-3-2 08:08:47"] �[32mINFO �[39m: �[36mBuying 4.962 ETHBTC @ market price�[39m
["2019-3-2 08:08:48"] �[32mINFO �[39m: �[36mBuying 3831 BATETH @ market price�[39m
["2019-3-2 08:08:48"] �[32mINFO �[39m: �[36mSelling 3831 BATBTC @ market price�[39m
["2019-3-2 08:08:49"] �[32mINFO �[39m: �[36mExecuted BTC-ETH-BAT position in 1796 ms�[39m
["2019-3-2 08:08:49"] �[32mINFO �[39m: �[36mBTC delta: 0.0003342199999999962�[39m
["2019-3-2 08:08:49"] �[32mINFO �[39m: �[36mETH delta: -0.018137150000001157�[39m
["2019-3-2 08:08:49"] �[32mINFO �[39m: �[36mBNB delta: -0.1342032599999925�[39m
["2019-3-2 09:19:23"] �[32mINFO �[39m: �[36mSelling 160 BNBBTC @ market price�[39m
["2019-3-2 09:19:24"] �[31mERROR�[39m: �[36mAccount has insufficient balance for requested action.�[39m

Trading Methods

Just a question about the two trading methods available

Linear - Three trades are executed sequentially with each being initiated after the first has completed
Parallel - Three trades are executed asynchronously with each being initiated at the same time

Isn't Linear the only way the arbitrage can work as the orders need to be run in order? such as AB to BC to CA

With parallel they are all executed at the same time. But wouldn't that mean you need at least some value in each asset?

Is the cause of Parallel trading more trades but at a higher risk?

Operations

Good Morning.

This robot does not do the operations, but it could be implemented perfectly.

In which section does it detect cryptocurrencies and indicates that there is a profit?

And the APIs where they connect?

I could implement the operations if it tells me where.

Thank you.

I get this whenever I ]$ npm run live

/home/jacob/binance-triangle-arbitrage/node_modules/node-binance-api/node-binance-api.js:1749
if (err) throw err;
^

Error: ESOCKETTIMEDOUT
at ClientRequest. (/home/jacob/binance-triangle-arbitrage/node_modules/request/request.js:812:19)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at ClientRequest.emit (events.js:208:7)
at TLSSocket.emitTimeout (_http_client.js:708:34)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at TLSSocket.emit (events.js:208:7)
at TLSSocket.Socket._onTimeout (net.js:407:8)
at ontimeout (timers.js:475:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] live: node src/main/Main.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] live script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/jacob/.npm/_logs/2018-07-21T03_44_46_226Z-debug.log

Profit Setting

Hi, thanks for development this arbitrage. As i am newbie in this app, i'd like to ask questions because i'm not clear about how this app will execute (buy-sell) in binance.

  1. I just tested and in profit i saw many - (minus) profit such as -0.119%,. Is it mean loss trading? is your app only execute profit pairs or loss also ?

  2. Is there any profit setting? so the app will only execute profit only after calculating 3 pairs. If loss then the app will not execute it.

Thanks for the answer, sorry for my bad english.

Regular error in quick-format-unescaped module

Congrats! Beautifully designed and executed module!
However, I regularly getting the following error. I realized that it is not in your module, but maybe you have an idea what caused it and how to get rid of it.
/home/ec2-user/arb/node_modules/quick-format-unescaped/index.js:31
var flen = f.length
^

TypeError: Cannot read property 'length' of undefined
at format (/home/ec2-user/arb/node_modules/quick-format-unescaped/index.js:31:16)
at Pino.LOG [as trace] (/home/ec2-user/arb/node_modules/pino/lib/tools.js:36:33)
at binance.marketBuy (/home/ec2-user/arb/src/main/BinanceApi.js:36:26)
at /home/ec2-user/arb/node_modules/node-binance-api/node-binance-api.js:279:27
at Request._callback (/home/ec2-user/arb/node_modules/node-binance-api/node-binance-api.js:110:16)
at Request.self.callback (/home/ec2-user/arb/node_modules/request/request.js:185:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request. (/home/ec2-user/arb/node_modules/request/request.js:1161:10)
at emitOne (events.js:116:13)

Balances are Not Tracked

After executing a trade, balance deltas are not being displayed.

This is caused by two variables being compared which are references instead of values.
initialBalance and this.balances are equivalent through their lifetime

Trade not executed

Hey there!

I just set up version 4.0 and wanted to try the order execution part, so my profit threshold is set as low as 0.025%

The HUD has shown multiple opportunities for several seconds that were above the set profit level, but no order has been executed.

Trading is enabled via the config file.

Do I have to specify anything more within the config to enable trading?

Execution log is empty.

Understanding the Log

Hi, bmino!

My ignorance is infinite, so first, sorry for the stupid questions.
I'm checking the bot with ETH (balance ETH 0.164 / BNB 0.012)

{"level":"info","time":"2019-2-7 21:32:01","msg":"Selling 0.13 ETHBTC @ market price","v":1}
{"level":"info","time":"2019-2-7 21:32:01","msg":"Buying 54 GRSBTC @ market price","v":1}
{"level":"info","time":"2019-2-7 21:32:02","msg":"Selling 54 GRSETH @ market price","v":1}
{"level":"info","time":"2019-2-7 21:32:02","msg":"Executed ETH-BTC-GRS position in 1485 ms","v":1}
^
Perfect execution.

{"level":"info","time":"2019-2-7 21:32:02","msg":"BTC delta: 0.000009249999999999994","v":1}
{"level":"info","time":"2019-2-7 21:32:02","msg":"ETH delta: -0.0003470799999999996","v":1}
{"level":"info","time":"2019-2-7 21:32:02","msg":"BNB delta: -0.00396709","v":1}
^
What it showed here?

{"level":"info","time":"2019-2-7 23:57:37","msg":"Buying 96 ADXETH @ market price","v":1}
{"level":"info","time":"2019-2-7 23:57:38","msg":"Selling 96 ADXBNB @ market price","v":1}
{"level":"info","time":"2019-2-7 23:57:38","msg":"Selling 1.79 BNBETH @ market price","v":1}
{"level":"error","time":"2019-2-7 23:57:39","msg":"Account has insufficient balance for requested action.","v":1}
^
This message is given by Binance right?, not enough to pay the fee?
I've check the trading rules of min amounts and meets all the minimal amounts.

BTW, there is a way to make Limit Orders instead of Market?

Thanks in advance

Other Exchange support

Hi!,

Could be an awesome addition to the proyect, the support of others exchange, like HitBTC. ;)

Thanks!

Error

npm ERR! Linux 4.15.0-23-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "live"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] live: node src/main/Main.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] live script 'node src/ma in/Main.js'.
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 binance-triangle-arbi trage package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node src/main/Main.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs binance-triangle-arbitrage
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls binance-triangle-arbitrage
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /root/binance-triangle-arbitrage/npm-debug.log

Why most profit is negative number

I think negative profit means the price within 3 currency has gap, Is that mean If we transform currency order, the profit will be positive?

screen shot 2018-07-03 at 11 33 49 am

Error: ETIMEDOUT

Hello,
I get this error when I run
npm run live on a ubuntu 18.04:

[email protected] live /home/pierre/Cryptos/binance-triangle
node src/main/Main.js

Querying exchangeInfo
Expect 38 seconds to open 375 depth websockets.
/home/pierre/Cryptos/binance-triangle/node_modules/node-binance-api/node-binance-api.js:1749
if (err) throw err;
^

Error: ETIMEDOUT
at Timeout._onTimeout (/home/pierre/Cryptos/binance-triangle/node_modules/request/request.js:845:19)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] live: node src/main/Main.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] live script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pierre/.npm/_logs/2018-08-15T20_25_58_372Z-debug.log

Firstly I didn't run brew install node because I already had nodeJS and npm installed. Then I brewed. Both configs give this results. My api keys are in the config file. Can it be a conflict between apt-get and brew ? I also had a message about something that is not in my path during the brewing, maybe it can impact ?
Thank you

Balance Deltas Are Not Updated

Observe how the deltas are the same unless that symbol was involved in the trade.

["2/14/2019, 9:28:43 AM"] INFO: Buying 2637 VIBEBTC @ market price
["2/14/2019, 9:28:43 AM"] INFO: Selling 2637 VIBEETH @ market price
["2/14/2019, 9:28:44 AM"] INFO: Selling 0.746 ETHBTC @ market price
["2/14/2019, 9:28:44 AM"] INFO: Executed BTC-VIBE-ETH position in 1169 ms
    ["2/14/2019, 9:28:44 AM"] INFO: BTC delta: 0.00013770999999999922
    ["2/14/2019, 9:28:44 AM"] INFO: ETH delta: -0.006983300000000026
    ["2/14/2019, 9:28:44 AM"] INFO: BNB delta: -0.02375869000000108



["2/14/2019, 12:40:07 PM"] INFO: Buying 2077 APPCBTC @ market price
["2/14/2019, 12:40:07 PM"] INFO: Selling 2077 APPCBNB @ market price
["2/14/2019, 12:40:08 PM"] INFO: Selling 14.74 BNBBTC @ market price
["2/14/2019, 12:40:08 PM"] INFO: Executed BTC-APPC-BNB position in 1366 ms
    ["2/14/2019, 12:40:09 PM"] INFO: BTC delta: 0.0003553199999999923
    ["2/14/2019, 12:40:09 PM"] INFO: ETH delta: -0.006983300000000026
    ["2/14/2019, 12:40:09 PM"] INFO: BNB delta: -0.1539243500000005



["2/14/2019, 12:41:57 PM"] INFO: Buying 888 APPCBTC @ market price
["2/14/2019, 12:41:57 PM"] �[31mERROR: Account has insufficient balance for requested action.
    ["2/14/2019, 12:41:58 PM"] INFO: BTC delta: 0.0003553199999999923
    ["2/14/2019, 12:41:58 PM"] INFO: ETH delta: -0.006983300000000026
    ["2/14/2019, 12:41:58 PM"] INFO: BNB delta: -0.1539243500000005



["2/14/2019, 3:20:03 PM"] INFO: Buying 10.31 BNBBTC @ market price
["2/14/2019, 3:20:03 PM"] INFO: Buying 733.8 AIONBNB @ market price
["2/14/2019, 3:20:03 PM"] INFO: Selling 733.8 AIONBTC @ market price
["2/14/2019, 3:20:04 PM"] INFO: Executed BTC-BNB-AION position in 1058 ms
    ["2/14/2019, 3:20:04 PM"] INFO: BTC delta: 0.0002897799999999895
    ["2/14/2019, 3:20:04 PM"] INFO: ETH delta: -0.006983300000000026
    ["2/14/2019, 3:20:04 PM"] INFO: BNB delta: -0.18529278000000104

Timeout Error

/home/desktop/node/binance-triangle-arbitrage/node_modules/node-binance-api/node-binance-api.js:1840
if (err) throw err;
^

Error: ETIMEDOUT
at Timeout._onTimeout (/home/desktop/node/binance-triangle-arbitrage/node_modules/request/request.js:849:19)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node src/main/Main.js
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 logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/desktop/.npm/_logs/2019-03-21T18_23_16_812Z-debug.log

I have not done anything else, just downloaded the latest source code, put the keys and installed.

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.