Chaos Engine is an autonomous AI-driven treasury management protocol deployed on BSC Testnet.
It enables:
- Public triggering of market stress events
- AI-based risk evaluation
- On-chain capital rebalancing
- Fully transparent decision proofs
The system operates in two modes:
- Protocol Mode — manages a shared treasury
- Personal Mode — stress tests a user wallet without moving funds
On-chain treasuries are reactive and manually managed.
Human operators are slow, emotional, and often respond after damage occurs.
There is no autonomous, verifiable AI system that:
- Reacts instantly to market shocks
- Evaluates risk objectively
- Executes trades on-chain
- Provides decision transparency
Chaos Engine solves this.
Chaos Engine introduces a dual-layer architecture:
-
Smart Contract Treasury
- Holds WBNB + mUSD
- Emits ChaosTriggered events
- Executes AI decisions on-chain
-
Autonomous AI Agent
- Listens for events
- Fetches balances
- Requests AI risk analysis
- Calculates slippage-protected swaps
- Executes rebalancing transaction
-
Institutional Dashboard
- Real-time treasury value
- AI decision breakdown
- Metadata hash proof
- Dual mode (Protocol / Personal)
- User triggers Chaos (pays small BNB fee)
- Smart contract emits
ChaosTriggered - Agent receives event
- AI evaluates:
- Event type
- Severity
- Treasury allocation
- AI returns:
- Risk score
- Action (HOLD / SWAP)
- Trade percentage
- Confidence
- Agent executes
decideAndExecute - Dashboard displays decision + proof
Fully on-chain execution.
Fully auditable logic.
Human-free rebalancing.
┌────────────────────────┐
│ User UI │
│ (Next.js Dashboard) │
└────────────┬───────────┘
│
▼
┌────────────────────────┐
│ ChaosEngine.sol │
│ Smart Contract Treasury│
│ - Holds WBNB + mUSD │
│ - Emits Events │
│ - Executes Swaps │
└────────────┬───────────┘
│ Emits ChaosTriggered
▼
┌────────────────────────┐
│ Autonomous Agent │
│ (Node.js Listener) │
│ - Fetch balances │
│ - Call AI model │
│ - Quote Router │
│ - Execute decision │
└────────────┬───────────┘
│
▼
┌────────────────────────┐
│ AI Risk Model │
│ (Anthropic Claude) │
│ - Risk Score │
│ - Action │
│ - Trade Size │
└────────────────────────┘
- Solidity
- Hardhat
- Ethers v6
- Next.js
- PancakeSwap V2
- Anthropic Claude API
- BSC Testnet
Chaos Engine demonstrates that AI can evaluate risk, make capital allocation decisions, and execute trades autonomously and transparently on-chain.
It lays the foundation for AI-governed treasury infrastructure in DeFi.
- Multi-asset treasury support
- DAO governance layer
- Cross-chain risk routing
- Dynamic trigger incentives
This project runs on BNB Chain Testnet.
Request testnet BNB from: https://testnet.bnbchain.org/faucet-smart
You need BNB for:
- Triggering chaos (protocol mode)
- Executing personal swaps
The protocol treasury is an onchain contract that holds:
- WBNB (volatile asset)
- mUSD (stable asset)
Liquidity for WBNB ↔ mUSD was manually seeded via PancakeSwap V2 on BSC Testnet.
The AI agent does NOT custody user funds. It only manages the protocol treasury balance.
All decisions are:
- Triggered onchain
- Executed onchain
- Verifiable on BscScan
Personal mode interacts directly with the user's wallet.
To test:
- Get testnet BNB
- Get mUSD using the Mint 1000 mUSD button (test token)
- Swap small amount tBNB to WBNB via Pancake testnet
- Click "Stress My Portfolio"
- Approve rebalance if desired
Swaps execute via Pancake Router directly from user wallet. Chaos Engine never takes custody.