Nullcraft sends Telegram alerts for large Polymarket trades. Each chat can set a separate USD threshold.
This repository is a refactored version of an older scrappy monitor I used to use. It uses the current public Polymarket Data API and needs no wallet key.
- Polls the current Polymarket
/tradesendpoint. - Filters large trades through the Data API.
- Sends market, trader, and transaction links.
- Stores subscriptions and thresholds in SQLite.
- Prevents duplicate alerts across process restarts.
- Uses an overlap window to handle delayed API records.
- Retries temporary Telegram network failures.
- Stops cleanly after
SIGINTorSIGTERM.
A Polymarket private key or API credential is not required.
-
Clone the repository.
git clone https://github.com/0xf3dz/nullcraft-bot.git cd nullcraft-bot -
Install the locked dependencies.
uv sync
-
Create the local environment file.
cp .env.example .env
-
Put the Telegram bot token in
.env.TELEGRAM_BOT_TOKEN=replace-with-your-bot-token
-
Check SQLite and Polymarket access.
uv run nullcraft --check
-
Start the bot.
uv run nullcraft
| Command | Result |
|---|---|
/start |
Activate alerts with the default threshold |
/stop |
Disable alerts for the chat |
/setthreshold <amount> |
Set and activate a new threshold |
/showthreshold |
Show the current threshold |
/debug |
Show safe status data for the bot |
/apitest |
Check the Polymarket Data API |
/help |
Show the command list |
For example, /setthreshold 25000 sends alerts for trades worth at least $25,000.
| Variable | Default | Purpose |
|---|---|---|
TELEGRAM_BOT_TOKEN |
None | Telegram bot token |
NULLCRAFT_DATABASE_PATH |
data/nullcraft.db |
SQLite database path |
NULLCRAFT_DEFAULT_THRESHOLD_USD |
10000 |
Threshold for a new subscription |
NULLCRAFT_MINIMUM_THRESHOLD_USD |
100 |
Lowest accepted chat threshold |
NULLCRAFT_POLL_INTERVAL_SECONDS |
2 |
Delay between successful polls |
NULLCRAFT_STARTUP_LOOKBACK_SECONDS |
30 |
Initial trade lookback window |
NULLCRAFT_OVERLAP_SECONDS |
10 |
Overlap between poll windows |
NULLCRAFT_REQUEST_TIMEOUT_SECONDS |
15 |
Data API request timeout |
NULLCRAFT_PROCESSED_RETENTION_SECONDS |
86400 |
Alert deduplication duration |
NULLCRAFT_DATA_API_URL |
https://data-api.polymarket.com |
Data API base URL |
NULLCRAFT_LOG_LEVEL |
INFO |
Python log level |
The default trade threshold limits the Data API result size. If the API returns 1,000 trades in one window, Nullcraft stops that poll and asks you to increase the threshold.
Telegram commands -> SQLite subscriptions
|
Polymarket Data API -> trade monitor -> Telegram alerts
|
SQLite deliveries
The monitor requests taker trades once per poll window. It sorts records by timestamp and validates each record before use.
A delivery record contains a trade identity and a chat identifier. Nullcraft writes the record only after Telegram accepts the alert.
Run the contract tests.
uv run python -m unittest discover -s tests -vCheck the source with Ruff.
uvx ruff check .Audit the locked dependencies.
uv export --locked --no-dev --no-emit-project \
--format requirements-txt --output-file /tmp/nullcraft-requirements.txt
uvx pip-audit --requirement /tmp/nullcraft-requirements.txtNullcraft is an independent project. It has no affiliation with Polymarket or Telegram. Public trade data can arrive late or change after publication.