- Monitor +
alertBot type - REST +
WebSocketData source - ~2s live feedCadence
- Read-only dataTrades
A Discord bot is one of the most satisfying first projects on market data: it turns a quiet API into a channel that pings you when something moves. This one watches the current order book on active markets, a convenience layer over the historical snapshot archive that is the platform’s core, and posts alerts on spread, depth, and price shifts. A notifier, not a trader.
To be clear up front: this is a monitoring bot. Resolved Markets is a read-only data platform, it does not place orders on Polymarket. What the bot does is watch the data and tell your channel when a condition you care about is met.
What the bot watches
Spread alerts
Ping the channel when the bid-ask spread widens past a threshold, often a sign of an event or thinning liquidity.
- Threshold on spread
- Per-market or per-category
- Catch the widening early
Price moves
Post when the implied probability jumps by more than X over a short window, the market changing its mind.
- Mid-price deltas
- Configurable window
- Direction in the message
Depth shifts
Flag when resting depth on one side drops sharply, hinting that support or resistance is being pulled.
- Bid/ask depth totals
- Imbalance flips
- Liquidity warnings
How it stays current
For most channels, polling the live orderbook endpoint on a short timer is plenty. For a steadier feed without a polling loop, subscribe to the WebSocket instead, it pushes the current book roughly every two seconds. Either way the bot only posts when a rule fires, so your channel stays signal, not noise. Note that the live feeds cover active markets; anything historical comes from the snapshot archive.
Alerts, not order placement
The bot reads data and notifies, it never trades. That is by design: the platform is read-only. If you want to act on an alert, you do it yourself on Polymarket. Keeping the bot to monitoring also keeps it simple, safe, and easy to reason about.
A sensible rule pipeline
The difference between a useful alert bot and a noisy one is the rule layer between the data and the channel. Each broadcast or poll gives you a fresh snapshot; the bot compares it to recent state, decides whether anything crossed a threshold, and only then formats a message. Keep state small, a short rolling window per market is enough for spread, depth, and trend comparisons.
- 1Resolve the markets you care about, pass ids directly, or look them up from friendly slugs like btc-updown-1h.
- 2Fetch the current book on each tick, from the live orderbook endpoint or the WebSocket push.
- 3Compare against a short rolling window: spread change, mid-price delta, depth drop, imbalance flip.
- 4Debounce, suppress repeat fires within a cooldown so one event does not spam the channel.
- 5Format a compact embed and post it via your bot or a channel webhook.
Tuning so the channel stays signal
Pick honest thresholds
Set spread and move thresholds relative to each market’s normal range, a 1-cent move means different things on a tight book and a wide one.
- Per-market baselines
- Relative, not absolute
- Fewer false pings
Add a cooldown
A short per-rule cooldown stops a single volatile moment from firing the same alert ten times in a row.
- Debounce per market
- One event, one ping
- Quieter channel
Match cadence to need
Poll on a timer for casual channels; subscribe to the WebSocket when you want the steadier ~2-second push without a loop.
- Polling for one-offs
- WebSocket for steady feeds
- Paid tiers for WS
Let an agent watch the book
The same data is exposed over MCP, every tier includes it, so an AI agent in Claude or your own tooling can read the live orderbook and snapshot history and post a written read, not just a threshold trip. It is still read-only: the agent observes and reports.
A good alert bot earns its place by staying quiet. The rules, not the data, are what you spend your time on.
Build the alert feed
The docs cover the live orderbook endpoint and the WebSocket stream that power the alerts.
Frequently asked questions
Can the Discord bot place trades on Polymarket?
No. Resolved Markets is a read-only data platform, it does not execute orders. The bot monitors the order book and posts alerts to your channel; acting on those alerts is something you do yourself on Polymarket.
Should the bot poll the REST API or use the WebSocket?
Both work. Polling the live orderbook endpoint on a short timer is simple and fine for most alert channels. The WebSocket avoids the polling loop by pushing the current book roughly every two seconds. Both serve active markets; for closed or historical markets you query the snapshot archive instead. WebSocket access is available on paid tiers.
What can the bot alert on?
Anything derivable from the order book, spread widening, sharp mid-price moves, depth dropping on one side, or imbalance flips. Each snapshot carries the derived prices and depth totals, so the rules are straightforward to express.
How do I stop the bot from spamming the channel?
Add a per-rule cooldown and set thresholds relative to each market’s normal range. One volatile moment can otherwise trip the same rule repeatedly; debouncing within a short window keeps it to one ping per event, and baseline-relative thresholds cut false fires on naturally wide books.



