
Capital Pilot
Shared AI intelligence with decentralized execution and risk
Demo
About
Capital Pilot is an autonomous on-chain asset management platform that combines shared AI market intelligence with transparent, verifiable smart-contract execution. Instead of having every trading vault independently call an LLM to analyze the market, Capital Pilot uses a shared AI intelligence layer. The platform continuously analyzes BTC market data once and publishes the resulting market insight and strategy decisions on-chain. Agent vaults can then consume the same verified decision, allowing multiple users to benefit from a common source of AI market intelligence without each vault separately paying the LLM analysis cost. The system continuously analyzes BTC market data and classifies the current market regime as either Trading or Market Maker. In Trading mode, an AI strategy agent evaluates the current conditions and selects one or more supported strategies, including Momentum, Technical Analysis, and DCA. Agent vaults configured for eligible strategies can then open positions based on the shared market decision. A separate exit agent evaluates existing positions and determines whether they should be held or closed. This creates a separation between shared intelligence and individual execution: AI market intelligence is shared across participating vaults. Strategy configuration remains vault-specific. Risk parameters remain user-specific. Trade execution occurs independently through each vault's smart contract. Every market decision is recorded on-chain with its selected strategies, confidence score, rationale, and timestamp. Vault trades reference these decision records, creating an auditable connection between an AI-generated market insight and the on-chain transaction it ultimately produces. Users can connect MetaMask through the dashboard to create and fund agent vaults, view vaults across the platform, filter vaults by wallet, and monitor balances, strategies, market mode, open positions, realized PnL, and AI decision history. Why Capital Pilot? Capital Pilot explores a different model for AI-powered DeFi: AI intelligence can be shared, while execution and risk remain decentralized at the vault level. Instead of repeatedly paying for the same market analysis across individual trading agents, one shared AI intelligence layer can generate a market view that multiple autonomous vaults can independently act upon. This creates a scalable architecture where intelligence is shared, decisions are transparent, and execution remains on-chain and user-controlled.
How it's made
Capital Pilot consists of three connected layers: 1. Smart Contracts The Solidity contracts are developed and tested with Foundry. AgentFactory deploys and indexes user-owned agent vaults. AgentVault manages deposits, withdrawals, trading positions, market-maker activation, realized PnL, and position history. MarketRegimeRegistry stores timestamped AI market decisions and makes shared market intelligence available on-chain. XYCSwap implements constant-product swaps using Aqua's shared-liquidity architecture. AquaTradingAdapter connects agent vaults to the Aqua execution layer. Each market analysis receives a unique on-chain decisionId. The decision records the detected market regime, selected strategies, confidence score, rationale, and timestamp. When a vault opens or closes a position, the transaction references the corresponding decisionId. This creates an on-chain audit trail connecting: Market Data → AI Analysis → Strategy Selection → Vault Decision → On-chain Execution A strategy bitmask allows multiple strategies to be selected efficiently, while vaults validate that their configured strategy was actually selected by the shared AI strategy decision before opening a position. Every market-maker activation uses a unique salt, preventing reuse of an immutable Aqua strategy hash after docking. 2. Shared AI Backend The Node.js backend provides the shared intelligence layer. It consumes Binance candle data and calculates technical indicators including: 1. RSI 2. ADX 3. ATR 4. Bollinger Bands 5. Momentum 6. Volatility The backend coordinates three OpenAI-powered agents: LLM_A — Market Regime Agent: classifies the global BTC market regime as Trading or Market Maker. LLM_B — Strategy Agent: evaluates the current regime and selects eligible trading strategies. LLM_C — Exit Agent: evaluates existing positions and determines whether they should remain open or be closed. LLM_A and LLM_B generate a shared market insight rather than running independently for every user vault. The combined decision is recorded on-chain before eligible vaults execute trades. This architecture allows multiple agent vaults to leverage the same AI-generated market analysis, significantly reducing duplicated LLM calls and making AI-driven asset management more cost-efficient at scale. After a decision is confirmed on-chain, the backend submits the corresponding trading transactions through ethers.js using a nonce-managed signer. Each trade is linked to the confirmed market decision, preserving the relationship between the shared AI insight and the resulting execution. 3. Frontend The frontend is built with React, Vite, MUI, and ethers.js. The dashboard provides: 1. MetaMask wallet connection and localhost network support 2. Latest and historical market-regime decisions 3. Shared AI market insights and strategy selections 4. AI confidence scores and rationale 5. Vault creation, token approval, and funding 6. Global and wallet-filtered vault views 7. Vault balances, market mode, and strategies 8. Open positions and realized PnL 9. PnL percentage 10. Expandable position histories 11. Links between individual trades and their underlying AI decisions Contract addresses and network settings are isolated in a frontend configuration file, allowing the interface to be deployed from localhost to compatible EVM test networks with minimal configuration changes.