Skip to main content

Bootstrap a single agent

AGENT_NAME=btc-alpha AGENT_STRATEGY=alternate AGENT_STATUS_PORT=8083 \
  pnpm --filter @darkpool/agent-service dev
The runtime reads from .env for everything else (AGENT_KEY, AGENT_PREDICT_MANAGER_ID, AGENT_TICK_MS, …). Fails fast on missing required vars.

A fleet of three

# Terminal E: Agent #1
AGENT_NAME=btc-alpha AGENT_STRATEGY=alternate AGENT_STATUS_PORT=8083 \
  pnpm --filter @darkpool/agent-service dev

# Terminal F: Agent #2
AGENT_NAME=btc-yes AGENT_STRATEGY=yes-only AGENT_STATUS_PORT=8084 \
  pnpm --filter @darkpool/agent-service dev

# Terminal G: Agent #3
AGENT_NAME=btc-no AGENT_STRATEGY=no-only AGENT_STATUS_PORT=8085 \
  pnpm --filter @darkpool/agent-service dev
Update .env so the frontend can find them:
VITE_AGENT_STATUS_URLS=http://localhost:8083/status,http://localhost:8084/status,http://localhost:8085/status
Restart the frontend. /agents renders all three in parallel with their live action feeds.

LLM-brained agent

Set the LLM block in .env:
LLM_PROVIDER=groq                       # groq | anthropic | openai | ollama
LLM_API_KEY=gsk_...                     # https://console.groq.com
LLM_MODEL=llama-3.3-70b-versatile       # optional override
AGENT_PROMPT_FILE=packages/agent-service/prompts/momentum.md
Then:
AGENT_NAME=btc-brain AGENT_STRATEGY=llm AGENT_STATUS_PORT=8086 \
  pnpm --filter @darkpool/agent-service dev
The fleet card shows the model name as a badge; each action carries the model’s reasoning. Missing LLM_API_KEY → fallback to alternate with a warning. See LLM Strategy for the tool loop + decision shape.

Register on chain (give the agent identity + reputation tracking)

pnpm agent:register --name "BTC Alpha" --execute
# → TradeAgent: 0x…   Set TRADE_AGENT_ID=0x… in .env
# → AgentOwnerCap: 0x… (keep safe)
With a real V3 TradeCap:
pnpm agent:register \
  --name "Delegated BTC Bot" \
  --balance-manager 0xYOUR_V3_BM \
  --trade-cap 0xYOUR_V3_TRADECAP \
  --execute
Once TRADE_AGENT_ID is in .env, the runtime reads is_active per tick. The owner can pause / resume on chain via /agents/:agentId Owner Controls. See Owner Controls.

Or use the Create wizard

/agentsCreate agent wizard. One PTB does BalanceManager + TradeCap + (optional) DUSDC deposit + register. Plus a Groq model selector and a downloadable mandate.

Docker profile

docker compose --profile agent up -d
Starts one agent container with the env-configured strategy on :8083. Multi-instance → multiple compose services (or run the rest manually).

Status URLs are public-by-default

/status exposes config, tick counters, and the action feed in plaintext. Fine on localhost. If you expose them publicly, gate behind a reverse proxy + auth.