Inspiration

Most "AI agents" stop at conversation they answer, then hand the real work back to you. We wanted an agent that finishes the job, end to end, with money and consequences on the line. Prediction markets are the perfect proving ground: someone has to invent a good question, price it, settle it against reality, and pay out a genuinely multi-step mission where being wrong has a cost.

That last part scared us in the best way. An agent that settles real markets can also settle them wrong. So the project became as much about trust as about autonomy: how do you let Gemini act freely, while proving to a human and to a dashboard that every decision was sound?

What it does

Xante Market is an autonomous prediction arena run by a fleet of Gemini 3 agents:

  • Curator drafts new markets from live events (Gemini 3 + Google Search grounding).
  • Resolver settles closed markets, emitting a structured {verdict, confidence, rationale} for every call.
  • Quality Agent the centerpiece reads the Resolver's own traces and evaluations back through the Arize Phoenix MCP server, then auto-rejects weak settlements and escalates the genuine judgment calls to a human.
  • Coach answers market questions for users.

Low-confidence outcomes never settle automatically they land in a human review queue. The agent is fast and autonomous; the human stays in control.

How we built it

  • Brain: Gemini 3 (@google/genai), orchestrated for Google Cloud Agent Builder / Vertex. We move every reasoning call to Gemini, using built-in Google Search grounding for research.
  • Observability (Arize): every Gemini call is wrapped as an OpenInference LLM span exported via OTLP to Arize. We built a golden dataset and an eval harness scoring resolution correctness and rationale faithfulness (hallucination) those evals are exactly what the Quality Agent later queries.
  • Partner superpower (Arize Phoenix MCP): a stdio MCP client spawns @arizeai/phoenix-mcp and bridges its tools into a Gemini tool-calling loop, so the Quality Agent autonomously navigates datasets, experiments, and traces to justify its decision.
  • Action layer: on-chain markets (Solidity, hybrid AMM + CLOB) plus a Postgres review queue and a human approval console.

The math we had to get right

Each market is a constant-product AMM over outcome shares. Spot price of YES is

$$ p_{\text{yes}} = \frac{y_{\text{no}}}{y_{\text{yes}} + y_{\text{no}}} $$

The subtle part was selling. A naive implementation paid out single-sided shares at par, which let a trader buy and instantly sell back at a profit — draining liquidity providers. The correct sell of $S$ shares merges $R$ complete sets, where the leftover $S-R$ shares swap along the curve. With fee $f = 1 - \text{feeBps}$, $R$ is the smaller root of

$$ R^2 - \left(\frac{x}{f} + y + S\right)R + yS = 0 $$

solved on-chain with an integer Babylonian square root. A round-trip now returns the input minus fees, never more.

What we learned

  • Agent observability is a feature, not an afterthought. Wiring Arize in early turned "the agent seems fine" into measurable correctness and faithfulness numbers and gave the Quality Agent real evidence to reason over.
  • MCP makes self-reflection composable. Letting Gemini call its own observability platform as a tool rather than us pre-summarizing produced genuinely useful escalation decisions.
  • Tests catch what eyeballs miss. Our invariant test flagged the sell bug as 188506818 >= 100000000 a 1.9× risk-free round-trip before it ever shipped.

Challenges we faced

  • Trust vs. autonomy: designing the confidence gate + dispute path so the agent is bold but never settles a coin-flip on its own.
  • A real, fund-draining contract bug in the AMM sell() found and fixed only because we wrote the Foundry invariant suite (13/13 green now).
  • Bridging arbitrary MCP tool schemas into Gemini's function-calling format without losing fidelity.

Built With

Share this project:

Updates

Submission history