Skip to content

Commit 6f0154b

Browse files
committed
fix
1 parent a78fe1d commit 6f0154b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

hooks/useCoinGeckoWebSocket.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function useCoinGeckoWebSocket({
5656

5757
setTrades((prev) => [newTrade, ...prev].slice(0, 7));
5858
}
59-
// G3: OHLCV updates
59+
// G3: OHLCV updates
6060
if (msg.ch === 'G3') {
6161
const timestamp = msg.t || 0; // already in seconds
6262
const newCandle: OHLCData = [
@@ -67,6 +67,16 @@ export function useCoinGeckoWebSocket({
6767
Number(msg.c ?? 0),
6868
];
6969

70+
console.log('==== G3 OHLCV Update:', {
71+
timestamp,
72+
formattedTime: new Date(timestamp * 1000).toISOString(),
73+
open: msg.o,
74+
high: msg.h,
75+
low: msg.l,
76+
close: msg.c,
77+
candle: newCandle,
78+
});
79+
7080
// Always update with the latest candle - chart will handle deduplication
7181
setOhlcv(newCandle);
7282
lastOhlcvTimestamp.current = timestamp;
@@ -145,6 +155,8 @@ export function useCoinGeckoWebSocket({
145155
subscribe('CGSimplePrice', { coin_id: [coinId], action: 'set_tokens' });
146156

147157
const wsPools = [poolId.replace('_', ':')];
158+
console.log("===wsPools", wsPools)
159+
148160
if (wsPools.length) {
149161
subscribe('OnchainTrade', {
150162
'network_id:pool_addresses': wsPools,

0 commit comments

Comments
 (0)