Commands Reference

Complete reference for every aw command, flag, and output format.

Global options

These flags are available on all commands:

FlagDescription
--jsonOutput as JSON
--output <format>Output format: human or json
--non-interactiveDisable interactive prompts
--request-id <id>Request ID for tracing
--chain <name>Target chain: ethereum, bnb, base, polygon, arbitrum, solana (default: ethereum). Not available for predict commands (hardcoded to Polygon).
--timeout <ms>RPC timeout in milliseconds (default: 30000)
-h, --helpDisplay help
-v, --versionDisplay version

System

aw init

Initialize the local data store. Creates ~/.agentswallets/ with an encrypted SQLite database.

aw init --json

No init or unlock required.

aw unlock

Start a session. Required before write operations. Sessions auto-renew on each successful command (sliding window), so active agents stay unlocked.

AW_MASTER_PASSWORD='***' aw unlock --json
{ "ok": true, "data": { "status": "unlocked", "expires_at": "2026-03-01T10:15:00Z" } }

Rate-limited: 5 attempts per 15-minute window with exponential backoff.

aw lock

End the current session. Deletes session token files.

aw lock --json

aw health

Check system health. No init or unlock required.

aw health --json
{
  "ok": true,
  "data": {
    "version": "0.5.0",
    "default_chain": "ethereum",
    "home_dir": "~/.agentswallets",
    "db": { "ok": true },
    "session": { "ok": true },
    "rpc": { "ok": true },
    "solana_rpc": { "ok": true },
    "okx_api": { "ok": true },
    "hyperliquid_api": { "ok": true },
    "security_guard": { "ok": true }
  }
}

With --chain solana:

aw health --chain solana --json
{
  "ok": true,
  "data": {
    "version": "0.5.0",
    "default_chain": "ethereum",
    "home_dir": "~/.agentswallets",
    "db": { "ok": true },
    "session": { "ok": true },
    "rpc": { "ok": true },
    "solana_rpc": { "ok": true },
    "okx_api": { "ok": true },
    "hyperliquid_api": { "ok": true },
    "security_guard": { "ok": true }
  }
}

Set AW_HEALTH_VERBOSE=1 for full diagnostics.


Wallet

Wallets can be referenced by name, address, or UUID in any command that accepts a <wallet> argument or --wallet flag.

aw wallet create

Create a new HD wallet. A BIP-39 mnemonic is generated locally, deriving both an EVM and a Solana address.

aw wallet create --name <name> --json
FlagRequiredDescription
--name <name>YesWallet name (pattern: [a-zA-Z0-9_-]{1,64})
{
  "ok": true,
  "data": {
    "name": "bot",
    "evm_address": "0x4f3A...6a1",
    "solana_address": "7xKX...9vNq",
    "key_type": "hd",
    "supported_chains": ["ethereum", "bnb", "base", "polygon", "arbitrum", "solana"],
    "hint": "Fund your wallet by sending tokens to the EVM or Solana address above."
  }
}

aw wallet list

List all wallets.

aw wallet list --json
{
  "ok": true,
  "data": {
    "wallets": [
      { "name": "bot", "address": "0x4f3A...6a1", "key_type": "hd", "solana_address": "7xKX...9vNq", "created_at": "..." }
    ]
  }
}

aw wallet info <wallet>

Get wallet details.

aw wallet info bot --json
aw wallet info --wallet bot --json
{
  "ok": true,
  "data": {
    "name": "bot",
    "address": "0x4f3A...6a1",
    "key_type": "hd",
    "solana_address": "7xKX...9vNq",
    "created_at": "2026-03-01T10:00:00Z"
  }
}

aw wallet balance <wallet>

Query on-chain balances.

aw wallet balance bot --json
{
  "ok": true,
  "data": {
    "name": "bot",
    "address": "0x...",
    "chain": "Ethereum",
    "chain_id": 1,
    "balances": { "ETH": "0.05", "USDC": "100.50", "USDT": "0.00" },
    "balances_number": { "ETH": 0.05, "USDC": 100.5, "USDT": 0.0 }
  }
}

The balances field contains string values for display. The balances_number field contains numeric values for direct comparison. Use --chain to query balances on a different chain (e.g., aw wallet balance bot --chain polygon).

Use --all to query balances across all wallets at once:

aw wallet balance --all --json

aw wallet deposit-address <wallet>

Get the deposit address for a wallet. Use --chain solana to get the Solana deposit address.

aw wallet deposit-address bot --json
aw wallet deposit-address bot --chain solana --json

aw wallet export-key <wallet>

Export the HD wallet's BIP-39 mnemonic. Requires three safety gates:

  1. AW_ALLOW_EXPORT=1 environment variable
  2. --danger-export flag
  3. Interactive confirmation (or --yes)
AW_ALLOW_EXPORT=1 aw wallet export-key bot --danger-export --yes --json
{
  "ok": true,
  "data": {
    "mnemonic": "abandon abandon abandon ... about",
    "warning": "Store this mnemonic securely. Anyone with access can derive all keys."
  }
}

aw wallet settings <wallet>

Alias for aw policy show. See Policy Engine.

aw wallet settings-set <wallet>

Alias for aw policy set. See Policy Engine.

aw wallet drain <wallet>

Drain all tokens from a wallet to a destination address. Sends the entire balance minus gas fees.

aw wallet drain bot --to 0x9f4E...3bC1 --json
aw wallet drain bot --to 0x9f4E...3bC1 --chain polygon --json
FlagRequiredDescription
--to <address>YesDestination address
--chain <name>NoTarget chain (default: ethereum)
--yesNoSkip confirmation prompt
{
  "ok": true,
  "data": {
    "drained": [
      { "token": "USDC", "amount": "100.50", "tx_hash": "0x..." },
      { "token": "ETH", "amount": "0.05", "tx_hash": "0x..." }
    ]
  }
}

Transaction

aw send

Send a token transfer. Requires unlock.

aw send \
  --wallet bot \
  --to 0x9f4E...3bC1 \
  --amount 10 \
  --token USDC \
  --idempotency-key transfer-001 \
  --json
FlagRequiredDescription
--wallet <wallet>YesSource wallet (name or EVM address)
--to <address>YesDestination address
--amount <n>YesAmount to send
--token <symbol>YesToken symbol (chain-dependent, e.g. USDC, POL, ETH, SOL)
--chain <name>NoTarget chain (default: ethereum)
--idempotency-key <k>NoPrevents duplicate transactions (auto-generated if omitted)
--dry-runNoValidate without broadcasting

USDC.e refers to the legacy bridged USDC on Polygon (0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174).

{ "ok": true, "data": { "tx_id": "tx_abc", "tx_hash": "0x...", "status": "confirmed" } }

aw tx send

Alias for aw send. Identical flags and behavior.

aw tx list

List operations for a wallet. No unlock required.

aw tx list --wallet bot --limit 50 --json
FlagRequiredDescription
--wallet <wallet>YesWallet (name, address, or UUID)
--limit <n>NoMax results (default: 50)

Operations include a parsed meta object with transaction details.

aw tx status <tx_id>

Get operation status. No unlock required.

aw tx status tx_abc123 --json

Policy

aw policy show <wallet>

Show the current spending policy. No unlock required.

aw policy show bot --json

aw policy set <wallet>

Update spending policy. Requires unlock. At least one field must be specified.

aw policy set bot \
  --limit-daily 1000 \
  --limit-per-tx 200 \
  --max-tx-per-day 50 \
  --allowed-tokens POL,USDC \
  --json
FlagDescription
--limit-daily <n>Daily spending limit
--limit-per-tx <n>Per-transaction spending limit
--max-tx-per-day <n>Max transactions per day
--allowed-tokens <list>Comma-separated token symbols
--allowed-addresses <list>Comma-separated address allowlist
--require-approval-above <n>Approval threshold (0 to clear)

See Policy Engine for evaluation rules.


Polymarket

aw predict markets

Search Polymarket markets. No unlock required.

aw predict markets -q "bitcoin" --limit 5 --json
FlagRequiredDescription
-q, --query <query>YesSearch query
--limit <n>NoMax results (default: 10)
{ "ok": true, "data": { "markets": [{ "id": "...", "question": "...", "yes_price": 0.65, "no_price": 0.35 }] } }

aw predict buy

Buy a market outcome. Requires unlock.

aw predict buy \
  --wallet bot \
  --market mkt_abc \
  --outcome yes \
  --size 10 \
  --price 0.4 \
  --idempotency-key p1 \
  --json
FlagRequiredDescription
--wallet <wallet>YesWallet (name, address, or UUID)
--market <id>YesMarket ID
--outcome <yes|no>YesOutcome side
--size <n>YesNumber of shares
--price <n>YesPrice per share
--idempotency-key <k>NoIdempotency key (auto-generated if omitted)
--dry-runNoValidate without placing order

aw predict sell

Sell an existing position. Requires unlock. Sell operations skip spending limits but enforce rate limits and allowlists.

aw predict sell \
  --wallet bot \
  --position pos_xyz \
  --size 5 \
  --idempotency-key p2 \
  --json
FlagRequiredDescription
--wallet <wallet>YesWallet (name, address, or UUID)
--position <id>YesPosition ID
--size <n>YesNumber of shares
--idempotency-key <k>NoIdempotency key (auto-generated if omitted)
--dry-runNoValidate without placing order

aw predict positions

List open positions. No unlock required.

aw predict positions --wallet bot --json
{ "ok": true, "data": { "positions": [{ "id": "...", "market": "...", "outcome": "yes", "size": "10" }] } }

aw predict orders

List orders. Requires unlock.

aw predict orders --wallet bot --json
{ "ok": true, "data": { "orders": [{ "id": "...", "market": "...", "side": "buy", "size": "10", "price": "0.4" }] } }

aw predict cancel

Cancel a pending order. Requires unlock.

aw predict cancel --wallet bot --order-id ord_abc123 --json
FlagRequiredDescription
--wallet <wallet>YesWallet (name, address, or UUID)
--order-id <id>YesOrder ID to cancel

aw predict approve-check

Check USDC.e approval status for Polymarket. Requires unlock and master password.

aw predict approve-check --wallet bot --json
FlagRequiredDescription
--wallet <wallet>YesWallet (name, address, or UUID)

aw predict approve-set

Execute the 6 approval transactions required by Polymarket. Requires unlock and master password.

aw predict approve-set --wallet bot --json
FlagRequiredDescription
--wallet <wallet>YesWallet (name, address, or UUID)

aw predict update-balance

Update the Polymarket balance for a wallet. Requires unlock.

aw predict update-balance --wallet bot --json
FlagRequiredDescription
--wallet <wallet>YesWallet (name, address, or UUID)

aw predict ctf-split

Split USDC.e into Yes + No conditional tokens for a market. Requires unlock and master password.

aw predict ctf-split --wallet bot --condition 0xabc123... --amount 10 --json
FlagRequiredDescription
--wallet <wallet>YesWallet (name, address, or UUID)
--condition <id>YesCondition ID
--amount <n>YesAmount of USDC.e to split

aw predict ctf-merge

Merge Yes + No conditional tokens back into USDC.e. Requires unlock and master password.

aw predict ctf-merge --wallet bot --condition 0xabc123... --amount 10 --json
FlagRequiredDescription
--wallet <wallet>YesWallet (name, address, or UUID)
--condition <id>YesCondition ID
--amount <n>YesAmount of tokens to merge

aw predict ctf-redeem

Redeem conditional tokens after market settlement. Requires unlock and master password.

aw predict ctf-redeem --wallet bot --condition 0xabc123... --json
FlagRequiredDescription
--wallet <wallet>YesWallet (name, address, or UUID)
--condition <id>YesCondition ID

aw predict bridge-deposit

Get the deposit address for bridging funds to Polymarket. Requires unlock.

aw predict bridge-deposit --wallet bot --json
FlagRequiredDescription
--wallet <wallet>YesWallet (name, address, or UUID)

Keychain

aw keychain status

Check if the OS keychain is available and whether a password is stored.

aw keychain status --json
{ "ok": true, "data": { "available": true, "stored": false } }

aw keychain save

Save the master password to the OS keychain (macOS Keychain, Linux secret-tool, Windows DPAPI).

aw keychain save --json

aw keychain remove

Remove the master password from the OS keychain.

aw keychain remove --json

Audit

aw audit list

List audit log entries. Requires unlock. Entries form a SHA-256 hash chain for tamper detection.

aw audit list --wallet bot --action tx.send --limit 10 --json
FlagRequiredDescription
--wallet <wallet>YesWallet (name, address, or UUID)
--action <action>NoFilter by action (e.g., tx.send, predict.buy)
--limit <n>NoMax entries (default: 50)

DEX Swaps

Token swaps via OKX DEX aggregator. See DeFi & Trading for full details.

  • aw swap chains — list supported chains
  • aw swap quote — get a swap quote
  • aw swap exec — execute a token swap

Cross-Chain Bridge

Bridge tokens between chains via OKX. See DeFi & Trading for full details.

  • aw bridge chains — list supported bridge routes
  • aw bridge quote — get a bridge quote
  • aw bridge exec — execute a cross-chain bridge
  • aw bridge status — check bridge transaction status

Market Data

Query real-time market data. See DeFi & Trading for full details.

  • aw market price — get token prices
  • aw market candles — get OHLCV candle data
  • aw market trades — get recent trades

Token Discovery

Search and discover tokens. See DeFi & Trading for full details.

  • aw token search — search tokens by keyword
  • aw token info — get token details
  • aw token trending — get trending tokens
  • aw token holders — get top token holders

On-Chain History

Query on-chain transaction history. See DeFi & Trading for full details.

  • aw history list — list on-chain transactions for a wallet

Perpetual Contracts

Trade perpetual contracts on Hyperliquid. See Perpetual Contracts for full details.

  • aw perp assets — list available assets
  • aw perp prices — get current prices
  • aw perp funding — get funding rate history
  • aw perp account — get account summary
  • aw perp positions — list open positions
  • aw perp orders — list open orders
  • aw perp open — open a position
  • aw perp close — close a position
  • aw perp cancel — cancel an order

Security Operations

aw security status

Check Security Guard status and active rules. No unlock required.

aw security status --json
{
  "ok": true,
  "data": {
    "security_guard": "active",
    "red_line_rules": 7,
    "yellow_line_rules": 7,
    "blacklisted_addresses": 0,
    "baseline_verified": true
  }
}

aw security blacklist add

Add an address to the blacklist. Requires unlock.

aw security blacklist add --address 0xBAD...123 --reason "Known scam" --json
FlagRequiredDescription
--address <addr>YesAddress to blacklist
--reason <text>NoReason for blacklisting

aw security blacklist remove

Remove an address from the blacklist. Requires unlock.

aw security blacklist remove --address 0xBAD...123 --json

aw security blacklist list

List all blacklisted addresses. No unlock required.

aw security blacklist list --json

aw security baseline init

Initialize a configuration baseline for tamper detection. Requires unlock.

aw security baseline init --json
{
  "ok": true,
  "data": {
    "baseline_hash": "sha256:abc123...",
    "files_tracked": 5,
    "created_at": "2026-03-15T10:00:00Z"
  }
}

aw security baseline verify

Verify the current configuration against the stored baseline.

aw security baseline verify --json
{
  "ok": true,
  "data": {
    "verified": true,
    "baseline_hash": "sha256:abc123...",
    "current_hash": "sha256:abc123..."
  }
}

aw security report

Generate a comprehensive security report. Requires unlock.

aw security report --json
{
  "ok": true,
  "data": {
    "security_score": 95,
    "red_line_violations": 0,
    "yellow_line_warnings": 2,
    "anomalies_detected": 0,
    "baseline_status": "verified",
    "recommendations": ["Consider adding more addresses to the blacklist"]
  }
}

aw security anomaly

Run anomaly detection on a wallet's transaction patterns. Requires unlock.

aw security anomaly agent-01 --json
{
  "ok": true,
  "data": {
    "wallet": "agent-01",
    "anomalies": [],
    "patterns_analyzed": ["transaction_frequency", "amount_deviation", "time_of_day", "destination_diversity"],
    "status": "clean"
  }
}

Command requirements

CommandInitUnlockPasswordIdempotency key
aw initcreate
aw unlockyesyes
aw lockyes
aw wallet createyesyes
aw wallet listyes
aw wallet infoyes
aw wallet balanceyes
aw wallet deposit-addressyes
aw wallet export-keyyesyes
aw wallet drainyesyesyes
aw sendyesyesyesoptional
aw tx listyes
aw tx statusyes
aw predict marketsyes
aw predict positionsyes
aw predict buyyesyesyesoptional
aw predict sellyesyesyesoptional
aw predict ordersyesyes
aw predict cancelyesyes
aw predict approve-checkyesyesyes
aw predict approve-setyesyesyes
aw predict update-balanceyesyes
aw predict ctf-splityesyesyes
aw predict ctf-mergeyesyesyes
aw predict ctf-redeemyesyesyes
aw predict bridge-deposityesyes
aw policy showyes
aw policy setyesyes
aw audit listyesyes
aw swap chainsyes
aw swap quoteyes
aw swap execyesyesyesoptional
aw bridge chainsyes
aw bridge quoteyes
aw bridge execyesyesyesoptional
aw bridge statusyes
aw market priceyes
aw market candlesyes
aw market tradesyes
aw token searchyes
aw token infoyes
aw token trendingyes
aw token holdersyes
aw history listyes
aw perp assetsyes
aw perp pricesyes
aw perp fundingyes
aw perp accountyesyes
aw perp positionsyesyes
aw perp ordersyesyes
aw perp openyesyesyesoptional
aw perp closeyesyesyesoptional
aw perp cancelyesyes
aw security statusyes
aw security blacklist addyesyes
aw security blacklist removeyesyes
aw security blacklist listyes
aw security baseline inityesyes
aw security baseline verifyyes
aw security reportyesyes
aw security anomalyyesyes
aw health
aw keychain status
aw keychain saveyesyes
aw keychain remove