langchain-prediction-markets
v1.0.0
Published
LangChain tools for prediction market data. World state, uncertainty index, edges, and market detail from 30,000+ markets.
Maintainers
Readme
langchain-prediction-markets
LangChain tools for real-time prediction market data. Drop-in tools that give any LangChain agent world awareness from 30,000+ markets.
Install
npm install langchain-prediction-markets @langchain/coreQuick Start
import { ChatOpenAI } from '@langchain/openai'
import { createReactAgent } from '@langchain/langgraph/prebuilt'
import { predictionMarketTools } from 'langchain-prediction-markets'
const agent = createReactAgent({
llm: new ChatOpenAI({ model: 'gpt-4o' }),
tools: predictionMarketTools(),
})
const result = await agent.invoke({
messages: [{ role: 'user', content: 'What are the key geopolitical risks right now?' }],
})Tools
| Tool | Description |
|------|-------------|
| get_world_state | Full world state (~800 tokens) with index, movers, edges, divergences |
| get_uncertainty_index | Four-signal uncertainty index (0-100) |
| get_market_edges | Actionable mispricings with reasoning and causal path |
| get_market_detail | Single market detail with optional orderbook |
| get_world_changes | Incremental changes since a given time |
Individual Tools
import { getWorldState, getUncertaintyIndex, getMarketEdges } from 'langchain-prediction-markets'
// Use individually in any LangChain agentLicense
MIT — SimpleFunctions
