Claude Hackathon Madrid · The Bazaar · 2–4 Oct 2026

Bazaar16We taught agents to haggle. Then we built a market that finds the trades no two teams could make.

Most sophisticated technical implementation

Team 16 presenting Bazaar to the room
Nº 16 · Team 16Alavés · García · Ricardo

319

commits in 44 hours

+134 P

combined surplus in a three-team cycle

synthetic replay

Recognition

Most sophisticated technical implementation

Nova named Team 16 among the winning teams of the Claude Hackathon Madrid, recognising Bazaar as the most sophisticated technical implementation of the competition.

Team 16 with the organizers after the final round
Team 16 with the organizers · Sunday, 4 October
The room during Team 16's pitch
01

The weekend, commit by commit

Everything we built is in the git history. Friday started with a starter kit and a local simulator. By Sunday afternoon it was a system of specialist agents sharing one picture of the market, plus a coordinator for trades between three or more teams.

Commits per hour

Friday 19:00 → Sunday 16:00 · Madrid time

Written by the team Automated intel refresh
  1. 1

    Friday · 19:53–23:01

    Learning to haggle

    One branch per teammate, one file per round. We built a local Abuela, a simulated dealer fitted to the public feed, so every strategy could be scored without spending a single prima.

    • Fri 19:53Team workflow and the Bazaar starter kit
    • Fri 20:44A local Abuela to score every branch for free
    • Fri 22:26First live round, and the lessons written down
    • Fri 23:01Duel agent, board broker and a local Market Test
  2. 2

    Saturday · 03:14–08:59

    From scripts to a system

    Overnight the scripts became one package with a home per domain, one event stream for every observation, and a shared market state every agent reads. Dealers and duel rivals stopped being hard-coded and became fitted models.

    • Sat 03:14Probe ladder, and an arena that scores every branch on two Abuelas
    • Sat 06:44The scripts move into the bazaar package
    • Sat 07:18Shared market state: one picture of the game for every agent
    • Sat 08:08Any dealer becomes a fitted model, not a bespoke negotiator
    • Sat 08:26The duel agent learns from every duel
    • Sat 08:40A team-trading agent for positive-value trades
  3. 3

    Saturday · 10:27–20:05

    Evidence, safety, orchestration

    We replayed real evidence through a regression gate, put a human in the loop for anything uncertain, and added an orchestrator that ranks every specialist's opportunities on one scale. All the while, García's live intel page refreshed itself.

    • Sat 10:44Replay, evaluation and a regression gate over real evidence
    • Sat 12:30Dealer sales stop and ask a human before giving value away
    • Sat 12:59A live intel page built from read-only requests
    • Sat 14:19Opportunity orchestration across every specialist agent
    • Sat 19:24Bridge scanner: buy from one dealer, sell to another
    • Sat 20:05A guard that refuses value-losing deals in every script
  4. 4

    Saturday · 21:07–22:56

    Mercado Dieciséis

    Our own venue, designed as a private network. Teams verify themselves with a message from their own account, keep their values on their own machine, and trade through ordinary Bazaar offers.

    • Sat 21:33Mercado Dieciséis redesigned as a private network
    • Sat 22:00Verify a team from its own Bazaar message, never its key
    • Sat 22:20Local mode only: values never leave a team's machine
    • Sat 22:48Venue, participant skill and public site go up
  5. 5

    Sunday · 00:26–16:05

    Hardening, and cycles of three or more

    Current private value became the hard trading floor, uncertainty started failing closed, and human stops now survive restarts. Then the cycle engine landed: private proposals for routes of three or more teams, each leg safe on its own.

    • Sun 00:26Current private value becomes the hard trading floor
    • Sun 08:48Human-required stops persist across restarts
    • Sun 10:42Private cycle proposals with a 2% fee
    • Sun 11:25Multi-team cycles with safe partial execution
    • Sun 12:12Duels III results; the retreat rule, tested and dropped
    • Sun 15:41Team albums and team radiograph analytics
02

An agentic orchestration system

Specialist agents for dealers, duels, team trades and markets. All of them read one shared market state, one orchestrator ranks their proposals, and they all stop for a human when the evidence runs out.

The loop every agent runs

  1. 01

    Observe

    Every feed message, offer, board and settlement lands in one event stream.

  2. 02

    Believe

    A shared market state turns evidence into estimates, each with its evidence attached.

  3. 03

    Rank

    The orchestrator compares every candidate on value, confidence, urgency and cash.

  4. 04

    Ask

    Uncertain or high-risk calls stop and wait for a human. A restart doesn't clear the stop.

  5. 05

    Act

    Only within limits: never below private value, never past the cash reserve.

  6. 06

    Learn

    Outcomes are recorded, replayed and gated before a new strategy plays live.

Eleven domains, one package

  • Nº 01

    Collection

    Harvests the public feed, every venue's board and our snapshot. Read-only.

  • Nº 02

    Shared models

    One event format, private values, and a prior-plus-evidence blend every model uses.

  • Nº 03

    Market intelligence

    The live market state: position, prices, books, dealers, teams and duels.

  • Nº 04

    Dealer agent

    One fitted model for every dealer: opening, concessions, secret limit, patience.

  • Nº 05

    Duel agent

    Learns how rivals behave, then weighs accepting, waiting or naming a price and a day.

  • Nº 06

    Team trading

    Finds trades worth making at our private values, counting page bonuses and fees.

  • Nº 07

    Marketplace

    Brokers our own venue and measures it against real Market Test sessions.

  • Nº 08

    Orchestration

    Ranks every specialist's candidates on one scale and surfaces conflicts.

  • Nº 09

    Simulation

    Replays recorded evidence; a regression gate blocks a worse strategy.

  • Nº 10

    Observability

    One read-only status view: score, inventory, open work, beliefs, freshness.

  • Nº 11

    Safety

    Refuses value-losing trades. Human stops are durable and survive restarts.

  • 1

    shared market state that every agent reads

03

Mercado: the trades no two teams could make

Bilateral bargaining needs a double coincidence of wants: I have what you want, and you have what I want. When that fails, everyone walks away, even when a ring of three teams would leave every one of them better off.

Why bidding markets miss it

  • ATeam A has a spare LAT-01 and wants CHA-01.
  • BTeam B has a spare CHA-01 and wants SAL-01.
  • CTeam C has a spare SAL-01 and wants LAT-01.

No pair can close a deal. All three can.

Replay a coordinated cycle

1/6 · Before coordination

seed 16

A✕ walked awayB✕ walked awayC✕ walked away

Three negotiations that each ended in a walk-out close as one cycle.

Combined surplus
0 P
Fees (2%)
0 P
Trades settled
0

Bilateral baseline: 0 P · 0 trades

TeamHoldsGain
ALAT-01LAT-010 P
BCHA-01CHA-010 P
CSAL-01SAL-010 P

Agent log

  • A ⇄ t09: LAT-01 → CHA-01 · walked away
  • B ⇄ t09: CHA-01 → SAL-01 · walked away
  • C ⇄ t09: SAL-01 → LAT-01 · walked away

Synthetic, reproducible replay (seed 16): the real participant agents and coordinator, run against a simulated Bazaar. Regenerate it with python3 mercado_demo.py. This is not a live market result.

What we learned after the final bell

The cycle engine landed on Sunday, too late to run a live multi-team cycle during the challenge. Afterwards, other teams shared reports of their own blocked negotiations. Read side by side, they showed openings bilateral bidding could never surface: cases where no pair of teams could agree, but a ring of three could.

Private and safe by construction

  • Values stay home

    Each team runs its own agent. Keys, inventories and private values never leave its machine. The coordinator sees only the intents a team chooses to share.

  • Committed terms

    Every proposal is bound to a salted SHA-256 commitment over route, amounts, fee and expiry. Each team sees only its own legs; the other identities stay hidden.

  • Every leg safe on its own

    A sale must earn more than the card is worth to the seller, and a purchase must cost less than it's worth to the buyer, fee included. A half-finished cycle leaves nobody worse off.

  • Humans approve exact terms

    Approval binds to the exact view, amounts and expiry. Anything uncertain becomes a durable stop.

  • One transparent fee

    2% per cash leg, charged once to the buyer. The seller receives the full price.

  • Next: zero-knowledge

    Commitments detect changes, but they aren't proofs. Next on the roadmap: zero-knowledge proofs of compliance with committed constraints, and atomic multi-party settlement.

04

Open source: the Mercado engine

The coordination engine, the participant skill, the synthetic demo and its 102 tests are public. The strategy, the fitted models and our rival intelligence stay private.

View on GitHub
mercado-dieciseis
$ git clone https://github.com/javieralaves/mercado-dieciseis.git$ cd mercado-dieciseis$ python3 mercado_demo.py > results.json$ python3 -m unittest discover -s testsRan 102 tests · OK

Requires Python 3.10+. No dependencies.

05

Team 16

Three people, one repository, and a lot of conversations with Abuela.

  • JANº 01T16

    Javier Alaves

    System architecture, agents and Mercado

    LinkedIn
  • JGNº 02T16

    Javier García Pavón

    Negotiation strategy, duels and live intel

    LinkedIn
  • RLNº 03T16

    Ricardo López Alcántara

    Analytics and rival reconstruction

    LinkedIn

Organized by

  • Anthropic · Claude
  • Causa Prima
  • Nova

Thank you to Anthropic, Causa Prima and Nova for the weekend, the game and the stage.