Metal X
API DocsMetal XWebAuth WalletLoan Protocol
  • DEX
    • What is Metal X?
      • Trading Interface
      • Trading on Metal X DEX
      • DEX fees and discounts
      • Referral program
      • Metal X FAQ
  • Developers DEX
    • Smart Contract
      • Contract Address
      • Tables
      • Actions
    • Contract Mappings
      • Order Types
      • Fill Types
      • Order Status
      • Order Side
      • Status codes for markets
      • Common Errors
    • Examples
      • Installation + Initialization
      • Submit DEX Order
      • Cancel DEX Order
      • Order Lifecycle
    • Audit
    • Oracles
  • Swap, Pools & Farms
    • What is Metal X Swap?
      • Trading Interface
      • Swap fees and discounts
      • Liquidity Pools
      • Farming
      • Metal X Swap FAQ
  • Developers Swap
    • Tables
      • Actions
      • Contracts
      • Audit
  • XPR Network
    • XPR Network & Ecosystem
  • dex bot
    • About
    • Installation
  • Support
    • Guides
Powered by GitBook
On this page
  • Prerequisites
  • Important Notes
  1. dex bot

Installation

PreviousAboutNextGuides

Last updated 1 year ago

Prerequisites

To get started make sure that you have the following:

  • A account with enough funds for trading

  • installed on your computer (nodejs 18.0.0)

  • (or some other editor)

Important: You must use node 18.0.0 You can use Node Version Manager (nvm) to manage your node version.

First clone the

git clone https://github.com/XPRNetwork/dex-bot.git

Navigate to the folder and in your terminal run

npm install

Edit your default.json using vscode or your code editor of choice.

If you want the bot to automatically cancel open orders on exit (when you command + c) for your convenience you can set this parameter to true

    "cancelOpenOrdersOnExit": true,

Choose the strategy, either gridBot or marketMaker

    "strategy": "gridBot",

Set your pairs and parameters (covered in next section)

    "gridBot": {
      "pairs": [
        {
          "symbol": "XPR_XMD",
          "upperLimit": 0.0009000,
          "lowerLimit": 0.0006000,
          "gridLevels": 14,
          "bidAmountPerLevel": 40000
        }             
      ]
    },

Enter environment variables in terminal. Depending on your operating system, enter the PROTON_USERNAME and PROTON_PRIVATE_KEY

Mac and Linux:
export PROTON_USERNAME=user1
export PROTON_PRIVATE_KEY=private_key

Windows using powershell:
$env:PROTON_USERNAME = 'user1'
$env:PROTON_PRIVATE_KEY = 'private_key'

Then you can run the bot

npm run bot

To stop the bot you can use Cmd+C (mac) or Ctrl+C (windows)

Important Notes

  • Minimum order is $1 or 1 XMD on Metal X

  • Bot will automatically add more orders once old ones are filled

  • Keep your private key protected

You can clear your private key from the screen in your terminal before you run the bot you can run the following command; Windows

cls

Mac / Linux

clear

If you have trouble using the trading interface make sure you have

verified identity
WebAuth.com
Nodejs and npm
VS Code
repo