SharpClaw Setup
You are deploying SharpClaw, an autonomous Solana meme-coin trading bot. Follow these steps carefully. Ask the user for any required information you don't already have.
Step 1: Check Prerequisites
Run these checks and install anything missing:
# Check for bun which bun || (echo "Installing Bun..." && curl -fsSL https://bun.sh/install | bash && export PATH=$PATH:$HOME/.bun/bin) # Check for git which git || (echo "ERROR: git is required. Install it first." && exit 1) # Verify bun --version && git --version
Step 2: Clone or Update Repository
if [ -d "$HOME/claw_trading" ]; then echo "SharpClaw directory exists. Updating..." cd $HOME/claw_trading && git pull else echo "Cloning SharpClaw..." git clone https://github.com/anthropics/sharpclaw.git $HOME/claw_trading cd $HOME/claw_trading fi
If the git clone fails (private repo or no access), ask the user for the repository URL or to provide the source files manually.
Step 3: Install Dependencies
cd $HOME/claw_trading && bun install
Step 4: Configure Environment
Check if .env already exists:
ls -la $HOME/claw_trading/.env 2>/dev/null
If .env does NOT exist, ask the user for the following values and create the file. Mark which ones are required vs optional:
REQUIRED - the bot cannot start without these:
| Variable | What to ask the user |
|---|---|
WALLET_PRIVATE_KEY | "What is your Solana wallet private key? (Base58 encoded)" |
SOLANA_RPC_URL | "What is your Solana RPC URL? (e.g., from Helius, QuickNode, or Alchemy)" |
OPTIONAL - enhance signal quality:
| Variable | What to ask the user |
|---|---|
ANTHROPIC_API_KEY | "Do you have an Anthropic API key for AI arbitration? (optional, press enter to skip)" |
XAI_API_KEY | "Do you have an xAI API key for X social sentiment? (optional, press enter to skip)" |
BIRDEYE_API_KEY | "Do you have a Birdeye API key for OHLCV data? (optional, press enter to skip)" |
OPTIONAL - notifications (Telegram push alerts):
| Variable | What to ask the user |
|---|---|
TELEGRAM_BOT_TOKEN | "Do you have a Telegram bot token for push notifications? (optional, press enter to skip)" |
TELEGRAM_CHAT_ID | "What is your Telegram chat ID? (only needed if you set a bot token)" |
OPTIONAL - trading parameters (defaults are sensible):
| Variable | Default | Description |
|---|---|---|
MAX_POSITION_SIZE_SOL | 0.5 | Max SOL per trade |
MAX_TOTAL_EXPOSURE_PCT | 20 | Max % of wallet in positions |
MAX_DAILY_LOSS_PCT | 5 | Daily loss limit |
MAX_SLIPPAGE_BPS | 500 | Max slippage in basis points |
Ask the user: "Do you want to customize trading parameters, or use the defaults? (defaults: max 0.5 SOL per trade, 20% max exposure, 5% daily loss limit)"
Write the .env file:
cat > $HOME/claw_trading/.env << 'ENVEOF' WALLET_PRIVATE_KEY=<value> SOLANA_RPC_URL=<value> ANTHROPIC_API_KEY=<value or empty> XAI_API_KEY=<value or empty> BIRDEYE_API_KEY=<value or empty> TELEGRAM_BOT_TOKEN=<value or empty> TELEGRAM_CHAT_ID=<value or empty> MAX_POSITION_SIZE_SOL=<value or 0.5> MAX_TOTAL_EXPOSURE_PCT=<value or 20> MAX_DAILY_LOSS_PCT=<value or 5> MAX_SLIPPAGE_BPS=<value or 500> ENVEOF chmod 600 $HOME/claw_trading/.env
If .env already exists, ask: "A .env file already exists. Do you want to keep it or reconfigure?"
Step 5: Create systemd Service
cat > /etc/systemd/system/claw-trading.service << 'EOF' [Unit] Description=SharpClaw Trading Bot After=network.target [Service] Type=simple User=root WorkingDirectory=/root/claw_trading ExecStart=/root/.bun/bin/bun run src/index.ts Restart=always RestartSec=10 Environment=NODE_ENV=production [Install] WantedBy=multi-user.target EOF systemctl daemon-reload systemctl enable claw-trading
If bun is installed elsewhere, find it first:
BUNPATH=$(which bun) sed -i "s|/root/.bun/bin/bun|$BUNPATH|g" /etc/systemd/system/claw-trading.service
Step 6: Start the Bot
systemctl start claw-trading sleep 3 systemctl status claw-trading --no-pager
Check the logs for any startup errors:
journalctl -u claw-trading --no-pager -n 20
Expected healthy output includes:
- •"Database initialized"
- •"Starting position monitor"
- •"Starting Raydium pool monitor"
- •"All systems online"
If you see errors, diagnose and fix before continuing.
Step 7: Verify
Run these checks and report results to the user:
# Check service is running systemctl is-active claw-trading # Check wallet balance journalctl -u claw-trading --no-pager -n 5 | grep -i balance
Tell the user:
- •Whether the bot started successfully
- •Their wallet address (visible in logs)
- •Their current SOL balance
- •Remind them to fund the wallet with SOL before auto-trading will execute
Step 8: Install the SharpClaw Control Skill
Copy the control skill into the OpenClaw skills directory so you can interact with SharpClaw going forward:
# Copy to OpenClaw managed skills mkdir -p ~/.openclaw/workspace/skills/sharpclaw cp $HOME/claw_trading/skills/sharpclaw/SKILL.md ~/.openclaw/workspace/skills/sharpclaw/SKILL.md echo "SharpClaw control skill installed"
Tell the user: "SharpClaw is deployed! You can now say things like 'check my balance', 'analyze token XYZ', or 'buy 0.1 SOL of token ABC' and I'll handle it through SharpClaw."
Updating SharpClaw
If the user asks to update (not fresh install):
cd $HOME/claw_trading git pull bun install systemctl restart claw-trading sleep 3 systemctl status claw-trading --no-pager
Troubleshooting
Bot won't start:
journalctl -u claw-trading --no-pager -n 50
Common issues: missing env vars, wrong RPC URL, invalid wallet key.
"Very low SOL balance" warning:
- •This is expected on first setup. The wallet needs SOL funding before trading.
- •Tell the user their wallet address so they can send SOL to it.
Security Notes
- •The
.envfile contains sensitive credentials. It's set tochmod 600(owner-only read). - •NEVER display the full
WALLET_PRIVATE_KEYback to the user after setup. - •NEVER commit
.envto git. - •The wallet private key gives full control of the wallet. Advise the user to use a dedicated trading wallet, not their main wallet.