# Installation

### Prerequisites

To get started make sure that you have the following:

* A [WebAuth.com](https://wauth.co) account with enough funds for trading
* [Nodejs and npm](https://nodejs.org/en) installed on your computer (nodejs 18.0.0)
* [VS Code](https://code.visualstudio.com/) (or some other editor)

**Important:** You must use node 18.0.0 \
\&#xNAN;*You can use Node Version Manager (nvm) to manage your node version.*

First clone the [repo](https://github.com/XPRNetwork/dex-bot)

```
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.

<figure><img src="/files/bT5WhBwEGDc8y2P606Ny" alt=""><figcaption></figcaption></figure>

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
* If you have trouble using the trading interface make sure you have [verified identity](https://identity.metalx.com/)
* 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**&#x20;

```
cls
```

**Mac / Linux**

```
clear
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.metalx.com/dex-bot/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
