Skip to content
This repository has been archived by the owner on Sep 9, 2023. It is now read-only.

Only Bitcoin works for trade websocket. Gateio alongside other exchanges do not #284

Open
ephraimd opened this issue May 20, 2021 · 6 comments

Comments

@ephraimd
Copy link

ephraimd commented May 20, 2021

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

@MidoMiddle
Copy link

You create Gate.io and subs to binance? )

@ephraimd
Copy link
Author

@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

@MidoMiddle
Copy link

If you want subs on binance you must use tickers from binance. If gate - gate tickers. Tickers are different.

@ephraimd
Copy link
Author

ephraimd commented May 21, 2021

@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.

@ephraimd
Copy link
Author

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

@LPX55
Copy link

LPX55 commented Jul 26, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants