Skip to content

OCSE (On Chain Stock Exchange) is a custom open-source @claudeai agent. The agent can perform in depth research and analysis on stocks then buy them Solana.

License

Notifications You must be signed in to change notification settings

OnChainStockExchange/ocse-agent

Repository files navigation

OCSE Trader Agent

An AI-powered autonomous stock market agent that generates equity research reports and executes trades on the Solana blockchain.

Features

  • 🤖 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.

Tech Stack

  • Runtime: Node.js + TypeScript
  • AI/LLM: Anthropic Claude 3.5 Sonnet
  • Search: Brave Search API
  • Blockchain: @solana/web3.js, SolanaTracker Swap API

Prerequisites

  • Node.js v18 or higher
  • Solana Wallet (Private Key)
  • Anthropic API Key
  • Brave Search API Key

Installation

  1. Clone the repository

    git clone https://github.com/OnChainStockExchange/ocse-agent.git
    cd ocse-agent
  2. Install dependencies

    npm install
  3. Configure environment Create a .env file 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

Usage

Run the Agent

Starts the autonomous trading loop (fetches news, generates reports, trades).

npm start

Development

Runs the agent with hot-reload.

npm run dev

How It Works

  1. Selection: The agent selects a random stock from the "xStocks" pool (Tokenized Stocks on Solana).
  2. Research: It performs a web search for the latest news, price action, and sentiment.
  3. Analysis: Claude 3.5 Sonnet generates a "Buy" or "Sell" rating with a conviction score (0-100).
  4. Execution:
    • Buy: Allocates % of available SOL based on conviction.
    • Sell: Sells % of current holdings based on conviction.
  5. Trading: Swaps are executed on-chain via SolanaTracker.

License

MIT License

About

OCSE (On Chain Stock Exchange) is a custom open-source @claudeai agent. The agent can perform in depth research and analysis on stocks then buy them Solana.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published