# Installation

1.  **Download the source code by cloning it:**

    ```bash
    git clone https://github.com/ARBProtocol/jupgrid
    npm install
    ```
2.  **Initial Setup:** Run JupGrid for the first time to create the necessary user configuration files:

    ```bash
    node .
    ```

    This will generate a `.env` file where you will fill in your secure data.
3. **Configuration:** Open the `.env` file in a text editor and input your Phantom wallet Private Key and the URL to your RPC connection.
4.  **Encryption:** Start JupGrid again:

    ```bash
    node .
    ```

    This time, you will be prompted to enter a password to locally encrypt your private key and RPC connection.
5.  **Start JupGrid:** Start JupGrid a third time:

    ```bash
    node .
    ```

    You will then be prompted to enter the password you previously set. You will then see the start-up prompts, which allow you to modify the following parameters:

    * **Token A:**
    * **Token B:**
    * **Infinity Target Value:** (Maximum $ value of Token B you want to hold - Don’t set this higher than your Token A + B value!)
    * **Spread:** (% difference from current market price to orders)
    * **Stop Loss:** ($ value for BOTH Token A and Token B - If your wallet hits this value, the script will stop for safety)
    * **Delay:** (Used to prevent rate-limiting by the Jupiter API. JupGrid is a “slow” bot and doesn’t need information every second)

    JupGrid will then place one buy and one sell order based on the parameters you have set.
