From b08f320fe12eb05c4fd5125efbc6b40903f6b8f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20S=C3=A1nchez?= Date: Fri, 10 Jan 2025 09:39:36 -0300 Subject: [PATCH] README --- README.md | 65 ++++++++++++++++++++++++++++++++++++++++++ config.json.example | 39 +++++++++++++++++++++++++ credentials.py.example | 21 ++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 README.md create mode 100644 config.json.example create mode 100644 credentials.py.example diff --git a/README.md b/README.md new file mode 100644 index 0000000..2c8b332 --- /dev/null +++ b/README.md @@ -0,0 +1,65 @@ +# DCAv2Earn + +DCAv2Earn is a companion project for DCAv2. It automates the process of allocating a portion of idle funds on your exchange accounts to earn programs provided by each exchange. The system ensures that your funds are efficiently utilized to generate passive income while maintaining a minimum balance in your trading accounts at all times. + +## Features + +- **Automatic Allocation**: Automatically transfers a configurable percentage of your idle funds to the earn program of each supported exchange. +- **Configurable Parameters**: + - **Percentage of Funds**: Specify what percentage of your idle funds should be allocated to the earn program. + - **Minimum Balance**: Set a minimum balance that must remain in your trading account to prevent over-allocation. + - **Step Size**: Define the step size for balance adjustments to ensure smooth transitions. +- **Multiple Exchanges Support**: Currently supports Binance, Gate.io, KuCoin and OKX. More exchanges can be added as needed. +- **Logging and Monitoring**: Provides real-time monitoring of your funds' allocation and performance. + +## Prerequisites + +- **Python 3.8+**: Ensure you have Python 3.8 or higher installed. +- **API Keys**: Obtain API keys from the supported exchanges with the necessary permissions for transferring funds (NOT withdrawing) and accessing earn programs. + +## Installation + +1. **Clone the Repository**: + ```bash + git clone https://gitea.nicosanchez.com.ar/nicolas/DCAv2Earn.git + cd DCAv2Earn + ``` + +2. **Configure the System**: + - Create a `config.json` file with the necessary configuration parameters. + - Use `config.json.example` as a template. + + +3. **Load the credentials to credentials.py** + ``` + Check credentials.py.example and replace the placeholders with your actual API keys. Then, rename the file to credentials.py. + ``` + +4. **Run the System**: + ```bash + python main.py + ``` + +## Configuration + +- **lap_time**: The time in seconds between each lap of the system. During each lap, the system checks and adjusts your funds' allocation. +- **minimum_amount_in_trading_account**: The minimum amount of funds that must remain in your trading account at all times to prevent over-allocation. +- **percentage_of_funds_to_commit**: The percentage of your idle funds to allocate to the earn program. +- **step_size**: The step size for balance adjustments, ensuring smooth transitions between balances. +- **api_keys**: API keys for each supported exchange with the necessary permissions. The API keys are stored in credentials.py + +## Usage + +### ATTENTION: THIS PROGRAM IS A PERSONAL PROJECT AND IS NOT INTENDED TO BE USED BY ANYONE ELSE. USE AT YOUR OWN RISK. + +The system runs continuously in the background, automatically allocating your funds to the earn program according to the specified parameters. You can monitor the system's performance and status through the provided logging and monitoring features. + +## Support + +For any questions, issues, or feature requests, please create an issue on the Gitea repository (https://gitea.nicosanchez.com.ar/nicolas/DCAv2Earn/issues). + +## License + +DCAv2Earn is released under the MIT License. + +--- diff --git a/config.json.example b/config.json.example new file mode 100644 index 0000000..395368d --- /dev/null +++ b/config.json.example @@ -0,0 +1,39 @@ +{ + "exchanges": { + "binance": { + "currency": "USDT", + "minimum_amount_in_trading_account": 1000, + "step_size": 250, + "percentage": 0.5, + "time_between_subscriptions": 3600, + "time_between_redemptions": 0 + }, + "gateio": { + "currency": "USDT", + "minimum_amount_in_trading_account": 1000, + "step_size": 250, + "percentage": 0.5, + "time_between_subscriptions": 3600, + "time_between_redemptions": 0 + }, + "kucoin": { + "currency": "USDT", + "minimum_amount_in_trading_account": 1000, + "step_size": 250, + "percentage": 0.5, + "time_between_subscriptions": 3600, + "time_between_redemptions": 0 + }, + "okx": { + "currency": "USDT", + "minimum_amount_in_trading_account": 1000, + "step_size": 250, + "percentage": 0.5, + "time_between_subscriptions": 3600, + "time_between_redemptions": 0 + } + }, + "lap_time": 30, + "api_port": 5001 + +} \ No newline at end of file diff --git a/credentials.py.example b/credentials.py.example new file mode 100644 index 0000000..48f3a99 --- /dev/null +++ b/credentials.py.example @@ -0,0 +1,21 @@ +def get_api_key(exchange): + if exchange=="binance": + api_key = "place_your_api_key_here" + api_secret = "place_your_api_secret_here" + return api_key, api_secret + elif exchange=="kucoin": + api_key = "place_your_api_key_here" + api_secret = "place_your_api_secret_here" + api_passphrase = "place_your_passphrase_here" + return api_key, api_secret, api_passphrase + elif exchange=="okx": + api_key = "place_your_api_key_here" + api_secret = "place_your_api_secret_here" + api_passphrase = "place_your_passphrase_here" + return api_key, api_secret, api_passphrase + elif exchange=="gateio": + api_key = "place_your_api_key_here" + api_secret = "place_your_api_secret_here" + return api_key, api_secret + else: + return None,None \ No newline at end of file