Skip to content
N Divij
Résumé
← All work

Case study · 2026 · Stocklana Hackathon 2026

Quaestor

Giving an agent a wallet means trusting it with all of the money. With Quaestor the agent never holds funds. A Solana program or EVM contract does, and it enforces the owner's caps and allowlists on every spend. Each spend commits a hash of the agent's reason, and a watchdog key can suspend the agent but never spend.

Built
2026, for Stocklana Hackathon 2026
Stack
Solana (Anchor + Pinocchio) · Solidity · TypeScript · MCP · Meteora · Uniswap · x402
The hackathon demo. It loads only when you press play.

The problem

An agent that has been talked into a bad trade will sign what it is told. A small balance caps the loss but says nothing about what the money is for, which venues are allowed, or whether a swap delivered what it promised. Session keys and spending-limit modules cap amount and recipient; they cannot express purpose or attach a reason to a spend.

How it works

  1. 01Owner sets policy. Per-trade and epoch caps, instrument and venue allowlists, optional limit price.
  2. 02Gate the price. The quote is checked against independent market prices; any doubt refuses.
  3. 03Program enforces. Caps, allowlists and replay checks run on-chain before the swap.
  4. 04Measure the result. Balances read from token accounts after the swap; any shortfall reverts.
  5. 05Commit the reason. The decision record's hash goes on-chain; anyone can re-hash it.
  6. 06Watchdog suspends. A guardian key can only suspend, and vetoes burst spending on its own.

Key decisions

Measure the result, don't trust the venue

The governor never reads the route. After the swap it measures what left the vault and what arrived, and reverts on any shortfall. On Base mainnet, Uniswap told to pay a stranger succeeds inside the transaction, and the governor reverts it with MinimumOutputNotMet.

The owner's limit, not the agent's floor

minOutput is an argument the agent signs, so a hijacked agent can set it to one base unit. The owner can set a per-token limit price the agent cannot lift; on devnet it reverted exactly that hijacked trade with PriceAboveLimit.

Stop authority without spend authority

The guardian can do one thing: suspend. It cannot spend, withdraw, resume or change policy, so the kill switch is safe to hand to a bot.

Fail closed on market data

No data, stale data or disagreeing sources all refuse the trade. Trading also pauses for 15 minutes either side of a scheduled xStocks multiplier change.

Results

  • 33tests against the Solana program on a local validator
  • 16 + 6EVM tests against hostile mock venues, plus real Uniswap on a Base fork
  • 0.27 SOLdeploy rent for the lean Pinocchio build, vs 1.88 SOL
  • 0.0002 ETHper-trade cap on the live Base mainnet agent; 0.0006 ETH a day

What's not done yet

The Solana lane runs on devnet with a test mint and a demo token, and its price gate reads unsigned sources off-chain. Nothing is audited, which is why the live caps on Base are tiny. Inference spend trusts the operator's reported numbers, because the chain cannot see an LLM call.

Next case studyEverydayElastic →An IT-ops copilot that answers from runbooks and past tickets, with citations.