Skip to main content

LangChain tools for Mycelia Signal — cryptographically signed price oracles with automatic x402 (USDC on Base) payment

Project description

langchain-mycelia-signal

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

56 endpoints across crypto, FX, precious metals, US/EU macro, and commodities. 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

# Get tools
tools = MyceliaSignalTools().as_list()

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

# Ask naturally
result = executor.invoke({"input": "What is the Bitcoin price right now?"})
result = executor.invoke({"input": "What is the current US CPI?"})
result = executor.invoke({"input": "What is the EUR/USD rate?"})

Free vs Paid Mode

Free mode (default — no config needed)

Returns price data without a 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 your .env:

MYCELIA_WALLET_PRIVATE_KEY=0x...

The tool detects the key automatically and switches to paid endpoints. Payment is handled internally via x402. No code changes required.

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

Signed responses include a cryptographic signature (Ed25519) verifiable against the published public key. See verification docs.


Supported Pairs (56 endpoints)

Crypto Spot — $0.01 per query

Pair Description
BTCUSD Bitcoin / USD (median, 9 sources)
BTCEUR Bitcoin / EUR (cross-rate + direct feeds)
BTCJPY Bitcoin / JPY
ETHUSD Ethereum / USD (median, 5 sources)
ETHEUR Ethereum / EUR (hybrid)
ETHJPY Ethereum / JPY
SOLUSD Solana / USD (median, 9 sources)
SOLEUR Solana / EUR (hybrid)
SOLJPY Solana / JPY
XRPUSD XRP / USD
ADAUSD Cardano / USD
DOGEUSD Dogecoin / USD

Crypto VWAP — $0.02 per query

Pair Description
BTCUSD_VWAP Bitcoin / USD 5-min VWAP
BTCEUR_VWAP Bitcoin / EUR 5-min VWAP

Precious Metals — $0.01 per query

Pair Description
XAUUSD Gold / USD (median, 8 sources)
XAUEUR Gold / EUR
XAUJPY Gold / JPY

FX Pairs — $0.01 per query

Pairs
EURUSD, EURJPY, EURGBP, EURCHF, EURCNY, EURCAD
GBPUSD, GBPJPY, GBPCHF, GBPCNY, GBPCAD
USDJPY, USDCHF, USDCNY, USDCAD
CHFJPY, CHFCAD, CNYJPY, CNYCAD, CADJPY

US Economic Indicators — $1.00 per query

Indicator Description
US_CPI Consumer Price Index (BLS)
US_CPI_CORE CPI Core (ex food & energy)
US_UNRATE Unemployment Rate
US_NFP Nonfarm Payrolls
US_FEDFUNDS Federal Funds Rate
US_GDP GDP
US_PCE PCE Price Index
US_YIELD_CURVE 10Y-2Y Yield Spread

EU Economic Indicators — $1.00 per query

Indicator Description
EU_HICP HICP Inflation (Eurostat)
EU_HICP_CORE HICP Core
EU_HICP_SERVICES HICP Services
EU_UNRATE Unemployment Rate
EU_GDP GDP
EU_EMPLOYMENT Employment

Commodities — $1.00 per query

Indicator Description
WTI WTI Crude Oil
BRENT Brent Crude Oil
NATGAS Henry Hub Natural Gas
COPPER Copper
DXY US Dollar Index

Example Response

Free mode:

Pair:      BTC/USD
Price:     84231.50 USD
Timestamp: 1741521600
Sources:   binance,binance_us,bitfinex,bitstamp,coinbase,gateio,gemini,kraken,okx
Method:    median
Signed:    False

Paid mode:

Pair:      BTCUSD
Price:     84231.50 USD
Timestamp: 1741521600
Sources:   binance,binance_us,bitfinex,bitstamp,coinbase,gateio,gemini,kraken,okx
Method:    median
Signed:    True
Signature: MEUCIQD...
Pubkey:    03c1955b8c543494c4ecd86d167105bcc7ca9a91b8e06cb9d6601f2f55a89abfbf
Canonical: v1|PRICE|BTCUSD|84231.50|USD|2|1741521600|562204|binance,binance_us,...|median

Direct Tool Use

from langchain_mycelia_signal import get_mycelia_price

result = get_mycelia_price.invoke({"pair": "BTCUSD"})
result = get_mycelia_price.invoke({"pair": "US_CPI"})
result = get_mycelia_price.invoke({"pair": "WTI"})
print(result)

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-1.3.2.tar.gz (12.7 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-1.3.2-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: langchain_mycelia_signal-1.3.2.tar.gz
  • Upload date:
  • Size: 12.7 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-1.3.2.tar.gz
Algorithm Hash digest
SHA256 f1904dec92b3de654c4caf074e757a547e4929eb8ba53694a28543007af54b31
MD5 953bc492578a29a154c80691190f262e
BLAKE2b-256 f71fa8d3ddaea4b119433ef1ed9b8c91d230889ab05df86c9bf06eba1d8a5d34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for langchain_mycelia_signal-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4cd5545e5a67ce60b7297d03cec6ae6e465f8f4c9f6accf42f79dbd4f64872d1
MD5 691b02afff71db9b14e4698670776194
BLAKE2b-256 e330d1e346a0437cf063916eae33de107802a6c756d381e8d6ef2f8570970b75

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