jupbot-cli
v0.1.5
Published
The CLI for Jupbot Solana smart contracts
Readme
This repository contains Solana smart contracts and a CLI client. The contracts provide enhanced functionality for OKX DEX and are designed to support additional DEXes in the future. Enhanced features include order creation, closing, and support for various order types such as take profit/stop loss (TP/SL), limit orders, and more.
Jupbot CLI
🛠️ Installation & Setup Guide
This guide explains how to install jupbot-cli and configure it with an environment file in your home directory.
☑️ Prerequisites
Before installing jupbot-cli, make sure you have the following tools installed:
Recommended: Use nvm (Node Version Manager) to install and manage Node.js versions. This makes it easy to upgrade or switch Node.js versions as needed.
To install nvm, follow the official setup guide: https://github.com/nvm-sh/nvm
After installing nvm, install the latest LTS version of Node.js:
nvm install --lts nvm use --lts
You can check your installed versions with:
node --version
npm --version📥 Installation
Install jupbot-cli globally using npm:
npm install -g jupbot-cliHome Directory & Environment File
By default, jupbot-cli looks for its configuration file in your home directory as
~/.jupbot-cli.env.
Open (or create) the .jupbot-cli.env file in your home directory:
nano ~/.jupbot-cli.envAdd your configuration variables, for example:
ANCHOR_WALLET=test-keys/deployer.json
ANCHOR_PROVIDER_URL=https://api.mainnet-beta.solana.com
# HELIUS_API_KEY is required for using the Helius API for priority fee
HELIUS_API_KEY=<YOUR_HELIUS_API_KEY>
# TRANSPORT configuration:
# Set TRANSPORT to either "direct" (default) or "squads".
# If TRANSPORT is "squads", you must also set MULTISIG_PDA and VAULT_INDEX.
TRANSPORT=direct
# Required only if TRANSPORT=squads
# MULTISIG_PDA=<YOUR_MULTISIG_PDA>
# VAULT_INDEX=<YOUR_VAULT_INDEX>🏢 Production Usage & Governance
Important Note for Production Deployments:
In production environments, the
squadstransport is used. CLI admin commands do not execute changes directly—they create proposals for voting in the Squads multisig. The key configured for jupbot-cli must be added to the Squads multisig with the "proposer" role only. This allows the CLI to submit proposals, while actual voting and approval are performed by users via the Squads portal, which supports hardware and browser wallets.
Typical workflow for proposal creation:
Install Solana CLI
Follow the official installation guide: Solana CLI InstallationGenerate a new keypair for proposals
Run:solana-keygen new -o ~/jupbot-proposer-keypair.json⚠️ Security Note: The generated file is a raw keypair and grants full access to your proposer identity. Never share this file with anyone, and always store it in a secure, private location (such as an encrypted disk or password manager). Treat it as you would any sensitive private key.
Request multisig onboarding
Ask the Squads multisig creator/admin to add your new public key (from the keypair above) to the multisig with the "proposer" role.Configure jupbot-cli
Set your CLI to use the generated keypair (e.g., setANCHOR_WALLET=~/jupbot-proposer-keypair.jsonin your config).
- For Squads transport, set
TRANSPORTtosquadsin your config. - You will also need to set
MULTISIG_PDAandVAULT_INDEX, which can be provided by the Squads creator or admin.
- Create proposals
Use jupbot-cli admin commands to submit proposals. Voting and approval are performed by multisig members in the Squads portal, which supports various wallet types (hardware, browser, etc).
This setup ensures secure, decentralized governance and compatibility with a wide range of wallet solutions.
📘 Admin Commands Cheat Sheet
This guide provides a detailed overview of admin-only commands in jupbot-cli. Use these commands to configure, manage, and control the jupbot.
🔑 General Notes
- Only the current admin can execute these commands.
- Some operations may require specifying public keys (PUBKEYs) or basis points (BPS).
- Basis Points (BPS):
100_000 BPS = 100% (so 1000 BPS = 1%).
Pause
Purpose: Temporarily disables jupbot activity. Use Case: Useful for emergency stops, maintenance, or when you want to prevent trades without changing other settings.
jupbot-cli admin pauseUnpause
Purpose: Resumes activity after being paused.
jupbot-cli admin unpauseDistribute Fees
Purpose: Sends collected fees to recipients as per configuration.
jupbot-cli admin distribute-feesUpdate Fee Recipients
Purpose: Resumes activity after being paused. Fee BPS: Write percentage shares in BPS format. Example: 50% = 50000, 25% = 25000.
jupbot-cli admin update-fee-recipients \
--recipient So11111111111111111111111111111111111111111:5000 \
--recipient So11111111111111111111111111111111111111111:5000Update Fees
Purpose: Updates the trading fee charged by the contract Fee BPS: Specify the order fee in BPS format. Example: 50% = 50000, 25% = 25000.
jupbot-cli admin update-fees \
--orderFeeBps 5000 \
--executorFeeLamports 10000000Add Executor
Purpose: Grants execution rights to a wallet.
jupbot-cli admin add-executor --executor So11111111111111111111111111111111111111111Revoke Executor
Purpose: Removes executor rights from a wallet.
jupbot-cli admin revoke-executor --executor So11111111111111111111111111111111111111111📋 Admin Commands Overview Table
| Command | Parameters | Purpose |
| ----------------------- | ------------------------------------------------------------------------------ | --------------------------------------------------------------------- |
| pause | – | Temporarily disables jupbot activity (emergency stop or maintenance). |
| unpause | – | Resumes jupbot activity after being paused. |
| distribute-fees | – | Distributes collected fees to recipients. |
| update-fee-recipients | --recipient <PUBKEY:BPS> (multiple allowed) | Updates the list of fee recipients and their shares. |
| update-fees | --orderFeeBps <BPS> --executorFeeLamports <LAMPORTS> (one or both of them) | Updates the trading and executor fees. |
| add-executor | --executor <PUBKEY> | Grants execution rights to a wallet. |
| revoke-executor | --executor <PUBKEY> | Removes execution rights from a wallet. |
✅ Use this table as a quick reference when working with jupbot-cli admin.
