Skip to main content
KaleidoAgent is an autonomous, non-custodial Bitcoin L2 agent. It holds no external custody: keys stay in the local WDK wallet and the RGB Lightning Node, and every trade settles as an atomic HTLC swap on Lightning. It manages a Lightning and RGB wallet, executes atomic HTLC swaps on the KaleidoSwap DEX, runs portfolio rebalancing and DCA strategies, keeps Lightning channel liquidity healthy, and serves as an interactive wallet-assistant chat, all driven by an LLM (Claude or OpenAI) reasoning over KaleidoCLI and MCP tool calls.
KaleidoAgent is a separate, always-on server. It does not currently embed KaleidoMind’s Engine and runs its own agent loop instead. See KaleidoMind’s relationship note for the convergence path being considered.

Capabilities

Architecture

Nanobot is the core runtime. It handles agent execution, cron scheduling, MCP tool integration, Telegram messaging, and memory. Node.js is a thin bridge that boots Nanobot and serves a local control-panel API on :4242.

Two Execution Modes

MCP Server Wiring

KaleidoAgent registers kaleido-mcp, the unified MCP server, as its primary tool source, giving it spark_*, wdk_*/rln_*, kaleidoswap_*, mpp_*/l402_*, and kaleido_node_* tools in one connection. Historically its config also referenced the now-archived standalone kaleidoswap-mcp and l402-gateway-mcp servers directly; since both are superseded by kaleido-mcp (see Retired Servers), new configurations should rely on kaleido-mcp alone rather than wiring those up separately. Remote, third-party MCP servers can be registered too, gated behind an API key check. For example, a Bitrefill gift-card MCP is only registered if a BITREFILL_API_KEY env var is present, since the upstream endpoint rejects anonymous connections.

Autonomous Loops

Each loop is driven by a skill.

Risk Controls

Risk limits live in agent.config.json under portfolio. They are checked before any swap is submitted.

Trading Modes

Atomic Swap Flow

Same 5-step HTLC protocol as elsewhere in the KaleidoSwap stack, driven via kaleido-mcp or the CLI:

Run It

Prerequisites: Node.js 20 or newer, KaleidoCLI in $PATH, the Nanobot runtime, and an Anthropic or OpenAI API key.
1

Clone and install

2

Set the API key

Set ANTHROPIC_API_KEY or OPENAI_API_KEY in .env. Use AGENT_PROVIDER to pick between anthropic and openai.
3

Configure the wallet and portfolio

Edit agent.config.json:
  • mcp.kaleido.env.WDK_SEED, the wallet mnemonic.
  • mcp.kaleido.env.RLN_NODE_URL, the RGB Lightning Node URL.
  • mcp.spark.env.WDK_SPARK_SEED, an optional separate Spark seed.
  • portfolio.targets, the target allocation across BTC, USDT, and XAUT.
  • portfolio.dry_run, keep true until the setup is verified.
Primary config lives in agent.config.json: model choice, MCP server commands and env, portfolio targets and risk limits, schedule intervals, and the enabled skill list. See the repo README for the full schema and environment variable reference.
4

Build and start

The dashboard serves on http://localhost:5173 and the local status API on http://localhost:4242. Use npm run daemon:start to run it as a background process instead.
For an isolated deployment, copy .env.container.example to .env.container and run the container stack:
agent.config.json holds a real BIP-39 mnemonic. Start on test networks, keep dry_run enabled until the setup is verified, and never commit or share the file.

Status API

The agent exposes a localhost-only control API on port 4242, used by the dashboard and callable directly.