๐ Wisp - Awesome Go Library for Bot Building

Event-driven trading framework for Go. Spot, perpetual futures, prediction markets. Multi-exchange (Bybit, Hyperliquid, Polymarket)
Detailed Description of Wisp
Wisp
Fast, deterministic backtesting and live trading for algorithmic strategies.
Build, backtest, and deploy trading strategies with a simple TUI interface.
Quick Start โข Features โข Documentation โข Examples
๐ What is Wisp?
Wisp is a low-code algorithmic trading framework that lets you write strategies in Go and deploy them to live markets. Strategies run directly in the framework with minimal setup and maximum control.
What Wisp Does For You
โ Event-Driven Execution - Write Go code that owns its own run loop, no polling or framework callbacks โ Interactive TUI - Beautiful terminal interface for managing strategies and monitoring live trades โ Multi-Exchange Support - Unified API across Hyperliquid, Bybit, Paradex, Polymarket, and Gate.io โ Real-Time Monitoring - Live orderbook, P&L, positions, and trade data via Unix sockets โ Graceful Lifecycle Management - HTTP-based process control for reliable starts and stops โ Production-Ready - Deploy strategies to live markets with confidence
๐ฆ Installation
Install via Go
go install github.com/wisp-trading/wisp@latest
Build from Source
git clone https://github.com/wisp-trading/wisp
cd wisp
go build -o wisp
sudo mv wisp /usr/local/bin/
Verify Installation
wisp version
โก Quick Start
1. Initialize a New Project
mkdir my-trading-bot && cd my-trading-bot
wisp
# Navigate to: ๐ Create New Project
This creates:
my-trading-bot/
โโโ config.yml # Framework configuration
โโโ exchanges.yml # Exchange credentials & settings
โโโ strategies/
โโโ momentum/
โโโ config.yml # Strategy metadata
โโโ main.go # Strategy implementation
2. Write Your Strategy
Create your strategy in strategies/momentum/main.go:
package main
import (
"context"
"time"
"github.com/wisp-trading/sdk/pkg/types/connector"
"github.com/wisp-trading/sdk/pkg/types/strategy"
"github.com/wisp-trading/sdk/pkg/types/wisp"
)
type MyStrategy struct {
strategy.BaseStrategy
k wisp.Wisp
}
func NewStrategy(k wisp.Wisp) strategy.Strategy {
s := &MyStrategy{k: k}
s.BaseStrategy = *strategy.NewBaseStrategy(strategy.BaseStrategyConfig{Name: "my-strategy"})
return s
}
func (s *MyStrategy) Start(ctx context.Context) error {
return s.StartWithRunner(ctx, s.run)
}
func (s *MyStrategy) run(ctx context.Context) {
ticker := time.NewTicker(5 * time.Minute)
defer ticker.Stop()
pair := s.k.Pair("BTC", "USDT")
for {
select {
case <-ctx.Done():
return
case <-ticker.C:
// Fetch klines
klines := s.k.Spot().Klines(connector.Hyperliquid, pair, "1h", 14)
// Calculate RSI
rsi, _ := s.k.Indicators().RSI(klines, 14)
if len(rsi) == 0 {
continue
}
currentRSI := rsi[len(rsi)-1]
// Oversold: buy
if currentRSI < 30 {
signal, _ := s.k.Spot().Signal(s.GetName()).
Buy(pair, connector.Hyperliquid, s.k.Asset("BTC").Qty(0.01)).
Build()
s.Emit(signal)
}
// Overbought: sell
if currentRSI > 70 {
signal, _ := s.k.Spot().Signal(s.GetName()).
Sell(pair, connector.Hyperliquid, s.k.Asset("BTC").Qty(0.01)).
Build()
s.Emit(signal)
}
}
}
}
3. Configure Your Strategy
Edit strategies/momentum/config.yml:
name: momentum
display_name: "Momentum Strategy"
description: "RSI-based momentum trading"
type: momentum
exchanges:
- hyperliquid
assets:
hyperliquid:
- BTC/USDT
- ETH/USDT
indicators:
rsi:
period: 14
oversold: 30
overbought: 70
parameters:
position_size: 0.1
4. Deploy to Live Trading
wisp
# Navigate to: Strategies โ momentum โ Start Live
Your strategy runs as a detached process, continuing even after you close the CLI.
5. Monitor Live Strategies
wisp
# Navigate to: Monitor
Real-time monitoring dashboard shows:
- Overview: Strategy status, uptime, health
- Positions: Active positions across exchanges
- Orderbook: Live orderbook depth
- Trades: Recent trade history
- PnL: Realized/unrealized profit & loss
6. Stop a Running Strategy
# From Monitor view:
# 1. Select running instance
# 2. Press [S]
# 3. Confirm "Yes, Stop"
Graceful HTTP-based shutdown ensures clean process termination.
๐ฏ Features
Strategy Development
- Event-Driven Architecture - Own your run loop with
Start()andrun()methods, no polling framework - Goroutine-Native - Leverage Go's concurrency without fighting the runtime
- Type-Safe API - Full IDE support with autocomplete
- Rich Indicators - RSI, MACD, Bollinger Bands, EMA, SMA, ATR, Stochastic and more
- Multi-Asset - Trade multiple assets simultaneously
- Multi-Exchange - Execute across multiple exchanges in one strategy
Live Trading
- Process Isolation - Each strategy runs in its own process
- Detached Execution - Strategies continue after CLI closes
- State Persistence - Instance state survives CLI restarts
- Real-Time Data - WebSocket + REST hybrid ingestion
- Position Tracking - Automatic position reconciliation
- Trade Backfill - Recovers trades on restart
Monitoring
- Unix Socket Communication - Fast, local IPC
- HTTP API - RESTful access to strategy data
- Live Orderbook - Real-time order book updates
- PnL Tracking - Realized and unrealized profit/loss
- Health Checks - System health and error reporting
- Multi-Instance - Monitor multiple strategies at once
Exchange Support
| Exchange | Spot | Perpetual | Prediction |
|---|---|---|---|
| Hyperliquid | - | โ | - |
| Bybit | โ | โ | - |
| Paradex | โ | โ | - |
| Polymarket | - | - | โ |
| Gate.io | โ | - | - |
User Interface
- Beautiful TUI - Built with Bubble Tea
- Keyboard Navigation - Vim-style keybindings (hjkl)
- Responsive Design - Adapts to terminal size
- Color Coding - Visual status indicators
- Progress Tracking - Real-time backtest progress
๐ Documentation
Full Documentation: https://usewisp.dev/docs
Key Resources
- Getting Started - Installation and first steps
- Writing Strategies - 13 strategy patterns with examples
- Strategy Examples - Real strategies from basic to advanced
- API Reference - Complete API documentation
- Architecture - How Wisp works
๐จ Screenshots
Main Menu
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ WISP CLI v0.1.0 โ
โ โ
โ What would you like to do? โ
โ โ
โ โถ ๐ Strategies โ
โ ๐ Monitor โ
โ โ๏ธ Settings โ
โ โน๏ธ Help โ
โ ๐ Create New Project โ
โ โ
โ โโ/jk Navigate โต Select q Quit โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Live Monitoring
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ MONITOR โ
โ โ
โ STATUS STRATEGY PID UPTIME PNL HEALTH โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ RUN momentum 86697 2h 30m +$125.50 โโโโโโโ โ
โ STP arbitrage - - -$43.20 โโโโโ โ
โ โ
โ [โโ] Navigate โข [Enter] Details โข [S] Stop โข [R] Refresh โข [Q] Back โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Orderbook View
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ ORDERBOOK - BTC/USDT (hyperliquid) โ
โ โ
โ ASKS โ
โ 43,251.50 โโโโโโโโโโ 0.5420 $23,456 โ
โ 43,250.00 โโโโโโโโโโ 0.3210 $13,888 โ
โ 43,249.50 โโโโโโโโโโ 0.1890 $8,174 โ
โ โ
โ BIDS โ
โ 43,248.00 โโโโโโโโโโ 0.8920 $38,577 โ
โ 43,247.50 โโโโโโโโโโ 0.6540 $28,284 โ
โ 43,247.00 โโโโโโโโโโ 0.4320 $18,683 โ
โ โ
โ Spread: $3.50 (0.008%) Last: 43,248.75 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ WISP CLI (TUI) โ
โ โข Strategy Browser โข Monitor โข Live Trading โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ INSTANCE MANAGER (Process Control) โ
โ โข Load strategies โข Start/Stop โข State Persistence โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโดโโโโโโโโโโโโโ
โผ โผ
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ Strategy Processโ โ Strategy Processโ
โ โโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโ โ
โ โStrategy Go โ โ โ โStrategy Go โ โ
โ โ Code โ โ โ โ Code โ โ
โ โโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโ โ
โ โ SDK Core โ โ โ โ SDK Core โ โ
โ โโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโ โ
โ โ Monitoring โ โ โ โ Monitoring โ โ
โ โ Server โ โ โ โ Server โ โ
โ โโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโ โ
โโโโโโโโโโฌโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโโ
โ โ
โโโโโโโโโโโโโฌโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโ
โ EXCHANGES โ
โ โข Hyperliquid โ
โ โข Bybit โ
โ โข Paradex โ
โโโโโโโโโโโโโโโโโโโโโโโ
Key Components
- CLI - Interactive terminal interface for managing strategies
- Instance Manager - Controls strategy lifecycle (start/stop/monitor)
- Strategy Runtime - Loads and executes Go strategies
- SDK Runtime - Core execution engine with data ingestion
- Monitoring Server - HTTP API exposed via Unix sockets
- Exchange Connectors - Unified interface to multiple exchanges
๐ง Commands
Interactive Mode (Default)
wisp
Launches the TUI interface with full navigation.
CLI Mode
wisp --cli # Show command help
wisp version # Show version info
๐ Example Strategies
Momentum (RSI-Based)
func (s *momentumStrategy) run(ctx context.Context) {
ticker := time.NewTicker(5 * time.Minute)
defer ticker.Stop()
pair := s.k.Pair("BTC", "USDT")
for {
select {
case <-ctx.Done():
return
case <-ticker.C:
klines := s.k.Spot().Klines(connector.Hyperliquid, pair, "1h", 14)
rsi, _ := s.k.Indicators().RSI(klines, 14)
if len(rsi) == 0 {
continue
}
current := rsi[len(rsi)-1]
if current < 30 {
signal, _ := s.k.Spot().Signal(s.GetName()).
Buy(pair, connector.Hyperliquid, s.k.Asset("BTC").Qty(0.1)).
Build()
s.Emit(signal)
}
if current > 70 {
signal, _ := s.k.Spot().Signal(s.GetName()).
Sell(pair, connector.Hyperliquid, s.k.Asset("BTC").Qty(0.1)).
Build()
s.Emit(signal)
}
}
}
}
Cross-Exchange Trading
func (s *crossExchangeStrategy) run(ctx context.Context) {
ticker := time.NewTicker(1 * time.Minute)
defer ticker.Stop()
pair := s.k.Pair("BTC", "USDT")
for {
select {
case <-ctx.Done():
return
case <-ticker.C:
// Fetch price data from both exchanges
bybitPrice := s.k.Spot().Klines(connector.Bybit, pair, "1m", 1)
hyperliquidPrice := s.k.Spot().Klines(connector.Hyperliquid, pair, "1m", 1)
if len(bybitPrice) == 0 || len(hyperliquidPrice) == 0 {
continue
}
// Compare prices and execute on spread
spread := bybitPrice[0].Close.Sub(hyperliquidPrice[0].Close)
// If profitable spread detected, trade both sides
if spread.GreaterThan(numerical.Zero) {
buy, _ := s.k.Spot().Signal(s.GetName()).
Buy(pair, connector.Hyperliquid, s.k.Asset("BTC").Qty(0.5)).
Build()
s.Emit(buy)
sell, _ := s.k.Spot().Signal(s.GetName()).
Sell(pair, connector.Bybit, s.k.Asset("BTC").Qty(0.5)).
Build()
s.Emit(sell)
}
}
}
}
๐ค Contributing
We welcome contributions! Here's how you can help:
Development Setup
# Clone the repo
git clone https://github.com/wisp-trading/wisp
cd wisp
# Install dependencies
go mod download
# Run tests
go test ./...
# Build
go build -o wisp
Running Tests
# All tests
go test ./...
# Specific package
go test ./internal/services/monitoring/...
# With coverage
go test -cover ./...
# Watch mode
ginkgo watch -r
Code Style
- Use
gofmtfor formatting - Follow Effective Go guidelines
- Write tests with Ginkgo and Gomega
- Use mockery for mocks
Areas We Need Help
- ๐ Additional exchange connectors
- ๐ More technical indicators
- ๐ Documentation improvements
- ๐ Bug fixes and testing
- ๐จ UI/UX enhancements
๐บ๏ธ Roadmap
v0.2.0 (Q1 2026)
- WebSocket-based live monitoring dashboard
- Strategy performance comparison tool
- Paper trading mode
- Discord/Telegram notifications
- Portfolio optimization tools
v0.3.0 (Q2 2026)
- Cloud deployment support
- Strategy marketplace
- Multi-user support
- Advanced risk management
- Machine learning integration
v1.0.0 (Q3 2026)
- Enterprise features
- Professional support
- Advanced analytics suite
โ FAQ
Q: Is Wisp suitable for production trading? A: Yes, but use appropriate risk management. Start with small positions and paper trading.
Q: What exchanges are supported? A: Currently only Hyperliquid perpetuals are stable in production. Bybit and Paradex are in active development.
Q: Can I run multiple strategies simultaneously? A: Yes! Each strategy runs in its own isolated process.
Q: How do I handle API keys securely?
A: Store them in exchanges.yml with proper file permissions (chmod 600).
Q: Can I write strategies in languages other than Go? A: Wisp strategies must be written in Go to run in the framework. However, you can integrate machine learning models from any language using:
- gRPC - Call ML inference services in Python, R, or any language
- ONNX Runtime - Load pre-trained models directly in Go
- HTTP APIs - Connect to external prediction services
๐ Troubleshooting
Strategy Won't Start
# Ensure Go version matches
go version # Should be 1.24+
# Check strategy code for syntax errors
# The CLI will show runtime errors during startup
# Verify imports are correct
grep -r "github.com/wisp-trading/sdk" strategies/momentum/main.go
# Check file permissions
chmod 644 strategies/momentum/main.go
If you see errors when starting a strategy, check your Go source code for syntax or import errors. The CLI will display the exact error message.
Process Won't Stop
# Find the process
ps aux | grep momentum
# Force kill
kill -9 <PID>
# Clean up socket files
rm ~/.wisp/sockets/*.sock
"Already Running" Error
# Check for orphaned processes
ps aux | grep wisp
# Clean up state files
rm ~/.wisp/instances/*/state.json
๐ License
MIT License - see LICENSE for details.
๐ Acknowledgments
Built with:
- Bubble Tea - TUI framework
- Lipgloss - Style definitions
- Cobra - CLI commands
- Fx - Dependency injection
- Ginkgo - Testing framework
๐ Support
- ๐ Documentation
- ๐ฌ Discord Community (coming soon)
- ๐ Issue Tracker
- โ๏ธ Email Support (for enterprise)
โญ If you find Wisp useful, please consider starring the repo! โญ
Made with โค๏ธ by the Wisp Team