Decentralized Exchange for AI Compute Tokens on Neo N3
Chatten enables AI agents to buy and sell model compute capacity based on real-time performance metrics, powered by the Neo N3 blockchain and SpoonOS agent framework.
chatten/
├── agents/ # SpoonOS Agent Implementations
│ ├── __init__.py
│ └── chatten_trader.py # Liquidity Manager Agent
├── contracts/ # Neo N3 Smart Contracts
│ ├── __init__.py
│ └── chatten_token.py # NEP-11 Compute Token Contract
├── tools/ # SpoonOS Tools (Agent-Blockchain Bridge)
│ ├── __init__.py
│ ├── neo_bridge.py # Core Neo N3 RPC Bridge
│ ├── token_tools.py # Token Balance & Transfer Tools
│ └── market_tools.py # Q-Score Analysis Tools
├── main.py # Application Entry Point
├── pyproject.toml # Project Configuration
└── .env.example # Environment Template
- Python 3.12+
- uv (recommended) or pip
- Neo N3 wallet (TestNet for development)
# Clone the repository
git clone https://github.com/chatten/neo-chatten.git
cd neo-chatten
# Create virtual environment and install dependencies
uv sync
# Or with pip
pip install -e ".[dev]"# Copy environment template
cp .env.example .env
# Edit with your credentials
nano .envRequired environment variables:
NEO_PRIVATE_KEY- Your Neo N3 wallet private keyOPENAI_API_KEY- OpenAI API key for agent LLMSPOON_API_KEY- SpoonOS API key (optional)
# Run the Chatten agent
python main.py
# Or via the installed command
chattenThe core AI agent that manages liquidity and executes trades:
from agents import ChattenTraderAgent
agent = ChattenTraderAgent(
name="MyTrader",
neo_wallet_address="NXjtd..."
)
# Check token balance
balance = await agent.check_token_balance()
# Analyze model quality
q_score = await agent.analyze_q_score("model-123")Semi-fungible token representing AI compute capacity:
- Symbol:
COMPUTE - Decimals: 8
- Standard: NEP-11 (Semi-Fungible)
Key functions:
mint(to, model_id, q_score, compute_units)- Mint tokens based on performancetransfer(to, token_id, data)- Transfer token ownershipproperties(token_id)- Get token metadata
Bridge between agents and the blockchain:
| Tool | Purpose |
|---|---|
NeoBridgeTool |
Core RPC communication & signing |
TokenBalanceTool |
Query token balances & ownership |
TokenTransferTool |
Execute token transfers |
QScoreAnalyzerTool |
Calculate AI model Q-scores |
The Quality Score (Q-score) is a composite metric (0-100) that determines token value:
| Component | Weight | Measures |
|---|---|---|
| Latency | 25% | Response time efficiency |
| Throughput | 25% | Processing capacity |
| Quality | 25% | Accuracy & benchmarks |
| Reliability | 25% | Uptime & error rates |
Minting Threshold: Models must achieve Q-score ≥ 50 to mint tokens.
# Run tests
pytest
# With coverage
pytest --cov=. --cov-report=html# Run ruff linter
ruff check .
# Format with black
black .
# Type checking
mypy .# Compile smart contract with neo3-boa
neo3-boa compile contracts/chatten_token.pyMIT License - see LICENSE for details.
Contributions welcome! Please read our contributing guidelines first.