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()  # 15 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_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 15 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, 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.0.0.tar.gz (73.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.0.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: langchain_mycelia_signal-2.0.0.tar.gz
  • Upload date:
  • Size: 73.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.0.0.tar.gz
Algorithm Hash digest
SHA256 7f863f9339e005e4f5d0ae7a8817a6bfb926de7c6155e6732740c5b169babbb7
MD5 748363b3febf86ee2019647667d43be9
BLAKE2b-256 2f355f415601b3d353f276bd67606768a7a2323a7ed707d7ac2875a43bd58148

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for langchain_mycelia_signal-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a5882cecffcaabdc765e247a992f8f1689d3522ffde6c19b4f7fe444e52c0f4
MD5 b08d25b33acc22148e6ec5dd7a1aa3fc
BLAKE2b-256 cde6efe2e0528ebd326fd9923561cbb4458757f48843f9d20644c54b91c359d9

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