ccxws
ccxws copied to clipboard
Only Bitcoin works for trade websocket. Gateio alongside other exchanges do not
Hi, I'm daniel. Wonderful project you've got here, its just perfect!
One little problem though, when i listen for Binance trades, i get them come in. But on switching that to Gateio or any other exchange for that matter, the trades don't come in.
Steps:
$ mkdir testproject
$ cd testproject
$ npm init --yes
$ npm install ccxws
$ mkdir src
$ touch test.js
then I had the following code in test.js
const ccxws = require("ccxws");
const binance = new ccxws.Gateio();
// market could be from CCXT or genearted by the user
const market = {
id: "BTCUSDT", // remote_id used by the exchange
base: "BTC", // standardized base symbol for Bitcoin
quote: "USDT", // standardized quote symbol for Tether
};
// handle trade events
binance.on("trade", trade => console.log(trade));
// handle level2 orderbook snapshots
//binance.on("l2snapshot", snapshot => console.log(snapshot));
// subscribe to trades
binance.subscribeTrades(market);
// subscribe to level2 orderbook snapshots
binance.subscribeLevel2Snapshots(market);
then I ran
$ node src/test.js
in running that, i get no console logging for new trades, i waited a long time but got nothing. It just ran and did nothing.
I'll really appreciate your help on resolving this issue.
Much love from my behind my box here
You create Gate.io and subs to binance? )
@MidoMiddle , could you please clarify your question please, I really wanna answer but i'm not clear what you're asking.
btw, binance there is just a variable name, it doesn't affect the use of Gateio object
If you want subs on binance you must use tickers from binance. If gate - gate tickers. Tickers are different.
@MidoMiddle , thank you very much for your response. I really appreciate it. As much as i would love to pretend i understand your solution, i can't because i really need some clear pointer towards solving this issue. Can you, in your kindness provide a code or configuration or something that can practically point me towards a solution? Would really appreciate that.
Hi, can anyone please provide some help to me regarding this issue. I'm still not able to solve this yet and would really be grateful to anyone that can point me in the right direction. 🙏🙏 @MidoMiddle @jakebrown58 @jesseproudman @benoist
const binance = new ccxws.Gateio();
should be const binance = new ccxws.Binance();
or const gateio = new ccxws.Gateio();
and call the correct gateio subs/methods after that.