Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
bmino committed May 18, 2020
2 parents e297557 + d8fb18d commit b5c42ae
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 73 deletions.
163 changes: 111 additions & 52 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "binance-triangle-arbitrage",
"version": "5.2.7",
"version": "5.3.0",
"repository": {
"type": "git",
"url": "https://github.com/bmino/binance-triangle-arbitrage.git"
Expand All @@ -9,17 +9,17 @@
"name": "Brandon Mino"
},
"engines": {
"node": "12.14.1",
"npm": "6.13.6"
"node": "12.16.3",
"npm": "6.14.5"
},
"scripts": {
"start": "node src/main/Main.js"
},
"dependencies": {
"blessed": "^0.1.81",
"node-binance-api": "^0.10.3",
"pino": "^5.17.0",
"pino-pretty": "^3.6.1"
"node-binance-api": "^0.11.4",
"pino": "^6.2.1",
"pino-pretty": "^4.0.0"
},
"license": "MIT"
}
11 changes: 10 additions & 1 deletion src/main/BinanceApi.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const CONFIG = require('../../config/config');
const logger = require('./Loggers');
const binance = require('node-binance-api')();
const binance = require('node-binance-api')({
APIKEY: CONFIG.KEYS.API,
APISECRET: CONFIG.KEYS.SECRET,
test: !CONFIG.TRADING.ENABLED
});

const BinanceApi = {

Expand Down Expand Up @@ -95,6 +100,10 @@ const BinanceApi = {
sortDepthCache(ticker, depth) {
depth.bids = binance.sortBids(depth.bids);
depth.asks = binance.sortAsks(depth.asks);
},

depthCache(ticker) {
return binance.depthCache(ticker);
}

};
Expand Down
6 changes: 5 additions & 1 deletion src/main/Loggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ const PINO_OPTS = {
level: CONFIG.LOG.LEVEL.toLowerCase(),
timestamp: () => `,"time":"${new Date().toLocaleString()}"`,
prettyPrint: CONFIG.LOG.PRETTY_PRINT,
useLevelLabels: true,
formatters: {
level: (label, number) => {
return { level: number }
}
},
base: null
};

Expand Down
11 changes: 2 additions & 9 deletions src/main/Main.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
const CONFIG = require('../../config/config');
const logger = require('./Loggers');
const binance = require('node-binance-api')();
const os = require('os');
const BinanceApi = require('./BinanceApi');
const MarketCache = require('./MarketCache');
const HUD = require('./HUD');
const BinanceApi = require('./BinanceApi');
const ArbitrageExecution = require('./ArbitrageExecution');
const CalculationNode = require('./CalculationNode');
const SpeedTest = require('./SpeedTest');

binance.options({
APIKEY: CONFIG.KEYS.API,
APISECRET: CONFIG.KEYS.SECRET,
test: !CONFIG.TRADING.ENABLED
});

// Helps identify application startup
logger.execution.info(logger.LINE);
logger.performance.info(logger.LINE);
Expand All @@ -23,7 +16,7 @@ if (CONFIG.TRADING.ENABLED) console.log(`WARNING! Order execution is enabled!\n`

SpeedTest.multiPing()
.then((pings) => {
const msg = `Successfully pinged the Binance api in ${(binance.sum(pings) / pings.length).toFixed(0)} ms`;
const msg = `Successfully pinged Binance in ${(pings.reduce((a,b) => a+b, 0) / pings.length).toFixed(0)} ms`;
console.log(msg);
logger.performance.info(msg);
})
Expand Down
Loading

0 comments on commit b5c42ae

Please sign in to comment.