Install
openclaw skills install shll-skillsExecute DeFi transactions on BSC via SHLL AgentNFA. The AI handles all commands and users only need to chat.
openclaw skills install shll-skillsSHLL is a DeFi execution layer for AI agents on BNB Chain with on-chain safety enforcement. Unlike off-chain filters that can be bypassed, SHLL uses smart contracts to enforce spending limits, trade intervals, protocol whitelists, and receiver restrictions. Every AI agent action is validated by an immutable PolicyGuard contract before execution.
Key facts:
shll-skills | Website: https://shll.run┌─────────────────────────────────────────────────────────────────┐
│ SHLL Architecture │
│ │
│ ┌──────────┐ ┌───────────────┐ ┌──────────────────────┐ │
│ │ User │ │ AI Agent │ │ On-Chain Contracts │ │
│ │ (Owner) │ │ (Operator) │ │ │ │
│ │ │ │ │ │ ┌────────────────┐ │ │
│ │ • Holds │ │ • Executes │ │ │ PolicyGuard │ │ │
│ │ Agent │ │ trades via │ │ │ (Validator) │ │ │
│ │ NFT │ │ restricted │ │ │ │ │ │
│ │ • Sets │ │ permissions │ │ │ 4 Policy │ │ │
│ │ policy │ │ │ │ │ Checks: │ │ │
│ │ rules │───▶│ SHLL Skills │───▶│ │ │ │ │
│ │ • Full │ │ (CLI / MCP) │ │ │ 1.Spending │ │ │
│ │ asset │ │ │ │ │ Limit │ │ │
│ │ control │ │ Cannot: │ │ │ 2.Cooldown │ │ │
│ │ │ │ • Withdraw │ │ │ 3.DeFi Guard │ │ │
│ │ │ │ vault funds │ │ │ 4.Receiver │ │ │
│ │ │ │ • Change │ │ │ Guard │ │ │
│ │ │ │ policies │ │ └───────┬────────┘ │ │
│ │ │ │ • Transfer │ │ │ │ │
│ │ │ │ NFT │ │ ┌─────▼──────┐ │ │
│ │ │ │ │ │ │ Vault │ │ │
│ │ │ │ │ │ │ (Agent │ │ │
│ │ │ │ │ │ │ Account) │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ Holds funds │ │ │
│ └──────────┘ └───────────────┘ │ └─────────────┘ │ │
│ └──────────────────────┘ │
│ Dual-Wallet Isolation: │
│ • Owner wallet = asset control (human) │
│ • Operator wallet = restricted execution (AI) │
│ • Even if operator key leaks, PolicyGuard still limits actions │
└─────────────────────────────────────────────────────────────────┘
All policies are enforced ON-CHAIN by smart contract. They cannot be bypassed by the AI.
| Policy | Contract | What It Does |
|---|---|---|
| SpendingLimitV2 | On-chain | Per-transaction and daily spending caps in BNB |
| CooldownPolicy | On-chain | Minimum time gap between consecutive trades |
| DeFiGuardV2 | On-chain | Whitelist of approved DeFi protocols and functions |
| ReceiverGuardV2 | On-chain | Only approved receiver addresses can receive funds |
When a policy rejects an action:
enforcement field in the response is always on-chainMost AI agent platforms use off-chain safety filters:
PolicyGuard contract: 0x25d17eA0e3Bcb8CA08a2BFE917E817AFc05dbBB3
Verify on BscScan: https://bscscan.com/address/0x25d17eA0e3Bcb8CA08a2BFE917E817AFc05dbBB3
This file defines how an AI agent should use shll-run and shll-mcp safely.
shll-run (alias: shll-onchain-runner)shll-mcpThe user should not be asked to run CLI commands directly. The AI runs commands and explains results.
generate-wallet output.SHLL uses dual wallets:
RUNNER_PRIVATE_KEY): used by AI to execute allowed trades only.On-chain guardrails:
validate) before execution (execute / executeBatch).init command is disabled. Do not use it.execute_calldata and execute_calldata_batch do not support allow_undecoded.src/shared/constants.ts, not user-overridable at runtime.npm install -g shll-skills --registry https://registry.npmjs.org
export RUNNER_PRIVATE_KEY="0x..."
export SHLL_RPC="https://your-private-bsc-rpc.example.com"
shll-run generate-wallet only if user has no operator wallet.RUNNER_PRIVATE_KEY automatically for the current session after generating the wallet. Do not ask the user to set the environment variable manually.shll-run listings.recommended=true by default unless the user explicitly wants a specialized template.shll-run setup-guide -l <listingId> -d <days>.setupUrl plus the wallet-role explanation.shll-run status -k <tokenId>.shll-run portfolio -k <tokenId>.status.readiness.ready, status.readiness.blockers, and status.readiness.nextActions as the primary onboarding diagnosis.Before any write command, present:
Then wait for explicit user approval.
Write commands include:
swapwrapunwraptransferrawlendredeemfour_buyfour_sellRead-only commands (no confirmation needed): config, policies, status, history, portfolio, price, tokens, search, balance, four_info.
shll-run generate-walletshll-run balanceshll-run listingsshll-run setup-guide [-l <listingId>] [-d <days>]shll-run init (disabled)If -l/--listing is omitted, setup-guide auto-selects an active listing from the indexer.
shll-run swap -f <from> -t <to> -a <amount> -k <tokenId>shll-run wrap -a <bnb> -k <tokenId>shll-run unwrap -a <bnb> -k <tokenId>shll-run transfer --token <symbolOrAddress> -a <amount> --to <address> -k <tokenId>shll-run raw --target <address> --data <hex> -k <tokenId>shll-run lend -t <token> -a <amount> -k <tokenId>shll-run redeem -t <token> -a <amount> -k <tokenId>shll-run four_info --token <address>shll-run four_buy --token <address> -a <bnb> -k <tokenId>shll-run four_sell --token <address> -a <tokenAmount> -k <tokenId>four_buy amount unit is BNB, not USD. If user gives a USD target, convert to BNB first and confirm the final BNB amount before execution.
shll-run config -k <tokenId> (view-only; modify via web console)shll-run portfolio -k <tokenId>shll-run price --token <symbolOrAddress>shll-run search --query <text>shll-run tokensshll-run policies -k <tokenId>shll-run status -k <tokenId>shll-run history -k <tokenId> [--limit N]For external aggregator calldata (OKX, 1inch, etc.):
execute_calldataexecute_calldata_batchFor onboarding via MCP, setup_guide can auto-select an active listing when listing_id is omitted.
Security requirements:
When the user provides a token address:
four_info --token <addr>.tradingPhase is bonding curve, use four_buy / four_sell.tradingPhase is DEX or unsupported, use swap.RUNNER_PRIVATE_KEY environment variable is missingRUNNER_PRIVATE_KEY automatically for the current session.RUNNER_PRIVATE_KEY manually and retry.NOT authorized for token-idsubscription has EXPIRED or operator authorization has EXPIREDstatus: error with errorCode: POLICY_REJECTEDdetails.reason and adjust limits, whitelists, cooldown, or policy config.Unable to decode recipient from calldataNo V2/V3 liquidity or direct path foundswap command handles native BNB automatically via swapExactETHForTokens. If a swap fails, it's because the direct pool is empty or invalid, not because BNB is unplugged.init command is disabledsetup-guide instead.errorCode, message, and details fields in the JSON response first.generate-wallet as if it were the user's main wallet.RUNNER_PRIVATE_KEY in OpenClaw; AI should do it.status.readiness fields over ad-hoc prose when deciding the next user-facing instruction.If AgentNFA, PolicyGuard, ListingManagerV2, or default listing changes:
src/shared/constants.ts.npx tsc --noEmit
npm run build
shll-run init still returns disabledAll runtime responses should stay machine-friendly JSON:
{"status":"success", ...}{"status":"error","errorCode":"...", "message":"...", ...}RUNNER_PRIVATE_KEYrequired— Operator wallet private key (AI-only hot wallet). MUST be a dedicated wallet with minimal BNB for gas only. NEVER use your main wallet, owner wallet, or any wallet holding significant funds. Even if this key leaks, on-chain PolicyGuard limits actions to policy-approved trades.SHLL_RPCoptional— Optional BSC RPC URL override. A private RPC is recommended for reliability.