Polymarket tracker bot for monitoring selected prediction markets and maintaining a tracked market list. It supports add/delete/list/history/status, mute/unmute, and buffer controls for alert noise management.
- Tracks configured Polymarket markets and history.
- Provides Telegram commands for adding, deleting, listing, muting, unmuting, and status checks.
- Includes buffer controls to reduce noisy alerts.
- Repository:
MilaArtyNew/polymarket-tracker - Primary stack: Python, systemd, Railway
- Entrypoints and scripts:
main.py
- Notable dependencies:
aiogram,aiosqlite,apscheduler,beautifulsoup4,httpx,lxml,pydantic-settings,pytest,sqlalchemy[asyncio]
Configure the service with environment variables. Do not commit real secrets to the repository.
ADMIN_CHAT_ID— required or optional runtime configuration. See deployment environment for the actual value.DATABASE_URL— required or optional runtime configuration. See deployment environment for the actual value.POLYMARKET_GAMMA_API_URL— required or optional runtime configuration. See deployment environment for the actual value.TELEGRAM_BOT_TOKEN— required or optional runtime configuration. See deployment environment for the actual value.XTRACKER_BASE_URL— required or optional runtime configuration. See deployment environment for the actual value.XTRACKER_SOURCE_URL— required or optional runtime configuration. See deployment environment for the actual value.
git clone https://github.com/MilaArtyNew/polymarket-tracker
cd polymarket-tracker
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtpython main.py/add— Add a tracked item./buffer_off— Disable alert buffer./buffer_on— Enable alert buffer./buffer_value— Show or set alert buffer value./count— Show tracked market/item count./delete— Delete a tracked item./history— Show historical records./list— List tracked items./mute— Mute alerts./status— Show current service or strategy status./unmute— Unmute alerts.
If a command requires extra input and the argument is missing, the bot should ask a follow-up question instead of failing silently.
- Keep secrets in the deployment platform environment variables, not in Git.
- Use the default branch as the source of truth for deployments.
- Check logs after every deployment and verify the
/statusor health endpoint when available. - If the project uses a scheduler, verify timezone assumptions and idempotency before enabling it in production.
- Review logs after startup for missing environment variables or API authentication errors.
- Keep command names in English and document every user-facing command in this README.
- For Telegram bots,
/helpshould list the same commands documented here. - Inline buttons should edit the original message with the final status rather than sending duplicate messages.
- Bot does not respond: verify the bot token, webhook/polling mode, and chat permissions.
- Missing data: check API keys, rate limits, and upstream service status.
- Deployment starts but exits: inspect platform logs for missing environment variables or import errors.
- Commands differ from README: update the command list here and in the bot command menu at the same time.
- Never commit
.envfiles, API keys, private keys, Telegram tokens, or session strings. - Use
.env.examplefor placeholders only. - Rotate any credential that was accidentally committed.