LangChain Plugin
Native LangChain tool for querying signed oracle data from Python AI pipelines — prices, regime intelligence, macro risk scores, and more. 22 tools across all four oracle layers. Free preview mode included — no wallet required to get started.
No wallet or API key needed. Install the package and start querying immediately. Preview mode returns real price data (up to 5 minutes stale, unsigned). Set MYCELIA_WALLET_PRIVATE_KEY to upgrade to real-time signed attestations via x402.
Installation
# Free tier — preview mode only pip install langchain-mycelia-signal # Paid tier — includes eth_account for x402 automatic payment pip install langchain-mycelia-signal[paid]
Quick Start
Free Mode (no wallet required)
Without a wallet key configured, all queries hit the free preview endpoints. Data is real but may be up to 5 minutes stale and is not cryptographically signed.
from langchain_mycelia_signal import MyceliaSignalTools # No env var needed — free preview mode tools = MyceliaSignalTools().as_list() tool = tools[0] result = tool.invoke({"pair": "BTCUSD"}) print(result)
Pair: BTCUSD Price: 70659.41 USD Timestamp: 2026-03-06T10:10:12Z Sources: ['binance', 'binance_us', 'bitfinex', 'bitstamp', 'coinbase', 'gateio', 'gemini', 'kraken', 'okx'] Method: median Signed: False
Paid Mode (real-time signed attestations)
Set MYCELIA_WALLET_PRIVATE_KEY to a funded Base wallet and the tool automatically pays $0.001 USDC per query via x402, returning a fully signed attestation.
export MYCELIA_WALLET_PRIVATE_KEY=0xYourBaseWalletPrivateKey
from langchain_mycelia_signal import MyceliaSignalTools tools = MyceliaSignalTools().as_list() result = tools[0].invoke({"pair": "BTCUSD"})
Pair: BTCUSD Price: 70659.41 USD Timestamp: 2026-03-06T10:10:12Z Sources: ['binance', 'binance_us', 'bitfinex', 'bitstamp', 'coinbase', 'gateio', 'gemini', 'kraken', 'okx'] Method: median Signed: True Signature: QiQK2fdRh4ROB8Vl... Pubkey: 0236a051b7a0384e... Canonical: v1|BTCUSD|70659.41|USD|2|2026-03-06T10:10:12Z|890123|binance,...|median
Using with a LangChain Agent
from langchain_mycelia_signal import MyceliaSignalTools from langchain.agents import AgentExecutor, create_tool_calling_agent from langchain_openai import ChatOpenAI from langchain_core.prompts import ChatPromptTemplate # Load the oracle tool tools = MyceliaSignalTools().as_list() # Build the agent llm = ChatOpenAI(model="gpt-4o") prompt = ChatPromptTemplate.from_messages([ ("system", "You are a financial data assistant. Use the oracle tool to fetch verified prices."), ("human", "{input}"), ("placeholder", "{agent_scratchpad}"), ]) agent = create_tool_calling_agent(llm, tools, prompt) executor = AgentExecutor(agent=agent, tools=tools) # Run a query result = executor.invoke({"input": "What is the current Bitcoin price in USD?"}) print(result["output"])
All 22 Tools
The package exposes tools across all oracle layers. Pass the tool name to MyceliaSignalTools(tools=[...]) to load a subset, or use .as_list() for all.
| Tool | Layer | Description | Paid cost |
|---|---|---|---|
get_price | L1 | Spot price for any supported pair | $0.01 |
get_price_vwap | L1 | 5-min VWAP for BTC/ETH pairs | $0.02 |
get_fx_rate | L1 | FX rate for any supported currency pair | $0.01 |
get_volatility_index | L1 | MSVI volatility index for BTC or ETH | $0.05 |
get_sentiment_index | L1 | MSXI sentiment index for BTC or ETH | $0.05 |
get_stress_index | L1 | MSSI market stress index | $0.05 |
get_contagion_index | L1 | MSTI crypto-TradFi contagion index | $0.05 |
get_funding_rate | L1 | Composite funding rate for BTC/ETH/SOL | $0.05 |
get_gas_price | L1 | Gas price for Ethereum, Base, Arbitrum, Polygon, Optimism, Solana | $0.01 |
get_econ_indicator | L1 | Economic indicator (CPI, NFP, Fed Funds, GDP…) | $0.10 |
get_commodity_price | L1 | Gold, crude oil, natural gas, copper, DXY | $0.10 |
get_cot_positioning | L1 | BTC CME COT institutional positioning | $1.00 |
get_weather | L1 | Weather data at any coordinates | $0.10 |
get_marine_data | L1 | Sea state, vessel tracking, voyage forecast | $0.10–$0.50 |
get_defi_yield | L1 | DeFi yield rates across 15+ protocols | $0.05 |
get_market_synopsis | L2 | 15-signal market state snapshot | $0.25 |
get_perp_regime | L2 | Perp trading regime for BTC, ETH, or SOL | $0.15 |
get_macro_risk | L3 | Cross-domain macro risk score 0–100 | $1.00 |
get_perp_setup | L3 | Best perp setup across BTC/ETH/SOL | $1.00 |
get_defi_opportunity | L3 | Risk-adjusted DeFi yield opportunity | $0.75 |
price_tools | — | Convenience loader — price + FX tools only | — |
intel_tools | — | Convenience loader — Layer 2 + Layer 3 tools only | — |
Supported Pairs
| Pair | Description | Sources | Method |
|---|---|---|---|
BTCUSD | Bitcoin / US Dollar | 9 | Median |
BTCUSD_VWAP | Bitcoin / US Dollar (5-min VWAP) | 7 | VWAP |
ETHUSD | Ethereum / US Dollar | 5 | Median |
EURUSD | Euro / US Dollar | 8 | Median |
XAUUSD | Gold / US Dollar | 8 | Median |
SOLUSD | Solana / US Dollar | 9 | Median |
BTCEUR | Bitcoin / Euro | 17 | Cross-rate |
BTCEUR_VWAP | Bitcoin / Euro (5-min VWAP) | 17 | VWAP cross-rate |
ETHEUR | Ethereum / Euro | 4 | Hybrid median |
SOLEUR | Solana / Euro | 4 | Hybrid median |
XAUEUR | Gold / Euro | Combined | Cross-rate |
Pass any pair name to the tool's pair argument. Case-insensitive — btcusd, BTCUSD, and BTC/USD all work.
Free vs Paid Mode
| Feature | Free (Preview) | Paid (x402) |
|---|---|---|
| Setup required | None | Base wallet with USDC |
| Data freshness | Up to 5 min stale | Real-time |
| Cryptographic signature | No | Yes (Ed25519) |
| Cost | Free | $0.001 USDC / query |
| Suitable for production | No | Yes |
| Verify independently | No | Yes |
Response Format
The tool returns a formatted string. In paid mode, signature fields are appended:
Pair: BTCUSD Price: 70659.41 USD Timestamp: 2026-03-06T10:10:12Z Sources: ['binance', 'binance_us', ...] Method: median Signed: True # False in preview mode Signature: QiQK2fdRh4ROB8Vl... # Only in paid mode Pubkey: 0236a051b7a0384e... # Only in paid mode Canonical: v1|BTCUSD|... # Only in paid mode
In paid mode, the canonical field contains the complete pipe-delimited payload that was signed. You can independently verify the signature using the pubkey — see the Signature Verification guide.
Environment Variables
| Variable | Required | Description |
|---|---|---|
MYCELIA_WALLET_PRIVATE_KEY | No | Base wallet private key (0x...). If set, enables paid mode with real-time signed attestations via x402. |
Package Info
| Detail | Value |
|---|---|
| PyPI | langchain-mycelia-signal |
| Latest version | 2.4.0 |
| Python | 3.11+ |
| License | MIT |
| GitHub | jonathanbulkeley/langchain-mycelia-signal |