Deliver real-time stock quotes and market data with PubNub
Does it follow best practices?
Evaluation — 98%
↑ 1.81xAgent success when using this tile
Validation for skill structure
A financial data startup is building a backend service that ingests raw market data from an upstream WebSocket provider and redistributes it to client applications via PubNub. The upstream provider delivers data in an inconsistent format -- sometimes the price field is called last, sometimes ltp, sometimes price; ticker symbols may arrive as sym, symbol, or ticker. The service needs to handle the messy provider data, compute derived fields, and push updates out in a way that balances cost and latency for potentially hundreds of symbols updating multiple times per second.
The team wants a single Node.js module that connects to the upstream feed, processes incoming quotes, and publishes them through PubNub. During peak market volatility some symbols may produce dozens of updates per second, so the system needs to be smart about how frequently it sends full versus lightweight updates for each symbol.
Produce the following files:
publisher.js -- The main Node.js module that:
package.json -- Dependencies needed to run the publisher
No additional files are required.