listen
started sa Solana Swiss-Knife toolkit for algorithmic trading, its mission is to become the go-to framework for AI portfolio management agents
graph TB
subgraph "Rig Agent Kit by Listen"
RAK[RIG Agent Kit]
RAK_MT[Multi-tenant Stream Manager]
RAK_WALLET[Delegated Wallet Manager]
RAK --> RAK_MT
RAK --> RAK_WALLET
end
subgraph "Listen Trading Engine"
LTE[Trading Engine]
ORDER_COL[Order Collector]
PIPE[Pipeline Executor]
EXEC[Order Executor]
ORDER_COL --> PIPE
PIPE --> EXEC
LTE --> ORDER_COL
end
subgraph "Listen Data Service"
LDS[Data Service]
SUB[Substreams Indexer]
DB[(Clickhouse OLAP)]
PRICE[Price Stream]
SUB -->|Index Solana Slots| DB
LDS --> PRICE
LDS --> DB
end
%% External Systems
MOBILE[Mobile App]
CHAIN((Blockchain))
PRIVY((Privy))
WALLET[(Solana/EVM Wallets)]
%% Connections
RAK -->|Tool Calls| CHAIN
RAK -->|Execute Trades| LTE
LDS -->|Pricing Updates| LTE
LDS -->|Enriched Data| MOBILE
MOBILE -->|User Intents| RAK
LTE -->|Sign & Send Tx| CHAIN
DB -->|Query Data| RAK
RAK_WALLET -->|Integration| PRIVY
PRIVY --> WALLET
- 🔍 Real-time transaction monitoring
- 💱 Multi-DEX swap execution (Pump.fun, Jupiter V6 API or Raydium)
- 🚀 Blazingly fast transactions thanks to Jito MEV bundles
- 📊 Price tracking and metrics
- 🧰 Token management utilities
- 📈 Performance monitoring with Prometheus integration
And more!
It works plug'n'play with $arc rig framework framework allowing AI Agents interact with the Solana blockchain, see example: src/agent.rs and the output image.
For complete rundown of features, check out the CLI output of cargo run
or the
documentation.
To play around with listen-rs, you can use the UI
Fill in the .env.example
and ./dashboard/.env.example
, copy over to .env
and ./dashboard/.env.example
, then
docker compose up
You can then access the dashboard over http://localhost:4173
Warning
listen-rs is undergoing rapid iterations, some things might not work and there could be breaking changes
-
System Dependencies
- Rust (with nightly toolchain)
protoc
build-essential
pkg-config
libssl-dev
-
Configuration
- Copy
.env.example
to.env
- Set up
auth.json
for JITO authentication (optional, gRPC HTTP/2.0 searcher client) - Populate
fund.json
- Copy
Both keypairs are in solana-keygen
format, array of 64 bytes, 32 bytes
private key and 32 bytes public key.
# Install dependencies
sudo apt install protoc build-essential pkg-config libssl-dev
# Build
cargo build --release
# Run services
./run-systemd-services.sh
cargo run -- listen \
--worker-count [COUNT] \
--buffer-size [SIZE]
cargo run -- swap \
--input-mint sol \
--output-mint EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--amount 10000000
Warning
Default configuration is set for mainnet with small transactions. Ensure proper configuration for testnet usage and carefully review code before execution.
Listen includes built-in metrics exposed at localhost:3030/metrics
. To visualize:
- Start Prometheus:
prometheus --config=prometheus.yml
- Access metrics at
localhost:3030/metrics
Grafana should show something like this
The stackcollapse.pl
can be installed through
gh repo clone brendangregg/FlameGraph && \
sudo cp FlameGraph/stackcollapse.pl /usr/local/bin && \
sudo cp FlameGraph/flamegraph.pl /usr/local/bin
Profile swap performance using DTrace to produce a flamegraph:
./hack/profile-swap.sh
![image](https://private-user-images.githubusercontent.com/63755291/328029163-699405b7-adf0-448b-89c1-ba71152dc72b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NTE0MTIsIm5iZiI6MTczODg1MTExMiwicGF0aCI6Ii82Mzc1NTI5MS8zMjgwMjkxNjMtNjk5NDA1YjctYWRmMC00NDhiLTg5YzEtYmE3MTE1MmRjNzJiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDE0MTE1MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI3MTU4MTAwYWNlNDlmNDk1OWY4ZmI1M2U0OThiNjZlZmI1NWRmMWQ5N2ViOGQ4N2IxYzhjMjY5NzIzYWQ4OWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.oVgA3Yt7qd6auzangYWg_qAoVLwQ5F00p1iumMjayig)