Skip to content
OpeyemiMosesPublic

About

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

ChainIntel ASP πŸ”—πŸ€–

The Multi-Chain Intelligence Layer for Web3 AI Agents.

TypeScript License: MIT OKX x402 Chains Code Style: Prettier


πŸ“Œ Project Overview

ChainIntel ASP is an Agent Service Provider (ASP) engineered for the OKX.AI Marketplace and OnchainOS ecosystem. It delivers real-time, explainable, and synthesized blockchain intelligence directly to autonomous AI coding agents, trading bots, and Web3 applications.

Instead of requiring an AI agent to make 5+ fragmented calls to raw explorers and nodes, ChainIntel ASP aggregates, audits, and synthesizes 6 data providers in real-time, returning both structured numerical data and human-like AI reasoning powered by Groq Llama 3.3.


✨ Key Features

  • 🌐 Multi-Chain Intelligence: Full support for Ethereum Mainnet, Base, and X Layer (Mainnet & Testnet).
  • ⚑ Etherscan V2 Powered: Unified multi-chain explorer access via single Etherscan V2 key.
  • πŸ›‘οΈ Real-Time Security Scanning: Integrated GoPlus Security for honeypot audits, rug pull signals, mintability, and malicious wallet flags.
  • 🧠 Natural AI Reasoning: Every response includes plain-English summaries, risk scores (0–100), findings, and actionable recommendations.
  • πŸ’³ OKX x402 Micropayment Gate: Built-in pay-per-call monetized billing on X Layer (eip155:196 / eip155:1952).
  • πŸ›‘οΈ Direct RPC Fallback: Seamless standard EVM JSON-RPC support via Alchemy & public nodes when block explorers are limited.

πŸͺ The 8 Marketplace Listings

ChainIntel ASP exposes 8 specialized services designed for individual listing on the OKX Agent Store Marketplace:

# Service Name Endpoint Price / Call Category Key Capabilities
1 Token Security & Risk Auditor POST /token/analyze $0.04 Security Honeypot audit, rug flags, liquidity, top holders, CoinGecko price & market cap
2 Wallet Reputation & Whale Inspector POST /wallet/analyze $0.03 Forensics Whale score, wallet age, transaction frequency, mixer/sanction flags, AI behavior profile
3 Smart Contract Audit & Explainer POST /contract/analyze $0.04 Security Source code verification, proxy check (EIP-1967/UUPS), privileged functions, AI summary
4 Pre-Sign Transaction Simulator POST /transaction/simulate $0.03 Safety Pre-signature outcome prediction, gas estimation, decoded method calls, token transfer logs
5 Protocol Health & Audit Tracker POST /protocol/analyze $0.04 DeFi DeFiLlama TVL trends, security audit history, fork detection, multi-chain deployment map
6 DeFi Yield & Liquidation Risk Engine POST /defi/analyze $0.04 Yield Position health factor, liquidation distance, impermanent loss risk, top APY pool comparison
7 AI Agent Decision Engine POST /decision/evaluate $0.05 Strategy Synthesizes multi-source findings into ALLOW, WARN, or BLOCK recommendations
8 Auto-Detect Unified Intelligence POST /analyze $0.05 Search Smart single-query engine β€” auto-detects tx, token, contract, or wallet and routes query

πŸ—οΈ Architecture & Data Pipeline

                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚              AI Agent / Client               β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                            β”‚ HTTP POST /analyze
                                            β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚          ChainIntel ASP (Express)            β”‚
                     β”‚       [ OKX x402 Micropayment Gate ]         β”‚
                     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚               β”‚               β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β–Ό                    β–Ό               β–Ό               β–Ό                    β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Etherscan V2 β”‚    β”‚ Alchemy RPC  β”‚β”‚GoPlus Securityβ”‚β”‚  CoinGecko   β”‚    β”‚   Groq AI    β”‚
β”‚(Contracts/TX)β”‚    β”‚ (State/Code) β”‚β”‚(Honeypot/Risk)β”‚β”‚(Prices/Cap)  β”‚    β”‚ (Reasoning)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

⚑ Quick Start

1. Prerequisites

  • Node.js: v18.0.0 or higher
  • npm: v9.0.0 or higher

2. Installation

git clone https://github.com/OpeyemiMoses/ChainInel.git
cd chainintel-asp
npm install

3. Environment Setup

Copy the environment template:

cp .env.example .env

Fill in your API keys in .env (see Environment Variables section below).

4. Run Development Server

npm run dev

The server will start at http://localhost:4000.


πŸ”‘ Environment Variables

Variable Description Default / Example Required?
PORT Server listening port 4000 Optional
ETHERSCAN_API_KEY Etherscan API V2 Key (covers Ethereum + Base) ZFBZ669... πŸ”΄ Required
GROQ_API_KEY Groq API Key (AI summaries & reasoning) gsk_... πŸ”΄ Required
GROQ_MODEL Groq LLM Model llama-3.3-70b-versatile Optional
ALCHEMY_API_KEY Alchemy API Key (EVM RPC & bytecode) PWgz... πŸ”΄ Required
GOPLUS_API_KEY GoPlus Security API Key wDb0... 🟑 Recommended
COINGECKO_API_KEY CoinGecko API Key (Market data) CG-... Optional
OKX_API_KEY OKX Developer Portal API Key c711... 🟣 For x402 Billing
OKX_SECRET_KEY OKX Developer Portal Secret Key F8A3... 🟣 For x402 Billing
OKX_PASSPHRASE OKX Passphrase YourSecret 🟣 For x402 Billing
PAY_TO_ADDRESS EVM wallet address to receive payments 0x... 🟣 For x402 Billing
ENABLE_PAYMENT Set false for free local dev, true for x402 billing false Optional

πŸ“– API Usage Example

Query Token Intelligence (POST /token/analyze)

curl -X POST http://localhost:4000/token/analyze \
  -H "Content-Type: application/json" \
  -d '{"address":"0x6982508145454Ce325dDbE47a25d4ec3d2311933","chain":"ethereum"}'

Sample Response Payload:

{
  "status": "success",
  "module": "token/analyze",
  "chain": "ethereum",
  "summary": "Pepe (PEPE) on Ethereum: LOW RISK (score 10/100). 1 risk signal(s) detected. 572,787 holders.",
  "risk_score": 10,
  "risk_level": "very_low",
  "confidence": 0.9,
  "findings": [
    {
      "id": "token_security_0",
      "severity": "warning",
      "title": "Has blacklist function",
      "source": "GoPlus Security"
    }
  ],
  "recommendations": [
    "Proceed with caution β€” low risk signals present",
    "Check deployer wallet history and token holder distribution"
  ],
  "evidence": [
    { "label": "Price (USD)", "value": "$0.000003", "source": "CoinGecko" },
    { "label": "Market cap (USD)", "value": "$1,171,110,983", "source": "CoinGecko" },
    { "label": "Holder count", "value": 572787, "source": "GoPlus Security" }
  ],
  "data": {
    "address": "0x6982508145454Ce325dDbE47a25d4ec3d2311933",
    "name": "Pepe",
    "symbol": "PEPE",
    "is_honeypot": false,
    "is_open_source": true,
    "is_proxy": false,
    "is_mintable": false
  },
  "metadata": {
    "chain": "ethereum",
    "chain_id": 1,
    "analyzed_at": "2026-07-24T10:08:40.000Z",
    "latency_ms": 1755,
    "data_sources": ["CoinGecko", "Etherscan", "DeFiLlama", "Alchemy", "GoPlus Security", "Groq AI"]
  }
}

🚒 Deployment (Railway / Docker)

Option A: Railway Deployment

  1. Fork or push this repository to GitHub.
  2. Log into Railway.app β†’ New Project β†’ Deploy from GitHub repo.
  3. Add environment variables in the Railway dashboard (ETHERSCAN_API_KEY, GROQ_API_KEY, ALCHEMY_API_KEY, etc.).
  4. Set ENABLE_PAYMENT=true when ready to activate OKX x402 billing.

Option B: Docker Container

docker build -t chainintel-asp .
docker run -p 4000:4000 --env-file .env chainintel-asp

🀝 Open Source Governance


πŸ“„ License

This project is licensed under the MIT License.

About

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages