Skip to main content

langchain-maxia-oracle

LangChain tool wrappers for MAXIA Oracle — multi-source crypto and equity price feeds for AI agents.

Data feed only. Not investment advice. No custody. No KYC.

Install

pip install langchain-maxia-oracle

This plugin depends on maxia-oracle (the Python SDK) and langchain-core. The SDK ships a synchronous httpx client with zero other runtime dependencies.

Quick start

Register a free API key against the hosted backend:

curl -X POST https://oracle.maxiaworld.app/api/register
# → {"data": {"api_key": "mxo_xxxxxxxx...", "daily_limit": 100}, ...}

Then wire the tools into any LangChain agent:

from langchain_openai import ChatOpenAI
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_core.prompts import ChatPromptTemplate

from langchain_maxia_oracle import get_all_tools

tools = get_all_tools(api_key="mxo_xxxxxxxx...")
# or rely on the MAXIA_ORACLE_API_KEY environment variable:
# tools = get_all_tools()

prompt = ChatPromptTemplate.from_messages(
    [
        ("system", "You are a market data assistant. Use the tools to answer."),
        ("user", "{input}"),
        ("placeholder", "{agent_scratchpad}"),
    ]
)

llm = ChatOpenAI(model="gpt-4o-mini")
agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools, verbose=True)

executor.invoke({"input": "What is BTC trading at right now?"})

Tools

All 17 tools mirror the MCP surface and the Python SDK methods:

Tool class SDK method Purpose
MaxiaOracleGetPriceTool price(symbol) Multi-source median + divergence
MaxiaOracleGetPricesBatchTool prices_batch(symbols) Up to 50 symbols in one call
MaxiaOracleGetSourcesStatusTool sources() Upstream liveness probe
MaxiaOracleGetCacheStatsTool cache_stats() Aggregator cache + circuit breaker
MaxiaOracleGetConfidenceTool confidence(symbol) Compact agreement metric
MaxiaOracleListSupportedSymbolsTool list_symbols() Full symbol universe by source
MaxiaOracleGetChainlinkOnchainTool chainlink_onchain(symbol, chain) Single-source Chainlink (Base/Ethereum/Arbitrum)
MaxiaOracleHealthCheckTool health() Backend liveness
MaxiaOracleGetRedstoneTool redstone(symbol) Single-source RedStone price
MaxiaOracleGetPythSolanaTool pyth_solana(symbol) Pyth on-chain Solana price
MaxiaOracleGetTwapTool twap(symbol, chain, window_s) Uniswap v3 TWAP on-chain
MaxiaOracleGetPriceContextTool price_context(symbol) Confidence + anomaly + context
MaxiaOracleGetMetadataTool metadata(symbol) CoinGecko market data
MaxiaOracleGetPriceHistoryTool price_history(symbol, range) Historical price snapshots
MaxiaOracleCreateAlertTool create_alert(...) One-shot webhook price alert
MaxiaOracleListAlertsTool list_alerts() List active alerts
MaxiaOracleDeleteAlertTool delete_alert(alert_id) Delete an alert

Every tool returns a JSON string that includes the mandatory disclaimer field so the LLM sees the non-advice notice every time.

Configuration

The tools read configuration from the SDK, which in turn reads from its constructor arguments or from environment variables:

Variable Purpose
MAXIA_ORACLE_API_KEY The mxo_-prefixed key returned by /api/register
MAXIA_ORACLE_BASE_URL Override the backend URL (default https://oracle.maxiaworld.app)

You can also pass a pre-built client instead of letting get_all_tools construct one:

from maxia_oracle import MaxiaOracleClient
from langchain_maxia_oracle import get_all_tools

with MaxiaOracleClient(api_key="mxo_...") as client:
    tools = get_all_tools(client=client)
    # ... use the tools ...

Non-goals

These tools are read-only:

  • No order routing, no swap execution, no custody
  • No KYC, no wallet creation, no signing
  • No tokenized securities (xStocks, etc.)
  • No yield routing or DeFi execution

MAXIA Oracle is positioned as a data feed, not a trading engine.

License

Apache-2.0 — same as the maxia-oracle SDK.

Release files for langchain-maxia-oracle 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-maxia-oracle 0.2.1
File Size Uploaded
langchain_maxia_oracle-0.2.1.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-maxia-oracle 0.2.1
File Interpreter ABI Platform
langchain_maxia_oracle-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.4 kB

Release files / langchain_maxia_oracle-0.2.1.tar.gz

Download URL langchain_maxia_oracle-0.2.1.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2ec2ec98860ddfbb08837637ffff861b6cff36c4db0b9ba35b3253af0c952b69
BLAKE2b-256 checksum
How to use checksums
a3cd6ef341c153d35bdaabe705194ac6e9c740b66cfcc37de05a69c4999bb518
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / langchain_maxia_oracle-0.2.1-py3-none-any.whl

Download URL langchain_maxia_oracle-0.2.1-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc6f9c5181cd88f0f1dfca4d543f12bd95afa3c96997dc2eea7c71c59dd69e40
BLAKE2b-256 checksum
How to use checksums
1027752b7d331b43e91db1954bccf7fa65944ad9087fae2c45e2d687baeb017a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.1.9

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page