Atlas / Skills / 2025emma / Real time data client

Real time data clientSAFE

skills/2025emma/polymarket
Verdict
SAFE
Grade
B
Trust score
89 /100
Version
—
Hosts
—
License
MIT
Stars
23,072
01

Overview

From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.

TRANSLATED CONTENT:

This client provides a wrapper to connect to the real-time-data-streaming WebSocket service.

How to use it

Here is a quick example about how to connect to the service and start receiving messages (you can find more in the folder examples/):

import { RealTimeDataClient } from "../src/client";
import { Message } from "../src/model";

const onMessage = (message: Message): void => {
console.log(message.topic, message.type, message.payload);
};

const onConnect = (client: RealTimeDataClient): void => {
// Subscribe to a topic
client.subscribe({
subscriptions: [
{
topic: "comments",
type: "*", // "*"" can be used to connect to all the types of the topic
filters: `{"parentEntityID":100,"parentEntityType":"Event"}`, // empty means no filter
},
],
});
};

new RealTimeDataClient({ onMessage, onConnect }).connect();

How to subscribe and unsubscribe from messages

Once the connection is stablished and you have a client: RealTimeDataClient object, you can subscribe and unsubscribe to many messages streamings using the same connection.

Subscribe

Subscribe to 'trades' messages from the topic 'activity' and to the all comments messages.

client.subscribe({
subscriptions: [
{
topic: "activity",
type: "trades",
},
],
});

client.subscribe({
subscriptions: [
{
topic: "comments",
type: "*", // "*"" can be used to connect to all the types of the topic
},
],
});

Unsubscribe

Unsubscribe from the new trades messages of the topic 'activity'. If 'activity' has more messages types and I used '\*' to connect to all of them, this will only unsubscribe from the type 'trades'.

client.subscribe({
subscriptions: [
{
topic: "activity",
type
Read from source at commit 86937970cd26OBSERVED · 2026-10-20
Advertisement
02

Install

Commands as the repository documents them. They are shown, not run.

npm install @polymarket/real-time-data-client
pip install py-clob-client
03

What it tells the agent

The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.

TRANSLATED CONTENT:
---
name: polymarket
description: Comprehensive Polymarket skill covering prediction markets, API, trading, market data, and real-time WebSocket data streaming. Build applications with Polymarket services, monitor live trades, and integrate market predictions.
---

# Polymarket Comprehensive Skill

Complete assistance with Polymarket development - covering the full platform (API, trading, market data) and the real-time data streaming client (WebSocket subscriptions for live market activity).

## When to Use This Skill

This skill should be triggered when:

**Platform & API:**
- Working with Polymarket prediction markets
- Using Polymarket API for market data
- Implementing trading strategies
- Building applications with Polymarket services
- Learning Polymarket best practices

**Real-Time Data Streaming:**
- Connecting to Polymarket's WebSocket service
- Building prediction market monitoring tools
- Processing live trades, orders, and market updates
- Monitoring market comments and social reactions
- Tracking RFQ (Request for Quote) activity
- Integrating crypto price feeds

## Quick Reference

### Real-Time Data Client Setup

**Installation:**
```bash
npm install @polymarket/real-time-data-client
```

**Basic Usage:**
```typescript
import { RealTimeDataClient } from "@polymarket/real-time-data-client";

const onMessage = (message: Message): void => {
    console.log(message.topic, message.type, message.payload);
};

const onConnect = (client: RealTimeDataClient): void => {
    client.subscribe({
        subscriptions: [{
            topic: "activity",
            type: "trades"
        }]
    });
};

new RealTimeDataClient({ onMessage, onConnect }).connect();
```

### Supported WebSocket Topics

**1. Activity (`activity`)**
- `trades` - Completed trades
- `orders_matched` - Order matching events
- Filters: `{"event_slug":"string"}` OR `{"market_slug":"string"}`

**2. Comments (`comments`)**
- `comment_created`, `comment_removed`
- `reaction_created`, `reaction_removed`
- Filters: `{"parentEntityID":number,"parentEntityType":"Event"}`

**3. RFQ (`rfq`)**
- Request/Quote lifecycle events
- No filters, no auth required

**4. Crypto Prices (`crypto_prices`, `crypto_prices_chainlink`)**
- `update` - Real-time price feeds
- Filters: `{"symbol":"BTC"}` (optional)

**5. CLOB User (`clob_user`)** ⚠️ Requires Auth
- `order` - User's order updates
- `trade` - User's trade executions

**6. CLOB Market (`clob_market`)**
- `price_change` - Price movements
- `agg_orderbook` - Aggregated order book
- `last_trade_price` - Latest prices
- `market_created`, `market_resolved`

### Authentication for User Data

```typescript
client.subscribe({
    subscriptions: [{
        topic: "clob_user",
        type: "*",
        clob_auth: {
            key: "your-api-key",
            secret: "your-api-secret",
            passphrase: "your-passphrase"
        }
    }]
});
```

### Common Use Cases

**Monitor Specific Market:**
```typescript
client.subscribe({
    subscriptions: [{
        topic: "activity",
        type: "trades",
        filters: `{"market_slug":"btc-above-100k-2024"}`
    }]
});
```

**Track Multiple Markets:**
```typescript
client.subscribe({
    subscriptions: [{
        topic: "clob_market",
        type: "price_change",
        filters: `["100","101","102"]`
    }]
});
```

**Monitor Event Comments:**
```typescript
client.subscribe({
    subscriptions: [{
        topic: "comments",
        type: "*",
        filters: `{"parentEntityID":12345,"parentEntityType":"Event"}`
    }]
});
```

## Reference Files

This skill includes comprehensive documentation in `references/`:

**Platform Documentation:**
- **api.md** - Polymarket API documentation
- **getting_started.md** - Getting started guide
- **guides.md** - Development guides
- **learn.md** - Learning resources
- **trading.md** - Trading documentation
- **other.md** - Additional resources

**Real-Time Client:**
- **README.md** - WebSocket client API and examples
- **llms.md** - LLM integration guide
- **llms-full.md** - Complete LLM documentation

Use `view` to read specific reference files for detailed information.

## Key Features

**Platform Capabilities:**
✅ Prediction market creation and resolution
✅ Trading API (REST & WebSocket)
✅ Market data queries
✅ User portfolio management
✅ Event and market discovery

**Real-Time Streaming:**
✅ WebSocket-based persistent connections
✅ Topic-based subscriptions
✅ Dynamic subscription management
✅ Filter support for targeted data
✅ User authentication for private data
✅ TypeScript with full type safety
✅ Initial data dumps on connection

## Best Practices

### WebSocket Connection Management
- Use `onConnect` callback for subscriptions
- Implement reconnection logic for production
- Clean up with `disconnect()` when done
- Handle authentication errors gracefully

### Subscription Strategy
- Use wildcards (`"*"`) sparingly
- Apply filters to reduce data volume
- Unsubscribe from unused streams
- Process messages asynchronously

### Performance
- Consider batching high-frequency data
- Use filters to minimize client processing
- Validate message payloads before use

## Requirements

- **Node.js**: 14+ recommended
- **TypeScript**: Optional but recommended
- **Package Manager**: npm or yarn

## Resources

### Official Links
- **Polymarket Platform**: https://polymarket.com
- **Real-Time Client Repo**: https://github.com/Polymarket/real-time-data-client
- **API Documentation**: See references/api.md

### Working with This Skill

**For Beginners:**
Start with `getting_started.md` for foundational concepts.

**For API Integration:**
Use `api.md` and `trading.md` for REST API details.

**For Real-Time Data:**
Use `README.md` for WebSocket client implementation.

**For LLM Integration:**
Use `llms.md` and `llms-full.md` for AI/ML use cases.

## Notes

- Real-Time Client is TypeScript/JavaScript (not Python)
- Some WebSocket topics require authentication
- Use filters to manage message v
04

Trust audit

SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.

LayerWhat it checksResult
L0Provenance & inventoryPASS
L1Static analysis of the codeNA
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
none-observed
Network
none-observed
Shell
none-observed
Dependencies
pinned
Secrets in source
none-found

Findings (6)

LOWPrompt injection · prompt.transfer_instruction · CWE-94, CWE-1427
references/llms-full.md:628
const signer = new Wallet(""); //This is your Private Key. If using email login export from https://reveal.magic.link/polymarket otherwise export from your Web3 Application
Why it matters. an instruction to move sensitive data to an outside destination
Fix. remove; a skill never needs the user's secrets off the machine
LOWPrompt injection · prompt.transfer_instruction · CWE-94, CWE-1427
references/llms-full.md:4706
const signer = new Wallet(""); //This is your Private Key. If using email login export from https://reveal.magic.link/polymarket otherwise export from your Web3 Application
Why it matters. an instruction to move sensitive data to an outside destination
Fix. remove; a skill never needs the user's secrets off the machine
LOWPrompt injection · prompt.transfer_instruction · CWE-94, CWE-1427
references/llms-full.md:4768
key: str = "" #This is your Private Key. If using email login export from https://reveal.magic.link/polymarket otherwise export from your Web3 Application
Why it matters. an instruction to move sensitive data to an outside destination
Fix. remove; a skill never needs the user's secrets off the machine
LOWPrompt injection · prompt.transfer_instruction · CWE-94, CWE-1427
references/llms-full.md:4795
const signer = new Wallet("YourPrivateKey"); //This is your Private Key. If using email login export from https://reveal.magic.link/polymarket otherwise export from your Web3 Application
Why it matters. an instruction to move sensitive data to an outside destination
Fix. remove; a skill never needs the user's secrets off the machine
LOWPrompt injection · prompt.transfer_instruction · CWE-94, CWE-1427
references/llms.md:27
- [Get multiple order books summaries by request](https://docs.polymarket.com/api-reference/orderbook/get-multiple-order-books-summaries-by-request.md): Retrieves order book summaries for specified to
Why it matters. an instruction to move sensitive data to an outside destination
Fix. remove; a skill never needs the user's secrets off the machine
LOWInventory / provenance · skill.no_frontmatter · CWE-1104
SKILL.md:1
Why it matters. SKILL.md lacks name/description frontmatter

Gates applied: no_behavioural_pass.

Audited 2026-10-20 · audit v0.4.1 · source sha 86937970cd26full audit observations/trust-audit/skill/2025emma__polymarket.json · Report an issue / request a re-scan
05

Audit history

Every audit this skill has had.

DateSourceVerdictGradeScoreChange
2026-10-2086937970cd26SAFEB89first audit
06

Questions

Is polymarket — 2025emma/vibe-coding-cn safe to install?

The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.

What can polymarket — 2025emma/vibe-coding-cn access on my machine?

The audit observed no filesystem, network or shell use at all in its source.

How current is this page?

The grade is for one exact copy of the source (86937970cd26), read on 2026-10-20. The repository is watched, and a new audit runs when it changes — this is the first audit.

Add this badge to your README

Shows this page's audit result and links back to it. It updates when the audit does.

ModelsAtlas audit badge

Markdown
[![ModelsAtlas audit: Real time data client](https://modelsatlas.com/skills/2025emma/polymarket/badge.svg)](https://modelsatlas.com/skills/2025emma/polymarket/)

Not your listing, or something out of date? Claim or update your listing.

Advertisement