> For the complete documentation index, see [llms.txt](https://prodigyfi.gitbook.io/structured-yields/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://prodigyfi.gitbook.io/structured-yields/build-with-prodigy.fi/trade-efficiently-introducing-the-api-tool/vault-subscription-api-guide.md).

# Vault Subscription - API Guide

{% stepper %}
{% step %}

### Download The API File <a href="#step-1-download-the-cli-file" id="step-1-download-the-cli-file"></a>

* Visit the Prodigy.Fi API repository: <https://github.com/prodigyfi/dci-cli>
* Click the green **Code** button in the top-right corner.
* Select **Download ZIP** and save the file to your computer (eg; in your Downloads folder).
* Unzip the file to access the dci-cli-main folder.

<figure><img src="/files/I4vMLfHRV66taZJ5CVq4" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Install A Code Editor <a href="#step-2-install-a-code-editor" id="step-2-install-a-code-editor"></a>

* Download and install a code editor, such as Visual Studio Code, if you don’t have one.
* Open the dci-cli-main folder in your code editor:
* In Visual Studio Code, click **File** > **Open Folder** and select the dci-cli-main folder.

<figure><img src="/files/NIwiFJjExCKcExjJlnbR" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Rename Your Files <a href="#step-3-rename-your-files" id="step-3-rename-your-files"></a>

* In the dci-cli-main folder, locate the files `config.example.json` and `create-vaults.example.csv`.
* Create copies of these files and rename them:
  * `config.example.json` → `config.json`
  * `create-vaults.example.csv` → `create-vaults.csv`
* To rename:
  * Alternatively, in Finder (Mac) or File Explorer (Windows), right-click, select **Duplicate** or **Copy/Paste**, and rename.

<figure><img src="/files/uyY83DEB0DFJKQLSRhbd" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Configure The RPC Node URL <a href="#step-4-configure-the-rpc-node-url" id="step-4-configure-the-rpc-node-url"></a>

* Open config.json in your code editor.
* Fill in the `rpcNode` parameter with the RPC node URL for your chosen blockchain network. This connects the API tool to the network. You can find the list of RPC nodes available [here](https://chainlist.org/).
* Copy any one of the link shown on the website

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

{% endstep %}

{% step %}

### Fill In The `rpcNode` Section

* Input the copied link into the rpcNode section

{% hint style="info" %}
*Note: Fill the config file under the network that you are running your CLI tool on. For example, if you trying to run the CLI tool on Base testnet, fill up the file under "Base Testnet" as shown in the example below.*
{% endhint %}

<figure><img src="/files/bEKa6nJvRsQ80tBptyA4" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

## Configure Wallet <a href="#step-5-configure-wallet" id="step-5-configure-wallet"></a>

* Add the `account` parameter with your wallet address.
* Replace the placeholder, `lp_account` , with your wallet address.

<figure><img src="/files/QilSLNHZ1Z0sa91gqiq1" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Obtain Json Wallet & Passphrase <a href="#step-6-obtain-json-wallet-and-passphrase" id="step-6-obtain-json-wallet-and-passphrase"></a>

To obtain the `JSON wallet` and `passphrase`, follow these steps:

* Open your folders, and go to the file you downloaded in Step 1.
* Right-click on the folder (the unzipped version), and click Copy (**Cmd + C** or **Ctrl + C**).

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

* Open your terminal (Mac) or command prompt (Windows), type `cd`, press the spacebar, and paste the folder path (**Cmd + V** or **Ctrl + V**).
* It should look something like: `cd /Users/username/Downloads/dci-cli-main`.
  * “username” is your Mac username (type whoami in terminal to check).
  * “Downloads” is where your file is stored.
  * “dci-cli-main” is the name of your folder.

{% hint style="info" %}
**Note**: If you stored or renamed your folder, the folder path may look different
{% endhint %}

* **Run this command:**&#x20;
  * **`npm i`**
* If it shows an error, follow the instructions and run the fix comman&#x64;**:**
  * **`npm audit fix --force`**
* Once all the issues are fixed, run this command:&#x20;
  * **`npx ts-node src/encrypt_wallet.ts`**
* Enter the private key of the wallet you are trying to create your vaults with.
* Set your `passphrase`
* After you have done so, a new keystore should be generated. It should look something like this: keystore/0xXXXXXXXXX.json. This will be your `JSON wallet.`
* Copy the `Json wallet` and `passphrase` into the config.json file.

<figure><img src="/files/FJKfP0hRL1y1CGTI7dzJ" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Obtain Vault Address

* Head over to the Subscribe & Earn section on Prodigy.Fi
* Select that vault you want to subscribe to by clicking on the "Subscribe" button

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

* On the bottom right hand corner, you will find the vault's address. Copy the vault address

<figure><img src="/files/rxtcbjkMYi0qGOyV3uEA" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Configure The Vault Subscription Command

* Now that you have copied the vault address, paste it in this program:

{% code overflow="wrap" %}

```
npx ts-node ./src/main.ts "<Blockchain>" subscribeVault --vault <vault address> --amount <amount>.
```

{% endcode %}

* Replace the `<vault address>` with the vault address you copied in step 8
* Replace `<amount>` with your desired subscription amount (eg; 100).
* Replace `<Blockchain>`  with the network you are subscribing to vaults on via Prodigy.Fi, (eg; Base Mainnet, Base Testnet)
* It should look something like this:

  <pre data-overflow="wrap"><code>npx ts-node ./src/main.ts "Base Mainnet" subscribeVault --vault 0x1a1f9604eab571b98adeb2c63fe11cc923c8f6d9 --amount 100.
  </code></pre>

{% hint style="info" %}
The vault address varies depending on the specific vault you choose to subscribe to.
{% endhint %}
{% endstep %}

{% step %}

### Run The Command

* Run the command from step 9 in your terminal or command prompt.
* Once the vault is created, you will see the message “Vault \<vault address> subscribed successfully”.

<figure><img src="/files/AulnQQLymiOXYSSWt6nj" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://prodigyfi.gitbook.io/structured-yields/build-with-prodigy.fi/trade-efficiently-introducing-the-api-tool/vault-subscription-api-guide.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
