fix(monitor/collectors/coinbase): use envelope timestamp (per-ticker time field is not in real Coinbase frames)

This commit is contained in:
CarterPerez-dev 2026-05-02 03:36:26 -04:00
parent 0a6f4f1e09
commit 9c35e14ae8
1 changed files with 5 additions and 1 deletions

View File

@ -103,10 +103,14 @@ func (c *Collector) handleConn(ctx context.Context, conn *Conn) error {
loopErr := ReadLoop(ctx, conn, seq, func(hctx context.Context, f Frame) error {
switch f.Kind {
case FrameTypeTicker, FrameTypeSnapshot:
ts := f.Timestamp.UTC()
if ts.IsZero() {
ts = time.Now().UTC()
}
for _, tk := range f.Tickers {
tick := Tick{
Symbol: tk.ProductID,
TS: tk.Time.UTC(),
TS: ts,
Price: tk.Price,
Volume24h: tk.Volume24h,
}