Trading bots for Blocknet Xbridge.
Blocknet GitHub
Blocknet Documentation
Tested on Python 3.10.
-
Clone the repository:
git clone https://github.com/tryiou/xbridge_trading_bots.git cd xbridge_trading_bots
-
(Optional) Create and activate a Python virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Navigate to the project directory:
cd xbridge_trading_bots
-
(Optional) Activate the Python virtual environment:
source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Pull the latest changes and update dependencies:
git pull pip install -r requirements.txt
The bot will automatically attempt to grab blocknet.conf
RPC credentials and port when starting one of the scripts.
- If the default chain directory path is used, it will pick from it and start.
- If a custom path is used, a prompt box will appear asking for the
blocknet.conf
path, or a console prompt if Tkinter is not installed. - This custom path will be stored in the config folder for subsequent uses.
The GUI version requires the Tkinter package. Installation guides can be found here:
Note: Python 3 for Windows already includes Tkinter.
-
Edit the configuration:
# Edit config/config_pingpong.yaml # Set desired user_pairs / usd_amount_default / spread_default # Optional: customize per pair
-
Run the GUI version:
python gui_pingpong.py
-
Or run the console version:
python main_pingpong.py
-
Example usage:
python basic_seller.py --help python basic_seller.py -tts BLOCK -ttb PIVX -atts 200 -mup 0.33 -spu 0.015
Options:
-
-tts, --TokenToSell
Required. The token you wish to sell (e.g., BLOCK).
Type: string -
-ttb, --TokenToBuy
Required. The token you want to buy (e.g., LTC).
Type: string -
-atts, --AmountTokenToSell
Required. The amount of the token you want to sell.
Type: float -
-mup, --MinUsdPrice
Required. The minimum USD price at which you want to sell the token.
Type: float -
-spu, --SellPriceUpscale
Optional. Percentage upscale applied to the CCXT ticker price for the token sale. For example, 0.015 represents a 1.5% upscale. The default value is 0.015.
Type: float -
-p, --partial
Optional. Minimum size of the partial sell as a percentage of the total size (between 0.001 (inclusive) and 1 (exclusive)). For example, --partial 0.5 means selling 50% of the specified amount. The default is None.
Type: float
-