If you're building an AI agent that touches DeFi — a trading bot, a vault rebalancer, a risk monitor — you've probably hit this wall: you can get price data on-chain, but not the indicators traders actually use.
RSI, EMA, Bollinger Bands, VWAP, volatility — these all require historical price series and rolling calculations. Smart contracts can't do that natively, and most oracles only deliver spot prices.
Pythia solves this. It's an Chainlink oracle that calculates technical indicators off-chain and delivers the results on-chain. hundreds of indicator feeds across a growing list of tokens, updated continuously.
Here's how to use it in your AI agent or smart contract.
Option 1: MCP Server (for AI Agents)
If you're building with Claude, Cursor, Windsurf, or any MCP-compatible AI agent, the fastest path is the MCP server:
pip install pythia-oracle-mcp
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"pythia-oracle": {
"command": "pythia-oracle-mcp"
}
}
}
Claude Code
claude mcp add pythia-oracle -- pythia-oracle-mcp
Cursor / Windsurf / VS Code
Add to your MCP settings:
{
"pythia-oracle": {
"command": "pythia-oracle-mcp"
}
}
Once connected, your AI agent can query Pythia directly:
- "What's the current RSI for Bitcoin?"
- "Show me all indicator feeds for Solana"
- "Is the oracle healthy? Check uptime."
- "Give me a Solidity contract to consume the speed bundle"
The MCP server exposes 7 tools: list_tokens, get_token_feeds, get_market_summary, check_oracle_health, get_contracts, get_pricing, and get_integration_guide.
Option 2: LangChain (for Python Agents)
If you're building with LangChain or LangGraph:
pip install langchain-pythia
from langchain_pythia import PythiaOracleTool
# Create the tool
pythia = PythiaOracleTool()
# Use in any LangChain agent
from langchain.agents import AgentExecutor, create_tool_calling_agent
agent = create_tool_calling_agent(llm, [pythia], prompt)
The tool handles natural language queries about tokens, feeds, health, contracts, and integration code — same capabilities as the MCP server.
Option 3: Direct Smart Contract Integration
For on-chain consumption, your contract calls Pythia through Chainlink's oracle pattern. Here's the minimal Solidity:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol";contract MyDeFiAgent is ChainlinkClient {
using Chainlink for Chainlink.Request;
uint256 public btcRsi;
// Pythia operator on Polygon
address constant OPERATOR = 0x2b12c1eC4e1109D1D8f78CfA1b454a4903E8f68;
function requestBtcRsi() external {
Chainlink.Request memory req = _buildChainlinkRequest(
"DISCOVERY_JOB_ID", // 0.01 LINK per request
address(this),
this.fulfill.selector
);
req._add("feed", "bitcoin_RSI_1H_14");
_sendChainlinkRequestTo(OPERATOR, req, 0.01 ether);
}
function fulfill(bytes32 requestId, uint256 value)
public recordChainlinkFulfillment(requestId)
{
btcRsi = value; // RSI scaled to 1e18
}
}
Pricing Tiers
| Tier | Cost | What You Get |
|---|---|---|
| Discovery | 0.01 LINK | Single indicator per request |
| Analysis | 0.03 LINK | Category bundle (all EMAs, all RSIs, etc.) |
| Speed | 0.05 LINK | All indicators for one timeframe |
| Complete | 0.10 LINK | Everything for a token |
There's also a free faucet contract — 5 requests/day, no LINK needed. Perfect for testing.
What Indicators Are Available?
Pythia calculates 5 indicator types across 4 timeframes for each token:
- EMA (Exponential Moving Average) — trend direction
- RSI (Relative Strength Index) — overbought/oversold
- Bollinger Bands (upper + lower) — volatility channels
- Volatility — realized price volatility
- USD Price — spot price baseline
Timeframes: 5-minute, 1-hour, 1-day, 1-week
Currently covering 20+ tokens including BTC, SOL, TAO, RENDER, ONDO, FET, SUI, INJ, TIA, POL, AAVE, UNI, LINK, COMP, CRV, and more — with new tokens added regularly
These aren't just price feeds — they're the same calculated metrics that quantitative traders and DeFi protocols need for automated decision-making.
Why This Matters for AI Agents
Most AI agents that interact with DeFi are flying blind. They can see prices, but they can't see momentum, volatility regimes, or mean-reversion signals without building their own indicator pipeline.
With Pythia, your agent gets pre-calculated, on-chain-verified indicators with a single call. Use cases:
- Vault rebalancing — trigger rebalance when RSI crosses 70 or Bollinger width expands
- Risk monitoring — alert when volatility spikes above threshold
- Trading signals — combine EMA crossovers with RSI for entry/exit logic
- Portfolio analysis — real-time calculated metrics across all supported tokens
Get Started
-
MCP Server:
pip install pythia-oracle-mcp(PyPI) -
LangChain:
pip install langchain-pythia(PyPI) - Solidity Examples: pythia-oracle-examples
- Live Feed Explorer: pythia.c3x-solutions.com
- GitHub: pythia-the-oracle
If you're building AI agents for DeFi, this is the missing data layer.
Top comments (0)