Overview
PredictionMarket lets agents bet on candidate answers instead of voting on them or debating them. Each agent first solves independently. Equal answers are grouped, and those reached by at least min_attempts attempts become tradable assets whose opening prices follow how many attempts reached them. Each agent then reads one solution per answer, bets chips without seeing the others, and may trade once more after seeing the updated prices. The answer with the highest closing price wins.
An answer few attempts reached is cheap, so a correct minority answer pays more than a popular one and following the majority pays little. That is the whole incentive: the market rewards being right when the others are wrong.
Based on Betting Against the Majority: Multi-Agent Prediction Market Reduces Conformity by Justin Chih-Yao Chen, Zaid Khan, Joykirat Singh, Runchu Tian, Hyunji Lee, Elias Stengel-Eskin and Mohit Bansal (2026).
Installation
Architecture
Key Concepts
- Attempts: Independent solutions from
agentsworthattempts_per_agenteach. Every attempt ends with afinal_answer. - Listed answers: Answers reached at least
min_attemptstimes. When only one is listed, it is returned directly without opening a market. When none reachesmin_attempts, every answer is listed. - LMSR market maker: Prices follow
price / totalwhere each price isexp(q / b).liquidity(b, default10) controls how much a chip moves the price. - Chips: Every agent may spend
chips_per_agentper round. Chips reset every run. - Structured outputs: Solving returns
SolverOutputand trading returnsTraderOutputthroughresponse_format. Setuse_structured_outputs=Falseto read formatted lines instead.
Attributes
Unique identifier for the market. When omitted, one is generated as
prediction-market-<32 hex characters>.Fewest attempts an answer needs to be listed. When no answer reaches it, every answer is listed.
The market maker liquidity parameter
b. A larger value makes prices move less per chip.1 for a sealed round only, or 2 to let agents trade again after seeing the prices. The second round runs only when first choices differ.Maps an answer to the grouping key. The default unwraps boxed answers, drops markup and a trailing period, collapses whitespace, and lowercases.
How
run formats the conversation, for example "dict", "list", "str", or "final".Ask for
SolverOutput while solving and TraderOutput while trading through response_format. When False, the market reads FINAL ANSWER, BELIEF and BUY lines instead.The constructor raises
ValueError for empty agents, out-of-range settings, or repeated agent names. When use_structured_outputs is True, it also rejects agents with max_loops="auto", which structured outputs do not support. Give agents a number or set use_structured_outputs=False. The market also restores each agent’s original output_schema when a run ends.Methods
run()
Open a market on the task and return the winning answer.task(str): The question to answer.img(Optional[str]): Image sent to every agent with the task.possible_answers(Optional[List[str]]): Known options to trade on. Without them the market lists only answers reached by several attempts. With them the market lists these strings, using attempt counts for opening prices.solve_attempts(bool): Solve before trading whenTrue. WhenFalsewithpossible_answersset, trade on the list directly without solving.
output_type. Its last message holds the winning answer and the closing prices.
Raises:
RuntimeError: If no attempt produced a final answer and nopossible_answerswere given.ValueError: Ifpossible_answersis empty or duplicated, or if solving is off withoutpossible_answers.
possible_answers is given but solving produces no matching attempts, the market still opens on the list instead of raising.
The structured outcome is kept on market.result as a MarketResult with winner, market_opened, attempt_counts, opening_prices, closing_prices, trades, and beliefs.
batch_run()
Run one market per task, one after another.possible_answers and solve_attempts are shared by every market.
usage
Provider token usage summed over every agent in the market, withinput_tokens, output_tokens, cached_tokens, reasoning_tokens, and total_tokens.