Skip to main content

LangChain tool wrappers for MAXIA Oracle — multi-source price feeds for AI agents. Data feed only.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_maxia_oracle-0.1.9.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_maxia_oracle-0.1.9-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file langchain_maxia_oracle-0.1.9.tar.gz.

File metadata

  • Download URL: langchain_maxia_oracle-0.1.9.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for langchain_maxia_oracle-0.1.9.tar.gz
Algorithm Hash digest
SHA256 869d5500111b5a575187fb05edaa7973a720e2f38714e9b2d0d5a6b6cdd0cdd6
MD5 99a1bde84f94221017a1dff6025e1236
BLAKE2b-256 97d7df2ea474e1bd86972f21a309118699d10c7241c52008142232c6b7bd8509

See more details on using hashes here.

File details

Details for the file langchain_maxia_oracle-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_maxia_oracle-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 36d8a53dba7144c93f3be4d68c9981436dc92ad1d257a57636228741ab5888a4
MD5 2e3ca3cfe89d3cd9786268d80e95b216
BLAKE2b-256 1a39776e0f877e83e5af94e4c8a8d9d15561583c20b7e5d7922525b3c9fdd37f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page