Skip to main content

LangChain tools for Mycelia Signal — cryptographically signed oracle data (prices, indices, derivatives, weather, marine, gas, COT, DLC) with automatic x402 payment

Project description

langchain-mycelia-signal

LangChain tools for Mycelia Signal — cryptographically signed oracle data with automatic x402 (USDC on Base) payment.

117 endpoints across prices, indices, derivatives, weather, marine, gas, COT, and DLC contracts. No API keys. No accounts. Install and go.


Installation

pip install langchain-mycelia-signal

For paid mode (signed attestations with automatic x402 payment):

pip install langchain-mycelia-signal[paid]

Quick Start

from langchain_mycelia_signal import MyceliaSignalTools
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_openai import ChatOpenAI

tools = MyceliaSignalTools().as_list()  # 17 tools covering 117 endpoints

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

result = executor.invoke({"input": "What is the Bitcoin price?"})
result = executor.invoke({"input": "What's the crypto market stress level?"})
result = executor.invoke({"input": "Show me BTC funding rates across exchanges"})

Free vs Paid Mode

Free mode (default — no config needed)

Returns data without cryptographic signature. Data may be up to 5 minutes stale.

tools = MyceliaSignalTools()
print(tools.mode)  # "free"

Paid mode — signed attestations

Add your Base wallet private key to .env:

MYCELIA_WALLET_PRIVATE_KEY=0x...

Payment is handled automatically via x402 (USDC on Base). No code changes required.

tools = MyceliaSignalTools()
print(tools.mode)  # "paid"

Tools (15 total)

get_mycelia_price — Prices, FX, Macro, Commodities

56 pairs across crypto spot, VWAP, precious metals, FX, US/EU economic indicators, and commodities.

get_mycelia_price.invoke({"pair": "BTCUSD"})      # $0.01
get_mycelia_price.invoke({"pair": "EURUSD"})       # $0.01
get_mycelia_price.invoke({"pair": "XAUUSD"})       # $0.01
get_mycelia_price.invoke({"pair": "BTCUSD_VWAP"})  # $0.02
get_mycelia_price.invoke({"pair": "US_CPI"})       # $0.10
get_mycelia_price.invoke({"pair": "WTI"})          # $0.10

Crypto: BTCUSD, BTCEUR, BTCJPY, ETHUSD, ETHEUR, ETHJPY, SOLUSD, SOLEUR, SOLJPY, XRPUSD, ADAUSD, DOGEUSD, USDTUSD, USDCUSD VWAP: BTCUSD_VWAP, BTCEUR_VWAP Metals: XAUUSD, XAUEUR, XAUJPY FX: EURUSD, EURJPY, EURGBP, EURCHF, EURCNY, EURCAD, GBPUSD, GBPJPY, GBPCHF, GBPCNY, GBPCAD, USDJPY, USDCHF, USDCNY, USDCAD, CHFJPY, CHFCAD, CNYJPY, CNYCAD, CADJPY US Econ: US_CPI, US_CPI_CORE, US_UNRATE, US_NFP, US_FEDFUNDS, US_GDP, US_PCE, US_YIELD_CURVE EU Econ: EU_HICP, EU_HICP_CORE, EU_HICP_SERVICES, EU_UNRATE, EU_GDP, EU_EMPLOYMENT Commodities: WTI, BRENT, NATGAS, COPPER, DXY

get_mycelia_index — Market Indices ($0.05)

Four proprietary indices computed from cross-exchange derivatives data (11 exchanges).

get_mycelia_index.invoke({"index": "MSVI_BTC"})   # Volatility index
get_mycelia_index.invoke({"index": "MSXI_BTC"})   # Sentiment index (-100 to +100)
get_mycelia_index.invoke({"index": "MSSI"})        # Stress index (0-100)
get_mycelia_index.invoke({"index": "MSTI"})        # Crypto-TradFi contagion (0-100)

Keys: MSVI_BTC, MSVI_ETH, MSXI_BTC, MSXI_ETH, MSSI, MSTI

get_mycelia_funding — Funding Rates ($0.05)

Cross-exchange perpetual funding rates from 11 venues with per-exchange breakdown.

get_mycelia_funding.invoke({"currency": "BTC"})  # Composite + 11 exchange rates
get_mycelia_funding.invoke({"currency": "ETH"})
get_mycelia_funding.invoke({"currency": "SOL"})

get_mycelia_oi — Open Interest ($0.01)

Cross-exchange open interest with 1h/4h/24h deltas.

get_mycelia_oi.invoke({"currency": "BTC"})

get_mycelia_basis — Basis/Carry ($0.02)

Per-exchange basis (mark vs index), annualized carry, regime (CONTANGO/BACKWARDATION/FLAT).

get_mycelia_basis.invoke({"currency": "BTC"})

get_mycelia_weather — Weather Oracle ($0.10)

ERA5 reanalysis data at any global coordinate. Used for parametric insurance.

get_mycelia_weather.invoke({"lat": 37.77, "lon": -122.41, "metric": "wrsi", "window": "30d"})
get_mycelia_weather.invoke({"lat": 1.35, "lon": 103.82, "metric": "rainfall", "window": "7d"})

Metrics: wrsi, rainfall, temperature, wind

get_mycelia_marine_seastate — Marine Oracle ($0.10)

Significant wave height, swell, and wind waves at any ocean coordinate.

get_mycelia_marine_seastate.invoke({"lat": 25.76, "lon": -80.19})

get_mycelia_gas — Gas Oracle ($0.01-$0.05)

Real-time gas prices for EVM and non-EVM chains.

get_mycelia_gas.invoke({"chain": "ETHEREUM"})  # $0.01
get_mycelia_gas.invoke({"chain": "INDEX"})     # $0.05 — cross-chain comparison

Chains: ETHEREUM, BASE, ARBITRUM, POLYGON, OPTIMISM, SOLANA, INDEX

get_mycelia_compute — GPU Compute Oracle ($0.05)

Real-time GPU pricing from AWS Spot, Vast.ai, RunPod, Akash. 80+ models normalized to $/GPU-hour.

get_mycelia_compute.invoke({"query": "compare"})        # Cheapest per model
get_mycelia_compute.invoke({"query": "best_h100_sxm"})  # Best H100 SXM price
get_mycelia_compute.invoke({"query": "all"})            # All 575+ prices
get_mycelia_compute.invoke({"query": "catalogue"})      # Free — list models

Queries: all, compare, best_h100_sxm, best_a100_sxm, best_h200, best_rtx_4090, best_l40s, best_mi300x, catalogue Sources: AWS Spot, Vast.ai, RunPod, Akash Network

get_mycelia_defi_yield — DeFi Yield Oracle ($0.05)

On-chain lending rates from 7 protocols across 7 chains. Direct smart contract reads.

get_mycelia_defi_yield.invoke({"query": "compare"})     # USDC rates across all protocols
get_mycelia_defi_yield.invoke({"query": "best_usdc"})   # Best USDC supply yield
get_mycelia_defi_yield.invoke({"query": "all"})         # All 40 rates
get_mycelia_defi_yield.invoke({"query": "catalogue"})   # Free — list protocols

Queries: all, compare, best_usdc, best_usdt, best_weth, best_dai, best_wbtc, catalogue Protocols: Aave V3, Spark, Compound V3, Venus, Benqi, Moonwell Chains: Ethereum, Base, Arbitrum, Polygon, Optimism, Avalanche, BNB

get_mycelia_cot — COT Data ($1.00)

CFTC Commitments of Traders for Bitcoin CME futures. Weekly data, auto-refreshed Fridays.

get_mycelia_cot.invoke({})

DLC Oracle Tools

Register and query Bitcoin DLC (Discreet Log Contract) oracle events.

# Free preview
dlc_threshold_preview.invoke({"pair": "BTCUSD", "strike": 90000, "direction": "above"})

# Paid registration ($7.00)
dlc_register_threshold.invoke({"pair": "BTCUSD", "strike": 90000, "direction": "above"})
dlc_register_enum.invoke({"outcomes": ["below_70k", "70k_80k", "above_80k"], "event_id": "my-event", "maturity": 1750000000})
dlc_register_numeric.invoke({"event_id": "my-numeric", "maturity": 1750000000})

# Free queries
dlc_get_attestation.invoke({"event_id": "BTCUSD-2026-04-07T00:00:00Z"})
dlc_list_announcements.invoke({})

Tool Subsets

from langchain_mycelia_signal import MyceliaSignalTools

tools = MyceliaSignalTools()
tools.as_list()            # All 17 tools
tools.price_tools()        # Just price/FX/macro
tools.index_tools()        # Just MSVI/MSXI/MSSI/MSTI
tools.derivatives_tools()  # Funding, OI, basis
tools.data_tools()         # Weather, marine, gas, DeFi yield, COT
tools.dlc_tools()          # All 6 DLC tools

Links


License

MIT

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_mycelia_signal-2.2.0.tar.gz (75.5 kB view details)

Uploaded Source

Built Distribution

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

langchain_mycelia_signal-2.2.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file langchain_mycelia_signal-2.2.0.tar.gz.

File metadata

  • Download URL: langchain_mycelia_signal-2.2.0.tar.gz
  • Upload date:
  • Size: 75.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for langchain_mycelia_signal-2.2.0.tar.gz
Algorithm Hash digest
SHA256 bbbe63a07cb20d5007f5f60955fc800ac7976fe88aaaafcb0ab2cf6f2c4d204d
MD5 e8b63add6283a0d2ef52dd1641896d44
BLAKE2b-256 55f713e6d2598b1362d47aed1178574115a851d3087c9666fdc820bb92537dac

See more details on using hashes here.

File details

Details for the file langchain_mycelia_signal-2.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_mycelia_signal-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3bd91e4840603393a72c01f5f1beffa53dc23e7a4dd073f91101de1fd43b9d19
MD5 539fa230105a77428d43e9af55db071d
BLAKE2b-256 0fd5be7ee2c0ae3d54ce5099eaff40fce21677970565dfb76225788183969bc2

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