AI-Powered, Privacy-Preserving Oracle Layer
Detecting anomalies in real-time price feeds and automating secure DeFi actions through decentralized infrastructure.
- π€ Live Agent: SentinelAI on Agentverse
- π Smart Contract: 0x4c299a...dbFB0 on Sepolia
- π₯ Demo Video: demo
- π Dashboard: https://sentinel-oracle.vercel.app/
- Vincent Published Ability: package
- Vincent Published App ID:
8497142216
Sentinel Oracle is an intelligent oracle system that combines:
- π Pyth Network - Real-time, accurate price feeds via Pull Oracle
- π€ ASI Alliance - AI-powered anomaly detection using uAgent + MeTTa reasoning
- π Lit Protocol / Vincent - Privacy-preserving automated execution
DeFi protocols depend on oracles for critical pricing data. However, oracles can be:
- Manipulated (flash loan attacks, MEV)
- Delayed (network congestion)
- Temporarily incorrect (API failures)
This leads to cascading liquidations and financial losses.
Sentinel Oracle continuously monitors price feeds, detects anomalies using AI, and executes privacy-preserving automations to protect user positions.
Example Flow:
1. BTC price drops 10% in 2 minutes β οΈ
2. AI agent detects anomaly (z-score > 2.5) π€
3. Lit Protocol decrypts user's private trigger π
4. Vincent executes stop-loss automatically β‘
5. User's position is protected π‘οΈ
ββββββββββββββββββββββββββββββ
β Pyth Network β
β (Hermes API β On-chain) β
βββββββββββββββ¬βββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββ
β ASI Sentinel uAgent β
β - Fetch prices β
β - MeTTa reasoning β
β - Detect anomalies β
β - Flag on-chain β
βββββββββββββββ¬βββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββ
β SentinelOracle.sol β
β - Store prices β
β - Manage deposits β
β - Trigger events β
βββββββββββββββ¬βββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββ
β Vincent App (Lit Layer) β
β - StopLossAbility β
β - Encrypted triggers β
β - Automated execution β
βββββββββββββββ¬βββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββ
β Frontend Dashboard β
β - Live prices β
β - Agent chat β
β - User controls β
ββββββββββββββββββββββββββββββ
- Node.js 18+ and npm
- Python 3.9+
- MetaMask or compatible Web3 wallet
- Testnet ETH (Sepolia)
# Clone the repository
git clone https://github.com/YOUR_USERNAME/sentinel-oracle.git
cd sentinel-oracle
# Install contract dependencies
cd contracts
npm install
cp .env.example .env
# Edit .env with your keys
# Install agent dependencies
cd ../agent
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your keys
# Install frontend dependencies
cd ../frontend
npm install
cp .env.local.example .env.local
# Edit .env.local with your settings
# Install Lit/Vincent dependencies
cd ../lit_vincent
npm installcd contracts
# Compile
npx hardhat compile
# Deploy to Sepolia
npx hardhat run scripts/deploy.js --network sepolia
# Note the deployed contract address
# Update .env files in agent/ and frontend/cd contracts
# Start pushing prices (keep running)
node scripts/updatePythPrice.jscd agent
# Activate virtual environment
source venv/bin/activate
# Start the agent (keep running)
python agent.py
# In another terminal, start API server
python api_server.pycd frontend
# Development mode
npm run dev
# Visit http://localhost:3000Most innovative use of Pyth Pull Oracle
β What we implemented:
- Fetch price data via Hermes API
- Update on-chain using Pull Oracle method
- Use prices as base layer for anomaly detection
- Innovative security use case (not just price display)
π Contract: SentinelOracle.sol - Deployed at 0x4c299a5c75Fd195e3418Daea67116Fd742adbFB0
π Script: contracts/scripts/updatePythPricePull.js - Hermes Pull Oracle integration
π Innovation: AI-powered anomaly detection on multi-asset Pyth feeds
π Network: Sepolia Testnet - View on Etherscan
DeFi automation with Vincent App
β What we implemented:
- Vincent App with StopLossAbility
- Accepts user deposits on-chain
- Encrypts user trigger conditions with Lit
- Automated transaction execution when conditions met
π App: lit_vincent/vincent_ability.js
π Encryption: lit_vincent/lit_client.js
π Contract: SentinelOracle.sol - executeAction()
uAgent + MeTTa + ASI:One
β What we implemented:
- Official uAgent with real-time anomaly detection (registered on Agentverse)
- MeTTa knowledge graphs for explainable AI reasoning
- ASI:One Chat Protocol for human-agent interaction
- Multi-asset monitoring (5 cryptocurrencies: BTC, ETH, SOL, AVAX, MATIC)
- Real-world impact: DeFi oracle security and automated protection
π Agent: agent/uagent_sentinel.py (Official uAgent)
π Reasoning: MeTTaReasoner class with MeTTa knowledge graphs
π Chat: ASI:One protocol via Agentverse
π Agentverse: https://agentverse.ai/agents/sentinelai-oracle
# 1. Ensure all services are running:
# - Price pusher
# - AI agent
# - API server
# - Frontend
# 2. Open frontend in browser
open http://localhost:3000
# 3. Connect your wallet
# 4. In a new terminal, simulate an anomaly:
cd contracts
node scripts/simulate-anomaly.js
# 5. Watch the agent detect the anomaly
# 6. See the anomaly alert in the frontend
# 7. Chat with the agent to get explanationsπ₯ [Link to demo video] (to be added)
What the demo shows:
- Multi-asset dashboard - Live price feeds from Pyth Network (5 assets)
- User deposits funds and sets encrypted stop-loss trigger
- ASI:One Chat - Interact with the AI agent via Agentverse
- Anomaly simulation - 10% price drop triggered
- AI detection - Agent detects and flags anomaly on-chain
- MeTTa reasoning - Explainable AI knowledge graph output
- Lit + Vincent execution - Automated protective action
- User position protected - Transaction completed
cd contracts
npx hardhat testcd agent
python -m pytest tests/# Run full integration test
./scripts/integration-test.sh- Contracts:
contracts/contracts/SentinelOracle.sol - Agent:
agent/agent.py - Frontend:
frontend/app/page.js - Lit/Vincent:
lit_vincent/
Agent API (http://localhost:5000)
GET /api/status- Get agent statusGET /api/price-history- Get price historyPOST /api/chat- Chat with agent
- Smart contract deployed on Sepolia
- Pyth Pull Oracle integration
- AI agent with anomaly detection
- MeTTa reasoning logic
- Lit Protocol encryption setup
- Vincent App structure
- Frontend dashboard
- Demo simulation script
- Documentation
- Deploy contract to testnet
- Register Vincent App in Registry
- Register uAgent on Agentverse
- Record demo video
- Prepare presentation deck
- Test end-to-end flow
- Update README with live links
Contracts (.env):
SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/YOUR_KEY
PRIVATE_KEY=your_private_key
SENTINEL_ORACLE_ADDRESS=0x...Agent (.env):
ETH_RPC_URL=https://sepolia.infura.io/v3/YOUR_KEY
SENTINEL_ORACLE_ADDRESS=0x...
AGENT_PRIVATE_KEY=your_agent_key
ANOMALY_THRESHOLD=2.5Frontend (.env.local):
NEXT_PUBLIC_ORACLE_ADDRESS=0x...
NEXT_PUBLIC_RPC_URL=https://sepolia.infura.io/v3/YOUR_KEY
NEXT_PUBLIC_AGENT_API_URL=http://localhost:5000| Component | Technology |
|---|---|
| Smart Contracts | Solidity 0.8.20, Hardhat |
| Blockchain | Ethereum Sepolia Testnet |
| Oracle | Pyth Network (Pull Model) |
| AI Agent | Python, uAgents, MeTTa |
| Encryption | Lit Protocol |
| Automation | Vincent Framework |
| Frontend | Next.js 14, React, Tailwind CSS |
| Charts | Recharts |
| Web3 | Ethers.js v6 |
For production deployment, consider:
- Security Audits - Smart contract audit required
- Multi-sig - Use multi-sig for Vincent executor
- Rate Limiting - Implement cooldowns and gas management
- Monitoring - Set up The Graph or event monitoring
- IPFS - Store encrypted triggers on IPFS
- Backup Executors - Implement fallback executors
- Gas Optimization - Optimize contract calls
- Real Pyth Integration - Use full
updatePriceFeeds(bytes[])method
This is a hackathon project. For improvements or issues:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
MIT License - see LICENSE file for details
- Pyth Network - For reliable price feeds
- ASI Alliance / Fetch.ai - For uAgent framework
- Lit Protocol - For encryption and programmable signing
- Vincent - For DeFi automation framework
Sentinel Oracle is unique because it:
- Solves a real problem - Oracle manipulation and DeFi liquidations
- Integrates 3 ecosystems - Pyth + ASI + Lit working together
- Privacy-first - User triggers remain encrypted until execution
- AI-powered - Real reasoning with explainability (MeTTa)
- Production-ready foundation - Clear path to mainnet deployment
We're not just building a demo β we're building the foundation for the next generation of secure, AI-driven DeFi infrastructure.
Built with β€οΈ for the hackathon