> ## Documentation Index
> Fetch the complete documentation index at: https://docs.darkpool.fun/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Scripts

> register-trade-agent.

## `register-trade-agent`

Calls `darkpool::agent::register_agent` with name + strategy blob + BalanceManager / TradeCap / PredictManager ids. Captures the new `TradeAgent` id (to `TRADE_AGENT_ID` in `.env`) and `AgentOwnerCap` id (keep safe).

```bash theme={"system"}
pnpm agent:register --name "BTC Alpha" --execute
```

**Flags**

| Flag                | Required | Description                                             |
| ------------------- | -------- | ------------------------------------------------------- |
| `--name`            | yes      | Display name                                            |
| `--strategy-blob`   | no       | Walrus blob id of strategy doc (default: empty)         |
| `--balance-manager` | no       | DeepBook V3 BalanceManager id (default: zero sentinel)  |
| `--trade-cap`       | no       | DeepBook V3 TradeCap id (default: zero sentinel)        |
| `--predict-manager` | no       | PredictManager id (default: `AGENT_PREDICT_MANAGER_ID`) |
| `--agent-address`   | no       | Operator address (default: signer)                      |
| `--execute`         | no       | Sign + submit                                           |

## Full registration with V3 TradeCap

```bash theme={"system"}
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.

## Or use the Create wizard

`/agents to Create agent` does the same in the browser, plus optional DUSDC deposit and a downloadable mandate. Dry-run only. Keeps junk test agents off the on-chain leaderboard.
