Skip to content

feat: M10 agent-readable market intelligence#7

Open
tung-lee wants to merge 1 commit intomainfrom
feat/m10-agent-intelligence
Open

feat: M10 agent-readable market intelligence#7
tung-lee wants to merge 1 commit intomainfrom
feat/m10-agent-intelligence

Conversation

@tung-lee
Copy link
Copy Markdown
Member

@tung-lee tung-lee commented Apr 5, 2026

Summary

  • 5 new MCP read tools (23 → 28): pacifica_top_markets, pacifica_liquidity_scan, pacifica_trade_patterns, pacifica_alert_triage, pacifica_market_snapshot — all return stable JSON (schemaVersion: "1.0")
  • New core module src/core/intelligence/ — pure filter functions, trade pattern analysis (buy pressure, VWAP, whale detection, momentum), and AlertManager with atomic file writes
  • New CLI command pacifica alerts list|add|remove|check — persistent price/funding/volume alerts with urgency triage
  • Enhanced pacifica scan --gainers|--losers|--min-volume filters + pipe-friendly --json output
  • Agent recipe .claude/commands/intelligence.md — 5-step analysis workflow (top gainers → liquidity filter → alert triage → pattern check → synthesis)
  • Bug fix: normalise TradeHistory.side (buy/sell/BID/ASK → canonical bid|ask) in SDK parsers

Test plan

  • pnpm typecheck — zero errors
  • pnpm build — builds cleanly
  • pacifica alerts add --symbol BTC --above 100000 — creates alert in ~/.pacifica/alerts.json
  • pacifica alerts check — fetches live markets, returns triage
  • pacifica scan --gainers --min-volume 5000000 — filtered sorted output
  • pacifica scan --json — valid JSON array
  • MCP tool pacifica_top_markets {"sort_by":"gainers","limit":5} via inspector
  • MCP tool pacifica_market_snapshot {} — returns schemaVersion: "1.0"

🤖 Generated with Claude Code

- Add src/core/intelligence/ with 4 modules:
  schema.ts (stable JSON interfaces, schemaVersion "1.0")
  filter.ts (topGainers/Losers/OI/funding, liquidityFilter, computeLiquidityScan with slippage estimates)
  patterns.ts (buyPressure, VWAP, detectLargeOrders, momentum)
  alerts.ts (AlertManager: CRUD + triage, atomic writes, 0o600 perms)

- Add 5 new MCP read tools to server.ts (23 → 28 tools):
  pacifica_top_markets, pacifica_liquidity_scan, pacifica_trade_patterns,
  pacifica_alert_triage, pacifica_market_snapshot

- Add pacifica alerts list|add|remove|check command

- Add pacifica scan --gainers/--losers/--min-volume flags

- Add .claude/commands/intelligence.md agent recipe skill

- Fix TradeHistory.side normalisation in SDK parsers (bid/ask/buy/sell → canonical bid|ask)

- Update context docs (API contracts, data models, decisions D9, roadmap M10, task list T44-T56)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant