Introduction to the Polymarket Async Bot
The provided Python-based bot is designed for asynchronous operation on Polymarket, targeting standalone nonsports yes/no markets. With a focus on buying NO outcomes below a predefined price cap, it operates for entertainment purposes only and comes with no warranties-users are advised to proceed at their own risk. This bot is equipped with features such as position tracking, a dashboard interface, and live recovery of its operational state.
Built to scan markets for specific opportunities, the bot ensures continuous monitoring while persisting its state during runtime. Its functionality is modular, with clear separation between runtime configuration, client exchange management, and recovery mechanisms.
Core Features and Functionality
The bot's main feature is its ability to analyze standalone markets on Polymarket, seeking NO entries that fall below a user-defined price cap. It leverages a strategy called nothinghappens, which is defined within the runtime configuration file. This strategy underpins its decision-making process for executing trades within the system's boundaries.
Key operational capabilities include tracking open positions, maintaining a live recovery state, and exposing a dashboard for user interaction. The persistence mechanism ensures that the bot can recover seamlessly from interruptions, maintaining operational integrity and continuity.
Runtime Configuration and Setup
The runtime configuration is located under the directory `strategies/nothinghappens`. Users are required to set up their configuration using `config.example.json` and `env.example`. Custom configurations can be specified using the `CONFIGPATH` environment variable, allowing flexibility in adapting the bot to various trading scenarios.
Dependencies are managed through a requirements file, which can be installed using `pip install -r requirements.txt`. This ensures that all necessary libraries and packages are in place for smooth operation.
Deployment on Heroku
The bot supports deployment on Heroku, a cloud platform for hosting applications. To deploy, users must set environment variables such as `HEROKU_APP_NAME`, `PRIVATE_KEY`, `FUNDER_ADDRESS`, and `POLYGON_RPC_URL`. These parameters ensure secure and accurate operation in a live environment.
Commands like `heroku config:set` are used to configure critical settings such as `BOT_MODE` and `LIVE_TRADING_ENABLED`. Additionally, deployment involves pushing the code to the Heroku server using Git commands, such as `git push heroku branch:main`.
Operational Insights and Safeguards
The bots structure includes safeguards to prevent unintended consequences. For instance, the worker entry in Heroku is configured to fail fast if started accidentally, ensuring that only the web dyno operates. This design choice highlights the bot's focus on minimal risk and controlled execution.
Local configuration files, ledgers, and deployment artifacts are ignored by default to protect sensitive information and maintain a clean deployment environment. This approach prioritizes security and operational clarity, reducing the likelihood of unintended leaks or errors.
Conclusion
This focused async Python bot provides a comprehensive framework for automated trading on Polymarket. With its robust configuration options, deployment readiness, and operational safeguards, it is well-suited for users looking to explore automated market strategies. While it lacks warranty, its modular design and clear documentation make it a valuable tool for experimental and entertainment purposes.