Coder Social home page Coder Social logo

aloysius-pgast / crypto-exchanges-gateway Goto Github PK

View Code? Open in Web Editor NEW
583.0 46.0 152.0 3.44 MB

Your gateway to the world of crypto !

JavaScript 86.60% Shell 0.40% HTML 0.72% CSS 0.05% Dockerfile 0.11% SCSS 12.01% EJS 0.12%
trading exchanges cryptocurrency bittrex binance poloniex kucoin okex api

crypto-exchanges-gateway's People

Contributors

aloysius-pgast avatar dependabot[bot] avatar lolero avatar smogili1 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

crypto-exchanges-gateway's Issues

Tiny issue of the doc

Just a tiny issue of the doc/pushover/notificaiton.adoc. Is 'message' in below table a mandatory parameter rather than a column title?
image

one click withdrawal on balance page

A cool feature is one click withdrawal on balance page, for example you click on XRP and sends the XRP from Binance to Poloniex, it would be cool to cross the coins from exchange to another with just one click.

Timestamp Binance

Hi,

Thank you for this awesome tool..it is looking very promising!

Do you know how I can fix this timestamp issue I am getting with Binance please?

My timezone is CEST..

1507337786396|ERROR|{"exchange":"binance","api":"allOrders","pair":"BTC-CTR"} => {"code":-1021,"msg":"Timestamp for this request is not valid."}

Binance stopped working

Team,
I have installed the developer version and it was working fine, but now binance stopped working, bittrex and poloniex are still working properly, any suggestions?
Thanks

Could not query exchange for pair

I am getting a lot of the following warnings:

|WARN| Could not query exchange for pair <pair key> (might be an invalid pair) : err = 'There was an error invoking Hub method 'c2.queryexchangestate'.'

They happen after the gateway has already been able to subscribe to the pairs so I already have valid data. The problem is the data that I have received and think is currently valid is outdated.

Do you have an idea of why this is happening or how to fix it?

Would it be possible to emit a notification on the websocket to let the subscribed party know that the gateway is not able to query the exchange for that pair until updated data starts flowing again?

Support Websocket

Hello,

Nice project. I think this has great potential. Putting everything in one place really simplifies the development process.

In the future, can you please also enable websockets for orderbook updates? I know node.bittrex.api has good support for it. For a working example, please take a look at my code: https://github.com/rickyhan/bittrex-orderbook-importer

multi user support

you login on web access, and UI loads from a different JSON FILE, i think it should be very easy to made. very useful at least to me, i can have different accounts (API) and i can access through a login.

consolidated balance feature

Hello, a cool feature is to consolidate all your balance on the different exchanges, so if you want to buy XRP you have a buying power of 3 BTC (the total BTC amount on Bittrex, Binance, Poloniex), and you buy XRP in all of them at once.
You can put buy orders at once from one single click.
Better to manage "coins" than managing Exchanges.

Install issue

Hey there,
Im trying to get the gateway running im running into an error it says something like this:

/home/usr/Downloads/crypto-exchanges-gateway-master/app/default-ccxt-client.js: 44
this.ccxt = new ccxtccxtExchangeId;

TypeError: ccxt[ccxtExchangeId] is not a constructor

I am just starting to breach more complicated codes such as this one, could someone help me?

support for all open orders

What a cool project, congratulations.
i want to have the feature to watch all the open orders besides starred pairs and also support for BNB pairs on binance.
best regards.

MaxListenersExceededWarning

Hello,
I'm trying using this interestng gateway. I'm using just Binance and I'm interested to WS klines only at the moment.
When my bot start using some pairs and, for every pairs, 3 or 4 timeframes I get this from the gateway log (with less combinations no warning at the moment):

(node:4383) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ticker listeners added. Use emitter.setMaxListeners() to increase limit (node:4383) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 orderBook listeners added. Use emitter.setMaxListeners() to increase limit (node:4383) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 orderBookUpdate listeners added. Use emitter.setMaxListeners() to increase limit (node:4383) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 trades listeners added. Use emitter.setMaxListeners() to increase limit (node:4383) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 kline listeners added. Use emitter.setMaxListeners() to increase limit

Threre is something that I can set on configuration to avoid eventual problem of leak memory?

Thanks in advance

New Orders Giving Invalid Lot Size Error - Binance

When placing a buy or sell order on Binance I receive the error Invalid Lot Size. This doesn't happen on all pairs, only pairs in which the minimum order price has a minimum tick requirement.

On the Binance market ETH/TRX, the minimum price is 0.00000001, however on ETH/DGD, the minimum price is 0.00001. Since the crypto-exchanges-gateway defaults to including 8 ticks (decimals) on all pairs, Binance rejects orders with Invalid Lot Size if the pair has a minimum tick for the price.

calculate open orders value

to have a better total in the account, example i have 10 open orders with a market value of 0.10 ether, adding that to the balance as total value of holdings, like Poloniex have in the history page.

User Authentication

Is there a way to add user authentication or a password to lock down of the application? I would like to have so form of security that would allow me run the instance non-stop, is this possible?

dropdown of starred pairs on my trades

it would be cool to being able to select the starred pairs on my trades page, so you can check all your trades on example TRX/ETH without having to scroll all the trades below the open orders.

Setting ports on docker command does not work

I would like to use local ports other than 8000 and 8001 for the http and ws servers of the docker container.

But when I run docker run --rm -p 8100:8100 -p 8101:8101 --name ceg apendergast/crypto-exchanges-gateway, the container starts but prints the following on the console.

1586176403316|WARN|HTTP server is alive on *:8000
1586176403317|WARN|WS server is alive on *:8001

multi language UI?

Hello, i speak spanish, it would be cool to being able to select a different language on the UI.

save UI user settings

hi aloysius-pgast,
great gateway you have here. Cool project and would like to see it evolve.
I gave it a try and have a question:
I used docker+kinematic to run the UI website. Is there a way to store user settings so that when I restart the kinematic instance, I don't have to do it all over again?
User settings to be stored would be for example:

  • favorite crypto pairs
  • chart settings & added indicators

thanks!

Crypto Portfolio add-on

Team,
Is it possible to add a portfolio that display your holdings with profits/losses with trends for the coin purchased or sold.
Thanks

Bug in your websocket connection file + a few fixes

Line 182 websocket connection.js file

                   let interval = setInterval(function () {
                            if (WebSocket.OPEN != _ws.readyState) {
                                clearTimeout(interval);
                                return;
                            }
                            if (!_ws.isAlive) {
                                if (debug.enabled) {
                                    debug("WS (%s) timeout : timeout = %d", self._uri, self._pingTimeout);
                                }
                                _ws.terminate();
                                clearTimeout(interval);
                                return;
                            }
                            _ws.isAlive = false;
                            if (debug.enabled) {
                                debug("Sending WS PING (%s)", self._uri);
                            }
                            _ws.ping('', true, true);
                        }, self._pingTimeout);

You are calling setInterval but you are calling clearTimeout which may or may not be compatible all the time
A few questions

  • What is the purpose of this? ignoreCloseEvent, you are setting it to true in the constructor and finalize but setting it to false inside open callback. The only purpose I see is when the close event is fired, you are checking if you should ignore it and return prematurely, when would you ever enter that if statement?

  • Also why do we need to skipCloseEvent

  • No need to add doRetry either :)

  • Another thing you might wanna consider is doing a noop ping instead of the true you are sending currently, seems to be standard practice https://github.com/jaggedsoft/node-binance-api/blob/master/node-binance-api.js#L285

  • Also can you replace your function callbacks with arrow functions, it will replace all the self=this calls

Okex doesn't work

Hi, I have all exchanges working except Okex. Do you also have the same problem? Below is my environment:

  • Docker on windows server 2019
  • Okex 'key', 'secrete' and 'password' are set through environment variables

In UI, under Okex exchange:

  • 'My balances' shows nothing.
  • 'New order' pops up error messagebox with text '[object object]'.

enable tradingview widget draw toolbar

Would be great if you could enable the tradingview widget draw toolbar.

If you agree, you can add this option:
"hide_side_toolbar": false,

to:

new TradingView.widget({

in file ui/src/components/CandleSticks/CandleSticks.js

Looking to autosell BTC/ETH

Hi,

I am looking to auto sell any btc or ether thats been sent into our binance account is this possible with this script?

In Localhost installation, can only view "prices", & Order Books

Hi - First of all, this is wonderful piece of work, thanks for extending it to community. I have gone through the installation instructions & did setup in my ubuntu machine(localhost), went fine with no errors, Was able to build UI & triggered it. But in UI, i can only view "order books" & "Prices" in all exchanges, not more than that. Where as in Demo Link, I can see we have many other options such as "New Order", "My Order", "MY balances"

Thanks,
Lokesh

Crypto-exchange : dummy ethers

I'm currently working on this project...I need to add some new features to it..how can I use dummy ethers to do a transaction?

blocking call WS RPC subscribeToKlines

Hello

I've tried as you suggested the RPC connection but I after calling client.subscribeToKlines(this.exchange, [symbolNormalized], timeframe) nothing more happens, it seems blocked.
This is the code,

// connection to gateway was lost (reconnection will be automatic)
this.client.on('disconnected', (data) => {
	log.info(`We've been disconnected : ${JSON.stringify(data)} [reconnection will be automatic]`);
});
this.client.on('ready', (data) => {
	log.info(`Ready to subscribe : ${JSON.stringify(data)}`);
	for (let symbol of this.symbols) {
		const symbolNormalized = stringUtils.getSymbolForExchange(symbol, 'ceg')
		for (let timeframe of this.timeframes) {
			log.info(`Subscribing to ${symbolNormalized} for ${timeframe}...`)
			client.subscribeToKlines(this.exchange, [symbolNormalized], timeframe);
		}
	}
});
this.client.on('kline', (data) => {
	log.debug('WS CEG MSG:' + data);
	const datajson = JSON.parse(data)
	if (datajson && datajson.d) {
		if (datajson.d.data.closed === false) {
			log.debug('WS CEG data but NOT closed Candle')
		}
		if (datajson.d.data.closed === true) {
			log.info('WS CEG of CLOSED Candle:' + datajson)
			//const pairReversed = stringUtils.getSymbolForExchange(symbol, 'ceg')
			const evt_name = 'candle_' + _this.symbols + '-' + datajson.d.interval
			// adding data interval/timeframe to data candle
			datajson.d.data['timeframe'] = datajson.d.interval
			log.info(_this.symbols + ' - CANDLE close:' + JSON.stringify(datajson.d.data + ' emitting event candle:' + evt_name));
			vorpal.log(_this.symbols + ' - CANDLE close:' + JSON.stringify(datajson.d.data + ' emitting event candle:' + evt_name));
			_this.emit(evt_name, datajson.d.data);
		}
	}
});

On log I can see just:

2019-09-07T21:09:24.433Z info: We've been disconnected : {"connectionId":1,"code":1006,"reason":""} [reconnection will be automatic]
2019-09-07T21:09:38.424Z info: We connected/reconnected : {"connectionId":2}

I tried with two pairs and timeframes: BTC/USDT ETH/USDT and timeframes 1m 5m
But It's blocked to the first subscribing.
I tried switching to the gateway to develop branch as suggested on the client README but not too much differences

Have a suggestion? Thanks!

Question: WS kline or polling history candles?

Hello,

Just a question regarding the best approach on getting data form crypto exchange gateway.
My need is to get just close candles and when a new candle (close) trigger a stragegy is applied to the candles. I want to monitor some pairs (10-15) with different timeframes (3-4).
Is there sense to listen to WS RPC klines, currently discarding data for not closed klines, for higher timeframes?
1d o 1w or why not 1m ...maybe there is no sense to use websocket in this case, isn't it?
Above all because there could be disconnections ..and for 1w candles, for example, I could lose the closing data.
Maybe in this scenario WS is good for timeframes till 1d?

Thanks for your eventual suggestions

bnb pairs

hello, i can't see any BNB pair, what i am doing wrong? I need VEN-BNB etc.

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.