Skip to content

Ivan-LB/solsage-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SolSage — Autonomous Solana Intelligence Agent

OOBE Protocol × Ace Data Cloud × x402 micropayments

OOBE Protocol Ace Data Cloud x402 Payments Solana Node.js


What SolSage Does

SolSage is a fully autonomous Solana wallet intelligence agent that runs without human intervention:

  1. Pays for its own intelligence — 3 x402 micropayments per cycle ($0.001 USDC each → Ace Data Cloud)
  2. Fetches real-time Solana data — via OOBE Protocol Synapse RPC (balance, txs, programs)
  3. Dual-AI analysis — Claude AI (primary) + Gemini AI (second opinion) via Ace Data Cloud
  4. Triangulates with live news — SERP API fetches current market sentiment
  5. Stores every decision on-chain — Merkle tree updated → Solana Memo v2 written per cycle
  6. Broadcasts live to dashboard — Node.js HTTP server, auto-refresh every 3 seconds

No cron jobs. No manual triggers. The agent pays for its own data and writes its own audit trail.


Ace Data Cloud Services Used (3 required)

# Service Endpoint Purpose
1 SERP API POST /serp/google Real-time Solana market news
2 Claude AI POST /claude/chat/completions Primary wallet risk/opportunity analysis
3 Gemini AI POST /gemini/chat/completions Second-opinion verification

Each service call is preceded by an x402 micropayment to the Ace Data Cloud facilitator.


x402 Payment Flow

Agent → Ace Data Cloud resource (no payment header)
Server → 402 Payment Required + PAYMENT-REQUIRED header (base64 JSON)
Agent → builds X-PAYMENT header (USDC transfer on Solana)
Agent → retries with X-PAYMENT header
Server → verifies + settles → 200 OK + intelligence data

The x402 payment payload (per request):

{
  "scheme": "exact",
  "network": "solana-mainnet",
  "payload": {
    "version": 2,
    "amount": 1000,
    "currency": "USDC",
    "recipient": "facilitator.acedata.cloud",
    "memo": "x402:acedata:serp_news:1748393940000",
    "payer": "<agent-wallet-pubkey>"
  }
}

OOBE Protocol Integration

Each agent decision is:

  1. Hashed — SHA-256 of wallet:signal:confidence:timestamp
  2. Added to Merkle tree — tamper-proof history of all decisions
  3. Written on-chain — Solana Memo v2 instruction with Merkle root
OOBE:DECISION:v1|wallet=7YttLkHD...|signal=ACCUMULATE|conf=81|risk=30|root=faaad616d4b6...

Architecture

┌─────────────────────────────────────────────────────────┐
│                   DATA & PAYMENT LAYER                  │
│  x402 Payment ($0.001 USDC) → Ace Data Cloud Facilitator│
│  ├─ SERP API: market news                               │
│  ├─ Claude AI: primary analysis                         │
│  └─ Gemini AI: second opinion                           │
└────────────────────────┬────────────────────────────────┘
                         ↓
┌─────────────────────────────────────────────────────────┐
│                  SOLANA DATA LAYER                      │
│  OOBE Synapse RPC: balance, txCount, token accounts     │
└────────────────────────┬────────────────────────────────┘
                         ↓
┌─────────────────────────────────────────────────────────┐
│                   AGENT CORE                            │
│  Decision: signal + riskScore + opportunityScore        │
│  Merkle tree update → Solana Memo v2 (on-chain log)     │
└────────────────────────┬────────────────────────────────┘
                         ↓
┌─────────────────────────────────────────────────────────┐
│                  DASHBOARD (port 4200)                  │
│  Live feed + decision history + payment receipts        │
└─────────────────────────────────────────────────────────┘

Quick Start (Demo Mode — no keys required)

git clone https://github.com/Ivan-LB/solsage-agent.git
cd solsage-agent
npm install
npm start

Open http://localhost:4200 — agent starts immediately in simulate mode.

Live mode (requires Ace Data Cloud API key):

ACEDATA_API_KEY=your_key \
AGENT_WALLET_ADDRESS=YourSolanaWalletPublicKey \
WATCH_WALLETS=WalletToMonitor1,WalletToMonitor2 \
npm start

Environment Variables

Variable Default Description
ACEDATA_API_KEY Ace Data Cloud API key (triggers live mode)
ACEDATA_SIMULATE true Force simulate mode (ignores API key)
AGENT_WALLET_ADDRESS SolSage_Agent_Demo Agent's Solana public key
AGENT_WALLET_PRIVATE_KEY For live x402 + on-chain writes
WATCH_WALLETS 7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqg9GQ2 Comma-separated wallets to monitor
SOLANA_RPC_URL https://api.mainnet-beta.solana.com Solana RPC endpoint
OOBE_SIMULATE true Skip on-chain Memo writes
INTERVAL_MS 300000 Agent cycle interval (5 min)
PORT 4200 Dashboard port

Project Structure

solsage-agent/
├── agent.js      # Main agent loop + HTTP dashboard
├── acedata.js    # Ace Data Cloud: SERP + Claude AI + Gemini AI
├── x402.js       # x402 v2 payment protocol
├── oobe.js       # OOBE Synapse RPC + Merkle tree + Solana Memo
└── package.json

Why SolSage Stands Out

x402 expertise: Built by the team behind a live x402 v2 API on Base mainnet. The x402 payment payload shown here matches the actual v2 protocol spec — not pseudocode.

Dual monetization model: In full deployment, SolSage would both PAY for data (Ace Data Cloud) and EARN from other agents calling its own x402-monetized intelligence endpoint — a complete agent economy participant.

Deterministic demo mode: Judges can reproduce the exact same output without API keys. Every simulated hash is deterministic — SHA-256(memo) — so the Merkle tree state is verifiable.

Clean separation: acedata.js, x402.js, oobe.js are independent modules. Swapping from simulate to live requires only setting environment variables.


Submission Links


SolSage v1.0 · MIT License · OOBE Protocol × Ace Data Cloud × x402 v2

About

Autonomous Solana intelligence agent — OOBE Protocol × Ace Data Cloud × x402 micropayments

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors