Inspiration

AI agents are becoming more independent and able to pay for things themselves. We wanted to create an agent that decides whether it is worth paying data or making trades based on probabilities. Gemini's prediction markets are a good way for us to test this because we are able to produce measurable results using an informed agent.

What it does

PennyWise scan's the Gemini prediction markets for ETH and SOL contracts. For each contract it builds a baseline probability from market data alone and determines the value of information to decide if it should buy paid data from an x402 seller. If it buy's data it will update its forecasts based on provided data and decide whether to trade on a contract or pass. Every purchase goes through guardrails and human approval is required for larger purchases. A live dashboard shows the decisions, payments, wallet status and results.

How we built it

Backend: Python + FastAPI Payments: x402 on Base. The agent signs USDC payments from its own wallet when Nansen returns a 402 offer. Data: Gemini prediction market API for odds, and Nansen's flow-intelligence and smart money endpoints for on-chain signals. LLM agent: Grok running a tool use loop Frontend: React, TypeScript, Tailwind, and Vite, served by FastAPI Deployment: Azure

Challenges we ran into

  • Making it safe to give our LLM a wallet. We had to make sure that every spending limit was set in plain code before anything is signed.
  • Figuring out the initial weights associated with the Nansen signals to help the agent determine if it should buy from the x402 seller.
  • Calculating our own probabilities associated with buying YES/NO on the Gemini prediction markets to compare with the actual markets value.
  • Figuring out how to allow the agent to make smaller payments while also requiring human approval for larger ones.

Accomplishments that we're proud of

  • An agent that turns down the paid data when it isn't worth it.
  • Real x402 micropayments on Base mainnet that use guardrails that run before every signature.
  • Self scoring where every purchase is checked against the settled outcome, which can show whether the data was worth paying for.
  • A dashboard where a person can watch, approve purchases, run the agent once or on a loop, and shut down the agent at any time.

What we learned

  • Most of the work in agentic payments is the safety design around the payment, not just the payment call itself. x402 makes paying easy, which is why it is important that limits are enforced on our agent in code.
  • Value of information is a great way for an agent to be able to reason about spending and if data is worth buying.
  • Short horizon crypto markets are noisy. Determining whether data actually helped requires careful scoring.
  • LLMs are good at choosing what to do next but sizing, limits, and approvals are needed in code.

What's next for PennyWise

  • Turning pennywise into a platform of agents, rather than just having one single agent with the same rules.
  • Moving from shadow trades to real orders on Gemini once we have more scoring data.
  • Voice approval and a narrator explaining the decision log.

Built With

Share this project:

Updates

Submission history