Skip to content
/ dexbot Public

true atomic-swap decentralized exchnage bot for liquidity/trading/DCA/BUY/SELL...

License

Notifications You must be signed in to change notification settings

nnmfnwl/dexbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Dex Maker/Trading Bot

  • This project is fork of Blocknet's dxmakerbot market making/trading bot for Blocknet's decentralized exchange protocol, built with the XBridge API.

Content

Web Links

Complete Setup

  • You can skip going over this readme/installation process and use DEXSETUP to setup complete DEXBOT and BlockDX even from scratch on Debian compatible operating systems

Prerequisites

  1. Latest Blocknet wallet installed.
  2. The wallet of any assets you will be trading. See list of compatible assets.
  3. The Blocknet wallet and any other wallet you're trading out of must be fully synced and fully unlocked.
  4. The wallets used for trading must be configured. For simple setup, use Block DX's automated configuration setup wizard. Having Block DX installed and opened is also useful to visually monitor the market and your open orders.
  5. Make sure funds are split into multiple UTXOs. If you have an order for 1 LTC and you only have a single 10 LTC input, all 10 LTC will be locked in this order. Having multiple, preferably smaller, UTXOs will allow a better distribution of funds across orders.
  6. Make sure funds are in legacy addresses (Eg. LTC funds should be in a "L" address).

Installation

Linux

  1. Open the command line terminal to enter the following commands
  2. Install Python 3: apt-get install python3
    • Or upgrade Python 3: apt-get upgrade python3
  3. Install pip (Python's package manager): apt-get install python3-pip
    • Or upgrade pip: apt-get upgrade python3-pip
  4. Download DX Maker Bot
    • Download via Git:
      1. Navigate to your project directory
        • Example: cd ~/Downloads/ccwallets/
          1. Download DX Maker Bot: git clone https://github.com/nnmfnwl/dexbot
        • Download via Github:
          1. Navigate to https://github.com/nnmfnwl/dexbot
          2. Click the green Clone or download button and select Download ZIP from the dropdown
          3. Save the file and (if necessary) extract the contents to a folder
  5. Navigate into the dexbot folder
    • Example: cd ~/Downloads/ccwallets/dexbot
  6. Install the required DX Maket Bot packages: pip3 install -r requirements.txt
    • If that command does not work: pip install -r requirements.txt

MacOS

  1. Open Terminal to enter the following commands
  2. Install XCode: xcode-select --install
  3. Install Homebrew (MacOS package manager): /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  4. Install Python 3: brew install python3
  5. Upgrade pip (Python's package manager): pip3 install -U pip
  6. Download DX Maker Bot
    • Download via Git:
      1. Navigate to your project directory
        • Example: cd ~/Documents/ccwallets/
      2. Download DX Maker Bot: git clone https://github.com/nnmfnwl/dexbot
    • Download via Github:
      1. Navigate to https://github.com/nnmfnwl/dexbot
      2. Click the green Clone or download button and select Download ZIP from the dropdown
      3. Save the file and (if necessary) extract the contents to a folder
  7. Navigate into the dexbot folder
    • Example: cd ~/Documents/ccwallets/dexbot
  8. Install the required DX Maket Bot packages: pip3 install -r requirements.txt

Windows

  1. Install Python 3:
    1. Navigate to https://www.python.org/downloads/windows/ and select Download Python 3.7.x
    2. Run the installer
    3. Check off Add Python 3.7 to PATH
    4. Click Install Now
  2. Right-click the taskbar Start menu and select Command Prompt (Admin)
  3. Upgrade pip (Python's package manager): py -m pip install --upgrade pip
  4. Download DX Maker Bot
    • Download via Git:
      1. Navigate to your project directory
        • Example: C:\Users\%USERNAME%\Downloads\ccwallets/dexbot
      2. Download DX Maker Bot: git clone https://github.com/nnmfnwl/dexbot
    • Download via Github: 1. Navigate to https://github.com/nnmfnwl/dexbot 1. Click the green Clone or download button and select Download ZIP from the dropdown 1. Save the file and (if necessary) extract the contents to a folder
  5. Navigate into the dexbot folder
    • Example: cd C:\Users\%USERNAME%\Downloads\ccwallets/dexbot
  6. Install the required DX Maket Bot packages: pip3 install -r requirements.txt
    • If that command does not work: pip install -r requirements.txt

Creating Trading Strategy

  1. make copy of howto/examples/bot_v2_template.py strategy template into main dexbot directory and rename by strategy you wish to make
  2. open strategy template file by text editor and edit one by one {} items according inline documentation, like Edit RPC setings, edit the trading addresses to match the wallet addresses containing funds split into multiple UTXOs,
  3. Make sure funds are in legacy addresses (Eg. LTC funds should be in a "L" address).
  4. Every strategy file represents just one way trading. So if you want provide liquidity for BLOC->LTC and also LTC->BLOCK, than you will need two strategy files.
  5. Save and close the file.

Running the Bot

  1. Run the wallets of any assets being traded (fully synced, unlocked).
  2. Run the Blocknet wallet (fully synced, unlocked).
  3. Optional: Run Block DX for visual reference that the bot is working.
    • At this stage it would be a good idea to test making/taking an order without using the bot to ensure everything is setup properly.
  4. Navigate to the dexbot directory in the terminal.

Maker Bot Usage

  • To prevent multiple bot strategies pulling same data from external sources there is dexbot proxy process
  • So at first there must be running bot pricing proxy instance:
python3 dxmakerbot_v2_proxy_run.py
  • dexbot strategy config file represents one way market, for bidirectional trading there are always two strategies needed to run.
  • For example to start specific previously created bidirectional dexbot strategy, where files are named strategy_BLOCK_LTC_liquidity.py and strategy_BLOCK_LTC_liquidity.py, need to run two commands in two terminal tabs:
python3 dxmakerbot_v2_run.py --config strategy_BLOCK_LTC_strategy1
  • and
python3 dxmakerbot_v2_run.py --config strategy_LTC_BLOCK_strategy1
  • To cancel all orders in market pair and address specified by --config file
python3 dxmakerbot_v2_run.py --config strategy_LTC_BLOCK_strategy1 --canceladdress
  • To cancel all orders in market pair specified by --config file
python3 dxmakerbot_v2_run.py --config strategy_LTC_BLOCK_strategy1 --cancelmarket
  • To cancel all orders
python3 dxmakerbot_v2_run.py --config strategy_LTC_BLOCK_strategy1 --cancelall

Donations for development, testing and liquidity providing:

  • For ability of this project to continue it needs your support:
  • BTC LN: ****
  • BTC: ****
  • LTC: ****
  • DOGE: ****
  • XVG: ****
  • PIVX: ****
  • BLOCK: ****
  • PKOIN: ****
  • LBC: ****

About

true atomic-swap decentralized exchnage bot for liquidity/trading/DCA/BUY/SELL...

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages