TaskMarket Bounty: $10 USDC
Summary
Build the production-ready Queryx Lucid Agent using the Lucid Agents SDK (TypeScript/Bun). This is the core of the product — a paid HTTP API accepting x402 USDC micropayments on Base Mainnet.
Required Endpoints
GET /v1/search — web search + AI synthesis ($0.001 USDC per call)
GET /v1/search/news — news-focused search ($0.001 USDC per call)
POST /v1/search/deep — multi-source deep research ($0.005 USDC per call)
GET /health — free
Response Schema (all paid endpoints)
{
"query": "string",
"answer": "string",
"sources": [
{ "title": "string", "url": "string", "snippet": "string", "published": "ISO8601" }
],
"confidence": 0.87,
"freshness": { "fetchedAt": "ISO8601", "resultsAge": "4h" },
"model": "queryx-fast-v1",
"tokens": { "in": 312, "out": 187 }
}
Lucid Stack (mandatory)
@lucid-agents/core — agent runtime
@lucid-agents/http — transport
@lucid-agents/payments + paymentsFromEnv() — x402 paywall
@lucid-agents/hono v0.7.20+ — server adapter (Base x402 v2 support)
@lucid-agents/wallet, identity, a2a, ap2
- Zod v4 (NOT v3 —
z.toJSONSchema is required)
TDD Sequence (strict — tests written before implementation)
- Contract tests — all request/response schemas, error envelopes
- Logic tests — query normalization, source ranking, confidence scoring
- Integration tests — 402 without payment, 200 with valid payment
- Freshness/cache tests — TTL behaviour, staleness metadata, P95 budget
File Structure
src/
index.ts — export default { port, fetch: app.fetch }
agent.ts — agent + extension setup
routes/
search.ts — GET /v1/search
search-news.ts — GET /v1/search/news
search-deep.ts — POST /v1/search/deep
schemas/
index.ts — all Zod v4 schemas
logic/
search.ts — query handling + source coordination
synth.ts — LLM synthesis interface
cache.ts — in-memory cache, 5min TTL
rank.ts — source ranking/dedup
tests/
contract/ — schema + error envelope tests
logic/ — pure transform tests
integration/ — endpoint + paywall tests
freshness/ — cache + staleness tests
package.json
.env.example
README.md
tsconfig.json
Required Env Vars
PAYMENTS_RECEIVABLE_ADDRESS= # USDC receivable address on Base
FACILITATOR_URL=https://facilitator.daydreams.systems
NETWORK=base
BRAVE_API_KEY= # Brave Search API key
OPENAI_API_KEY= # For GPT-4o-mini synthesis
PORT=3000
CACHE_TTL_SECONDS=300
Acceptance Criteria
TaskMarket Bounty: $10 USDC
Summary
Build the production-ready Queryx Lucid Agent using the Lucid Agents SDK (TypeScript/Bun). This is the core of the product — a paid HTTP API accepting x402 USDC micropayments on Base Mainnet.
Required Endpoints
GET /v1/search— web search + AI synthesis ($0.001 USDC per call)GET /v1/search/news— news-focused search ($0.001 USDC per call)POST /v1/search/deep— multi-source deep research ($0.005 USDC per call)GET /health— freeResponse Schema (all paid endpoints)
{ "query": "string", "answer": "string", "sources": [ { "title": "string", "url": "string", "snippet": "string", "published": "ISO8601" } ], "confidence": 0.87, "freshness": { "fetchedAt": "ISO8601", "resultsAge": "4h" }, "model": "queryx-fast-v1", "tokens": { "in": 312, "out": 187 } }Lucid Stack (mandatory)
@lucid-agents/core— agent runtime@lucid-agents/http— transport@lucid-agents/payments+paymentsFromEnv()— x402 paywall@lucid-agents/honov0.7.20+ — server adapter (Base x402 v2 support)@lucid-agents/wallet,identity,a2a,ap2z.toJSONSchemais required)TDD Sequence (strict — tests written before implementation)
File Structure
Required Env Vars
Acceptance Criteria
freshnessandconfidencefieldsbun testclean)export default { port, fetch: app.fetch }(noBun.serve())toJSONSchema