An AI-powered autonomous stock market agent that generates equity research reports and executes trades on the Solana blockchain.
- 🤖 Autonomous Agent - Runs a continuous loop to analyze stocks and execute trades.
- 🧠 AI Analysis - Uses Claude 3.5 Sonnet to generate detailed research reports.
- 🌐 Real-time Data - Fetches live market news and sentiment via Brave Search.
- ⚡ Solana Trading - Executes swaps via SolanaTracker and manages a local wallet.
- Runtime: Node.js + TypeScript
- AI/LLM: Anthropic Claude 3.5 Sonnet
- Search: Brave Search API
- Blockchain: @solana/web3.js, SolanaTracker Swap API
- Node.js v18 or higher
- Solana Wallet (Private Key)
- Anthropic API Key
- Brave Search API Key
-
Clone the repository
git clone https://github.com/OnChainStockExchange/ocse-agent.git cd ocse-agent -
Install dependencies
npm install
-
Configure environment Create a
.envfile with the following keys:ANTHROPIC_API_KEY=sk-ant-... BRAVE_API_KEY=... SOLANA_PRIVATE_KEY=... SOLANA_TRACKER_API_KEY=... NEXT_PUBLIC_SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
Starts the autonomous trading loop (fetches news, generates reports, trades).
npm startRuns the agent with hot-reload.
npm run dev- Selection: The agent selects a random stock from the "xStocks" pool (Tokenized Stocks on Solana).
- Research: It performs a web search for the latest news, price action, and sentiment.
- Analysis: Claude 3.5 Sonnet generates a "Buy" or "Sell" rating with a conviction score (0-100).
- Execution:
- Buy: Allocates % of available SOL based on conviction.
- Sell: Sells % of current holdings based on conviction.
- Trading: Swaps are executed on-chain via SolanaTracker.
MIT License