WebSocket Pinnacle estable: precios stale y reconexión
Respuesta: trata el socket como transporte poco fiable. (1) Responde a cada ping con {"type":"pong"}. (2) En close, backoff exponencial + jitter, resuscríbete, vacía los maps en snapshot part === 1. (3) Sigue seq/ts y el último apply — si el silencio supera tu SLA, fuerza la reconexión. (4) Honra los códigos (1001 deploy, 4008 slow consumer). Hace falta Builder (€99/mes). Ejemplo Node: reconexión.
Stale-price detection (client-side)#
import time
LAST = {"ts": 0.0}
STALE_SEC = 15 # your SLA — not a vendor latency claim
def on_message(msg):
if msg["type"] in ("snapshot", "delta", "ping"):
LAST["ts"] = time.time()
def watchdog():
if time.time() - LAST["ts"] > STALE_SEC:
raise TimeoutError("no frames; reconnect")
Quiet markets are normal — gate the watchdog on whether events you care about are live.
Failure modes#
| Signal | Action |
|---|---|
No pong path | Socket dies ~60 s after missed ping |
4008 slow_consumer | Narrow filters or speed up handlers |
1001 server_shutdown | Backoff reconnect (deploy) |
| Snapshot without clear | Ghost markets from the previous session |
We do not publish latency versus named competitors. Measure tick → your handler yourself.
CTA#
Builder. 3-day trial; card required, charged after day 3 unless cancelled. Docs: WebSocket.
Preguntas frecuentes#
¿Basta el scraping de invitado?#
Los bans y tableros de invitado retrasados son fallos habituales. Una clave self-serve con códigos de cierre documentados es la vía soportada.
¿Garantizáis actualizaciones sub-segundo?#
Documentamos heartbeats y tipos de frame, no un RTT de marketing frente a otros revendedores. Instrumenta de extremo a extremo.
¿Contenido educativo para adultos?#
Sí (18+).
Contenido educativo para mayores de 18 años. Sin pronósticos ni ganancias garantizadas. En España, apuesta solo con operadores con licencia de la DGOJ.