Skip to content

Rascalsz/mimo-oracle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧭 MiMo Oracle

AI-Powered Cross-Chain Oracle Aggregator & Anomaly Detection — Multi-agent pipeline using Xiaomi MiMo v2.5 Pro

MiMo Oracle License Tokens

Overview

MiMo Oracle is a production-grade cross-chain oracle aggregation platform that uses multiple specialized AI agents to monitor, validate, and optimize price feeds from decentralized oracles. Built on Xiaomi MiMo's reasoning models, it orchestrates a 5-agent analysis pipeline that continuously consumes millions of API tokens to detect anomalies, validate prices, and ensure feed reliability across chains.

🏗️ Architecture

┌──────────────────────────────────────────────────────────────┐
│                        MiMo Oracle                           │
├──────────────────────────────────────────────────────────────┤
│                                                              │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌───────────┐  │
│  │Chainlink │  │  Pyth    │  │ Anomaly  │  │  Price    │  │
│  │ Monitor  │  │Aggregator│  │ Detector │  │ Validator │  │
│  │ (Agent 1)│  │ (Agent 2)│  │ (Agent 3)│  │ (Agent 4) │  │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘  └─────┬─────┘  │
│       │              │              │               │        │
│       └──────────────┼──────────────┘               │        │
│                      │                              │        │
│               ┌──────▼──────┐                ┌──────▼─────┐  │
│               │  Feed       │                │ Anomaly    │  │
│               │  Optimizer  │                │ Alert      │  │
│               │  (Agent 5)  │                │ Engine     │  │
│               └─────────────┘                └────────────┘  │
│                                                              │
│  ┌──────────────────────────────────────────────────────────┐│
│  │              MiMo API (OpenAI-compatible)                 ││
│  │         Token Tracking & Budget Management               ││
│  └──────────────────────────────────────────────────────────┘│
│                                                              │
│  Supported Oracles: Chainlink · Pyth · Band · API3 · Redstone│
└──────────────────────────────────────────────────────────────┘

🔥 Why It Consumes Millions of Tokens Daily

1. Multi-Agent Architecture

Each price feed analysis runs 5 specialized agents in sequence:

  • Chainlink Monitor: Aggregator contract health, heartbeat checks, deviation thresholds, stale data detection
  • Pyth Aggregator: Price confidence intervals, cross-venue comparison, pull-feed freshness, publication lag
  • Anomaly Detector: Statistical outlier detection, spike/drop pattern recognition, temporal correlation, flash-crash heuristics
  • Price Validator: Multi-oracle consensus checks, TWAP verification, on-chain sanity, arbitrage signal detection
  • Feed Optimizer: Optimal feed selection, latency ranking, cost analysis, fallback chain recommendations

2. Continuous Monitoring

Unlike one-shot audits, MiMo Oracle runs 24/7 continuous monitoring across 200+ trading pairs, 10+ chains, and 5 oracle providers, generating fresh anomaly assessments every 5 minutes.

3. Deep Context Windows

Each agent processes full price history (7-day rolling window), oracle provider metadata, chain-specific gas conditions, and cross-chain correlation data — requiring large context windows and multi-turn reasoning chains.

4. Cross-Chain Correlation

The system correlates signals across chains — detecting when ETH price on Ethereum Chainlink lags behind Solana Pyth by more than 0.3% triggers cross-chain arbitrage analysis consuming additional tokens.

5. Anomaly Deep-Dives

When an anomaly is detected, the system triggers a secondary investigation pipeline — up to 3 follow-up agents analyzing root cause, historical precedents, and blast radius estimation.

Token Consumption Estimates

Scenario Pairs Chains Oracles Frequency Tokens/Day
Single pair monitor 1 1 2 5min ~100K
Portfolio monitoring 20 3 3 5min ~1.5M
Full chain coverage 100+ 5 5 5min ~4M
Anomaly investigations 100+ 10 5 + alerts continuous ~6M+

🚀 Quick Start

Backend (FastAPI)

cd backend
pip install -r requirements.txt
cp .env.example .env  # Add your MiMo API key
uvicorn app.main:app --reload --port 8000

Frontend (Static)

cd frontend
python -m http.server 3000
# Or deploy to Netlify/Vercel

Environment Variables

MIMO_API_KEY=your_key_here
MIMO_BASE_URL=https://api.xiaomimimo.com/v1
MIMO_MODEL=mimo-v2.5-pro
CHAINLINK_RPC=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY
PYTH_ENDPOINT=https://hermes.pyth.network/v2

📡 API Endpoints

Method Endpoint Description
GET /api/health Health check
GET /api/feeds List all monitored oracle feeds
GET /api/feeds/{pair} Get detailed feed for a specific pair
GET /api/anomalies List detected anomalies
GET /api/anomalies/{id} Get anomaly details
POST /api/validate Validate a price across oracles
POST /api/compare Compare oracle feeds for a pair

🛠️ Tech Stack

  • AI Model: Xiaomi MiMo v2.5 Pro (1.6B reasoning model)
  • Backend: Python, FastAPI, OpenAI SDK
  • Frontend: Vanilla JS, CSS3, Dark Theme
  • Oracle Sources: Chainlink, Pyth, Band Protocol, API3, Redstone
  • Chains: Ethereum, Arbitrum, Optimism, Polygon, Base, Solana, Avalanche, BSC
  • API Protocol: OpenAI-compatible
  • Token Management: Real-time tracking, budget enforcement, per-agent breakdown

📊 Daily Token Budget

MiMo Oracle is designed to consume 6+ million tokens daily through:

  1. Continuous feed monitoring — 200+ pairs across 10 chains every 5 minutes
  2. Multi-agent deep analysis — 5 agents × rolling 7-day price context
  3. Cross-chain correlation — detecting oracle lag and arbitrage signals
  4. Anomaly investigation — secondary pipeline for confirmed anomalies
  5. Feed optimization — cost-benefit analysis of oracle selection

Supported Oracles

Oracle Type Chains Latency
Chainlink Decentralized 15+ ~30min heartbeat
Pyth Pull-based 40+ Sub-second
Band Protocol Decentralized 10+ ~15min
API3 First-party 10+ ~5min
Redstone Modular 30+ Real-time push

License

MIT

About

AI-Powered Cross-Chain Oracle Aggregator & Anomaly Detection — Multi-agent pipeline using Xiaomi MiMo

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors