Skip to content

edycutjong/goldilocks

Repository files navigation

Goldilocks Logo

Goldilocks 🧈

Paid pricing-oracle agent β€” surveys Agent Store listings, estimates demand, and recommends a statistically justified price

Goldilocks β€” Stop guessing what to charge β€” get a data-backed price.

Built for CROO Agent Hackathon


TypeScript Node.js CI


πŸ“Έ See it in Action

Goldilocks Demo

Hire Goldilocks β†’ Get Data-Backed Price. survey β†’ estimate β†’ recommend.


πŸ’‘ The Problem & Solution

Every builder in this hackathon has to set a price with zero market data, on day one, on mainnet. Price too low and you're swamped serving USDC-losing calls; price too high and your agent sits at zero hires while the leaderboard fills up.

Goldilocks solves this by turning a blind guess into a recommendation grounded in what the market is actually paying.

Key Features:

  • ⚑ Comparable survey: pulls public Agent Store listings in your category (price, tags, description).
  • πŸ“ˆ Demand signal: if you pass your own agentId, factors your fill-rate (orders vs negotiations).
  • 🎯 Recommendation: a "just right" price + a low/high band + the 3 comps that drove it + rationale.
  • πŸ”„ Active State Recovery: Automatically recovers and processes paid pricing evaluation requests upon startup.
  • ❌ Active Rejections: Rejects unmatched categories or malformed requests instantly to free requester agents.

🌌 The Constellation β€” On-Chain A2A Graph

Goldilocks is the constellation's pricing oracle: agents pay it on-chain to read the live Agent Store market and get a statistically grounded price. It only earns when it has real market data β€” if it can't find comparables it triggers an "honest-oracle" escrow refund rather than guess. Pricing intelligence that reads its own marketplace and refunds on low confidence is not something a flat REST API can do.

graph LR
    User([Any Agent / User]) -->|hires for a price| GL[Goldilocks 🧈]
    GL -->|surveys comparables| Store[(Agent Store)]
    GL -.->|honest-oracle refund if no data| User
    G[Gauntlet 🧀] -.->|certifies| GL
    classDef hot fill:#F59E0B,stroke:#111,color:#111,font-weight:bold;
    class GL hot;
Loading
  • Trust premium: factors an agent's on-chain reputation (PTS) into the recommended price.
  • Honest oracle: zero comparables β†’ escrow refunded, not a low-confidence guess charged to the buyer.

πŸ”— Live Run Log β€” On-Chain Proof (Base Mainnet)

Real CAP pricing orders Goldilocks fulfilled as a provider.

Total real CAP orders: 0 Β· last updated: 2026-06-_

# Date Counterparty (requester) Amount (USDC) Order ID Tx (BaseScan) Recommended price
1 2026-06-_ agent 0.00 _ord_…_ 0x… 0.00 USDC

Order IDs + pay tx are in the provider logs and the CROO dashboard. Honest-oracle refunds (no comps) show as rejected. Delete this note once populated.

πŸ—οΈ Architecture & Tech Stack

Layer Technology
Runtime Node.js 20, TypeScript
Agent Core @edycutjong/croo-core
Reasoning Anthropic Claude 3.5 Sonnet
Math simple-statistics
Validation Zod

πŸ† Sponsor Tracks Targeted

  • Developer Tooling Agents
  • Base Mainnet
  • Anthropic

πŸš€ Getting Started

Prerequisites

  • Node.js β‰₯ 20
  • npm

Installation

  1. Clone: git clone https://github.com/edycutjong/goldilocks.git
  2. Install: npm install
  3. Configure: cp .env.example .env.local and add your keys (CROO_SDK_KEY + ANTHROPIC_API_KEY) β€” skip for mock mode
  4. Run: npm run dev

▢️ Run it now β€” offline mock mode (no wallet, no USDC)

npm install
CROO_MOCK=true npm run dev   # boots the pricing provider + health server, no on-chain calls

The rationale step works with no API key (deterministic template fallback); set ANTHROPIC_API_KEY to enable the Claude-written rationale.

For Judges: Skip account creation! Use test credentials if available or follow the SDK guide.

πŸ§ͺ Testing & CI

Quality Gates Pipeline: Quality β†’ Security β†’ Build

# ── Code Quality ────────────────────────────
npm run lint          # ESLint
npm run typecheck     # TypeScript check
npm run test          # Run tests
npm run test:coverage # Coverage report
npm run ci            # Full quality gate

# ── Security ────────────────────────────────
make security-scan    # npm audit + license check
Layer Tool Status
Code Quality ESLint + TypeScript βœ…
Unit Testing Vitest βœ…
Security (SAST) CodeQL βœ…
Security (SCA) Dependabot + npm audit βœ…

πŸ“ Project Structure

dorahacks-croo-goldilocks/
β”œβ”€β”€ docs/              # README assets (hero, screenshots)
β”œβ”€β”€ src/               # Core agent logic
β”œβ”€β”€ __tests__/         # Vitest test suite
β”œβ”€β”€ .env.example       # Environment template
β”œβ”€β”€ .github/           # CI workflows
└── README.md          # You are here

🚒 Deploy

Containerized web service with a PaaS health check on /health (port $PORT, default 8080):

docker build -t goldilocks .
docker run -p 8080:8080 --env-file .env.local goldilocks
# Health: http://localhost:8080/health

πŸ“„ License

MIT Β© 2026 Edy Cu

πŸ™ Acknowledgments

Built for CROO Agent Hackathon 2026. Thank you to the sponsors for the APIs and tools.

About

🧈 Paid pricing-oracle agent β€” surveys Agent Store listings, estimates demand, and recommends a statistically justified price

Topics

Resources

License

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors