Automated Trading with OpenClaw and Hyperliquid
OpenClaw's trading assistant, built in partnership with nof1.ai, brings AI-powered trading with strict risk controls to anyone who can run a Linux or Mac machine. This guide goes beyond basic setup to cover the full range of automation options: cron scheduling, webhook triggers, multi-strategy orchestration, external broker integration via OpenAlgo, and troubleshooting production deployments.
If you are looking for the basics, start with the Trading Bot Setup Guide. This guide assumes you already have OpenClaw running with a connected Hyperliquid account.
How OpenClaw Trading Architecture Works
Before diving into advanced configuration, it helps to understand how the pieces fit together:
External Data Sources OpenClaw Core Execution
───────────────────── ─────────────── ─────────
X/Twitter Sentiment ──────► Claude LLM Engine ──────► Hyperliquid L1
News APIs ──────► (Opus 4.5) │ (< 1 second)
On-chain Data ──────► Strategy Layer ──────► Polymarket
Webhooks/Cron ──────► Risk Manager │ (via skill)
Human-in-Loop ◄───┘ OpenAlgo Brokers
│ (25+ supported)
▼
Telegram/WhatsApp
(Notifications + Approval)
The core insight: Claude acts as the reasoning layer, while hardcoded risk rules and human approval gates ensure the AI cannot exceed defined limits regardless of what it decides.
Advanced Configuration: openclaw.json
The full trading configuration goes beyond the basics in the setup guide. Here is a production-grade config with all options documented:
{
"skills": {
"trading": {
"enabled": true,
"exchange": "hyperliquid",
"network": "mainnet",
"riskControls": {
"maxPositionSize": 0.02, // 2% max per trade (hardcoded max: 5%)
"dailyLossLimit": 0.03, // Stop at 3% daily drawdown
"weeklyLossLimit": 0.08, // Stop at 8% weekly drawdown
"maxOpenPositions": 5, // Max concurrent positions
"requireApproval": 500, // Human approval for trades > $500
"circuitBreaker": 0.05, // Halt all trading at 5% drawdown
"cooldownAfterBreaker": "4h", // Resume after 4 hours
"trendFilter": true, // Only trade with MA trend
"autoBench": 3, // Bench strategy after 3 consecutive losses
"benchDuration": "7d" // Bench period
},
"execution": {
"slippageTolerance": 0.001, // 0.1% max slippage
"orderType": "limit", // limit | market | twap
"twapDuration": "5m", // For TWAP orders
"retryOnFail": true,
"maxRetries": 3,
"confirmationTimeout": "30s"
},
"notifications": {
"onTrade": true,
"onOpportunity": true, // Alert before executing
"onPnLChange": true,
"pnlThreshold": 0.02, // Alert at 2% PnL change
"onStrategyBenched": true,
"onCircuitBreaker": true,
"onDailyReport": true,
"dailyReportTime": "18:00"
}
}
}
}
Strategy Management
Running Multiple Strategies Simultaneously
OpenClaw supports running multiple strategies with independent risk budgets. Each strategy gets a slice of your total account equity:
{
"skills": {
"trading": {
"strategies": {
"smartDCA": {
"enabled": true,
"equityAllocation": 0.30, // 30% of account for this strategy
"assets": ["ETH", "BTC"],
"period": "daily",
"smartTiming": true
},
"momentum": {
"enabled": true,
"equityAllocation": 0.20, // 20% of account
"assets": ["BTC", "ETH", "SOL"],
"timeframes": ["1H", "4H"]
},
"sentiment": {
"enabled": false, // Disabled until backtested
"equityAllocation": 0.10
}
},
"globalRisk": {
"maxTotalExposure": 0.60, // 60% max total deployed
"maxCorrelatedExposure": 0.15 // 15% max in correlated assets
}
}
}
}
The maxTotalExposure setting is a portfolio-level circuit breaker. Even if each strategy wants to open positions, the global limit prevents the AI from over-deploying capital.
Scheduling Strategies with Cron
For time-based automation—DCA on specific hours, weekly rebalancing, daily reports—use the Heartbeat Engine with cron syntax:
{
"heartbeat": {
"tasks": [
{
"name": "daily-dca",
"cron": "0 14 * * *", // 2 PM UTC every day
"action": "trading.executeDCA",
"params": { "asset": "ETH", "amount": 50 }
},
{
"name": "weekly-rebalance",
"cron": "0 12 * * 0", // 12 PM UTC every Sunday
"action": "trading.rebalance",
"params": { "threshold": 0.05 }
},
{
"name": "market-scan",
"cron": "*/15 * * * *", // Every 15 minutes
"action": "trading.scanOpportunities"
},
{
"name": "daily-pnl-report",
"cron": "0 18 * * *", // 6 PM UTC daily
"action": "trading.report",
"notify": true
}
]
}
}
Example cron patterns:
| Schedule | Cron Expression |
|---|---|
| Every hour | 0 * * * * |
| Every 15 minutes | */15 * * * * |
| Daily at 9 AM UTC | 0 9 * * * |
| Weekdays at market open (3:30 PM UTC) | 30 15 * * 1-5 |
| Weekly on Sundays at noon | 0 12 * * 0 |
| First of each month | 0 0 1 * * |
Webhook-Based Triggers
For event-driven automation—execute a trade when an external signal fires—use OpenClaw's webhook receiver:
# Enable webhook server
openclaw webhook enable --port 8080
# Your webhook endpoint:
# https://your-server.com/webhook/trading?key=YOUR_WEBHOOK_SECRET
Configure the webhook secret in your vault:
openclaw vault set WEBHOOK_SECRET your-random-secret-here
Now any external service (TradingView alerts, Zapier, your own scripts) can trigger OpenClaw trades:
# Example: TradingView alert JSON
# Set as the "Message" in TradingView alert:
{
"action": "trade",
"strategy": "momentum",
"signal": "long",
"asset": "{{ticker}}",
"strength": "high"
}
# OpenClaw receives this, evaluates it through Claude,
# and decides whether to execute based on current conditions
Important: Webhook signals are not automatically executed. Claude evaluates each signal against current market conditions and risk rules before deciding to act. This prevents blindly following bad signals.
{
"webhooks": {
"enabled": true,
"port": 8080,
"requireClaude": true, // Claude must approve before execution
"maxSignalAge": "5m", // Ignore signals older than 5 minutes
"rateLimit": {
"maxSignals": 10,
"perMinute": 1
}
}
}
Sentiment Monitoring Configuration
The Vibe Watcher module continuously monitors social media and news for high-impact events. Configure which sources and accounts to follow:
{
"sentimentMonitor": {
"enabled": true,
"twitter": {
"accounts": [
"@POTUS", // US President
"@elonmusk", // Market-moving individual
"@federalreserve", // Fed announcements
"@whale_alert", // On-chain whale moves
"@DefiLlama", // DeFi data
"@tier10k" // Crypto analysis
],
"keywords": [
"interest rates",
"SEC crypto",
"Bitcoin ETF",
"Ethereum upgrade"
],
"sentimentThreshold": 0.75 // 0-1 scale, 0.75 = strong signal
},
"news": {
"sources": ["coindesk", "theblock", "decrypt", "reuters"],
"categories": ["crypto", "macro", "regulation"],
"breakingNewsAlert": true // Immediate alert on breaking news
},
"onChain": {
"whaleThreshold": 1000000, // Alert on $1M+ moves
"exchangeFlows": true, // Monitor exchange inflows/outflows
"fundingRates": true // Track perpetual funding rates
}
}
}
When sentiment triggers, OpenClaw evaluates whether it represents a trading opportunity and alerts you through your configured messaging channel:
OpenClaw: 🚨 Sentiment Alert
POTUS tweet detected: [quote]
Claude's assessment: Likely bearish for BTC (-8-15% probability)
Confidence: 72%
Suggested action: Consider reducing BTC long exposure
[Approve Trade] [Review More] [Ignore]
Integration: OpenAlgo for Traditional Brokers
Hyperliquid is excellent for crypto, but some traders want to execute on traditional brokers (Indian equity markets, US stocks, futures). OpenAlgo bridges OpenClaw to 25+ brokers:
# Install OpenAlgo integration
openclaw skills install openalgo-bridge
# Store your OpenAlgo credentials
openclaw vault set OPENALGO_HOST http://localhost:5000
openclaw vault set OPENALGO_API_KEY your-openalgo-key
Supported brokers through OpenAlgo include Zerodha, Groww, Fyers, Angel One, Alice Blue (Indian market), plus Alpaca, Interactive Brokers, and others for global markets.
{
"openalgo": {
"enabled": true,
"defaultBroker": "zerodha",
"strategies": {
"intraday": {
"broker": "zerodha",
"exchange": "NSE",
"maxPositionSize": 0.02
},
"usstocks": {
"broker": "alpaca",
"exchange": "NASDAQ"
}
}
}
}
With this setup, OpenClaw can execute the same AI-driven strategy logic across both crypto (Hyperliquid) and traditional equity markets from a single interface.
Managing the Self-Improvement Loop
OpenClaw records every trade's expected outcome (Claude's prediction) versus the actual outcome. This data feeds the self-improvement loop:
# View strategy performance metrics
openclaw trading report --strategy momentum --period 30d
# Output example:
# Momentum Strategy (30d)
# ─────────────────────────
# Total Trades: 47
# Win Rate: 61.7%
# Avg Win: +2.3%
# Avg Loss: -1.1%
# Sharpe Ratio: 1.8
# Max Drawdown: 4.2%
# Strategy Status: Active ✓
#
# Claude Prediction Accuracy: 64%
# Model Calibration: Well-calibrated (expected vs actual within 8%)
Strategies that fall below performance thresholds are automatically benched:
# Manually bench a strategy
openclaw trading bench --strategy sentiment --reason "poor recent performance"
# View benched strategies
openclaw trading list --benched
# Re-enable after review
openclaw trading enable --strategy sentiment
Human-in-the-Loop Controls
The approval system is one of OpenClaw's most important safety features. Configure thresholds carefully:
{
"humanApproval": {
"tradeThreshold": 500, // Approval required for any trade > $500
"newAsset": true, // Always approve first trade in any asset
"afterCircuitBreaker": true, // Always approve first trade after CB fires
"highVolatility": {
"enabled": true,
"vixThreshold": 30 // Always approve during high-volatility periods
},
"approvalTimeout": "10m", // Auto-cancel if not approved within 10 minutes
"approvalChannel": "telegram"
}
}
The Telegram approval message includes everything you need to decide quickly:
OpenClaw: Trade Request — Approval Needed
─────────────────────────────────────────
Action: Long ETH-PERP
Size: $750 (1.5% of equity)
Entry: $3,847 (current market)
Stop Loss: $3,770 (-2%)
Take Profit: $4,000 (+4%)
Strategy: Momentum
Reasoning: Strong MA alignment on 1H and 4H, positive funding
rate, 15% volume spike, bullish sentiment from whale alert
Confidence: 78%
[✅ Approve] [❌ Reject] [📊 See More Data] [⏸ Pause All]
Running OpenClaw on a VPS (24/7 Trading)
For continuous trading, run OpenClaw on a VPS rather than your local machine:
# Recommended VPS specs for trading:
# - 2 vCPU, 2GB RAM minimum
# - Ubuntu 22.04 LTS
# - $5-10/month (DigitalOcean, Hetzner, Vultr)
# Install OpenClaw on VPS
curl -fsSL https://get.openclawai.me | sh
# Set up as system service
openclaw service install
# Enable auto-start
sudo systemctl enable openclaw
sudo systemctl start openclaw
# Check status
openclaw status
Security for VPS deployments:
- Use SSH key authentication only—disable password login
- Configure a firewall to block all ports except SSH and your webhook port
- Store credentials only in the vault, never in environment variables or plain text
- Enable OpenClaw's audit log to track all AI actions
# Enable audit logging
openclaw config set auditLog.enabled true
openclaw config set auditLog.path /var/log/openclaw/audit.log
# View recent audit log
openclaw audit tail -n 50
Troubleshooting Common Issues
Trades Not Executing
# Check skill is enabled and configured
openclaw skills status trading
# Check Hyperliquid connection
openclaw trading ping
# Check vault credentials are set
openclaw vault list
# Check risk limits (trade may be blocked by risk rules)
openclaw trading check --asset ETH --size 100
# Output: "Would be blocked: exceeds daily loss limit"
Strategy Getting Benched Repeatedly
# View strategy bench history
openclaw trading bench-history --strategy momentum
# Run paper trading to diagnose
openclaw trading paper --strategy momentum --duration 7d
# After paper trading, view detailed analysis
openclaw trading report --last-paper --detailed
# Adjust strategy parameters based on insights
# Then re-enable with modified config
High API Costs
Claude API costs can escalate if sentiment monitoring is too aggressive:
# View API usage breakdown
openclaw billing report --period 7d
# Reduce API calls by adjusting scan frequency
# In config: change market-scan cron from "*/5" to "*/15"
# Disable sentiment monitoring during off-hours
{
"sentimentMonitor": {
"schedule": {
"enabled": "0 6 * * *", // Enable at 6 AM UTC
"disabled": "0 22 * * *" // Disable at 10 PM UTC
}
}
}
Missed Trading Opportunities
If Claude is too conservative:
# Check confidence thresholds—they may be too high
openclaw trading config get minConfidence
# Lower slightly if appropriate for your risk tolerance
# Review benched strategies that might be missing opportunities
openclaw trading list --benched
# Check if circuit breaker fired
openclaw trading status
# If "Circuit Breaker: Active", trading is halted
# Resume: openclaw trading resume --confirm
Daily Workflow: You as CIO
OpenClaw is designed for a specific workflow: you set strategy and risk parameters, OpenClaw executes. The recommended daily routine:
Morning (5-10 minutes):
- Review overnight trade notifications in Telegram
- Check the daily performance report sent at 6 PM UTC
- Approve or reject any pending large-trade requests
Weekly (15-20 minutes):
- Review the weekly performance report
- Check for benched strategies and decide whether to re-enable
- Adjust risk parameters if market conditions have changed significantly
- Review audit log for any unexpected AI actions
Monthly (30-45 minutes):
- Run a full backtest on each active strategy with the past month's data
- Compare actual performance to backtest predictions
- Consider enabling or disabling strategies based on current regime
- Review and update sentiment monitoring sources
# Complete monthly review commands
openclaw trading report --period 30d --all-strategies
openclaw trading backtest --strategy all --period 30d
openclaw trading bench-history --period 30d
openclaw audit summary --period 30d
Risk Disclaimer
Trading cryptocurrencies and synthetic assets carries significant risk of financial loss. OpenClaw's hardcoded risk controls reduce but do not eliminate this risk. No automated system can predict markets reliably. The AI can and will make mistakes. Past performance does not guarantee future results. Start with small amounts, backtest thoroughly, and only trade with capital you can afford to lose. This guide is for educational purposes and is not financial advice.