Khun
October 24, 2021, 1:10pm
1
I have subscribed the following streams but they all show me different prices:
stream: kline_1m, key: “c”
stream: aggTrades, key: “p”
stream: trade, key: “p”
I want to get real-time trade information with price and quantity. Which one do i have to subscribe?
I’m checking the price with Binance and only kline seems correct. What am i doing wrong here?
ishuen
October 25, 2021, 1:28am
2
Hi.
Could you give out some examples to show how did you compare the price?
kline_1m does not provide the real-time data as it is a summary of the trades within 1 min. AggTrade and trade give out real-time data but there may be multiple records at the same time.
Khun
October 25, 2021, 1:50am
3
My problem is, i subscribe to aggTrades but when i compare the data with Binance’s price, it’s totally different
Khun
October 25, 2021, 1:58am
4
I have updated the question and also uploading the screenshot
ishuen
October 26, 2021, 1:27am
5
Which price are you referring to on the site? Do note that the time of the prices on the UI are shown in local time.
Khun
October 26, 2021, 1:46am
6
Basically the price api showing is different than the current price Binance futures showing. I’m trying to get the current price. I’m fetching previous kline_1m and would like to update real-time.
I see that even live kline shows different prices
Khun
October 26, 2021, 1:49am
7
here are three links i am using
wss://fstream.binance.com/stream?streams=btcusdt@kline_1m
wss://fstream.binance.com/stream?streams=btcusdt@aggTrade
wss://fstream.binance.com/stream?streams=btcusdt@trade
Chai
October 26, 2021, 3:55am
8
The links shown here are futures data stream. Ensure that you are not comparing futures data with spot.
Khun
October 26, 2021, 2:06pm
9
I have solved the problem. I had added a function and that was lagging. Thank you all guys