Nava Agent — Sprint Roadmap

Overview

AI trading agent for Polymarket prediction markets and Hyperliquid perpetual futures. Architecture: persona → thesis → plan → tool calls → score → action.

Three configurable agent personas on a single engine:

  1. Polymarket Sports — binary “Who will win” markets
  2. Polymarket Multi-Choice — “By what date will X occur” markets
  3. Hyperliquid Intent — perp long/short requests

What Already Exists

SourceWhat’s ThereStatus
nava-agent/ (Nava scaffold)8 Polymarket tools, 7 Hyperliquid tools, 2 web tools, RobustTool base, 2 workflows, interactive CLI, kosong SDKStable, use as-is
polymarket-scratch/PolymarketClient, EtherscanClient, spike detection, insider signals framework, trade analysis patterns, market discoveryReuse & wrap
sports-odds-backtesting/OddsClient (async + retry + quota), DuckDB storage, PropSnapshot models, NBA/NFL market configs, backfillerReuse & wrap

What We Build

Milestone 1: Base Agent Infrastructure (Week 1)

The orchestration engine — state machine, LLM-powered thesis/plan generators, scorecard, action engine.

Milestone 2: Polymarket Enhanced Research (Week 2)

5 analysis tools that leverage existing code from polymarket-scratch/ and sports-odds-backtesting/:

  • Sportsbook odds benchmark (wraps OddsClient)
  • Spike + retracement detection (wraps find_price_spikes())
  • Directional flow analysis (wraps trade analysis patterns)
  • Account age scoring (wraps get_wallet_first_tx() + signals)
  • Concentration + cross-market detection (wraps investigation patterns)

Milestone 3: Hyperliquid Enhanced Research (Week 3)

2 analysis tools + persona wiring + final integration:

  • Open interest history
  • Taker flow + whale print detection
  • 3 persona configs wired end-to-end

Timeline

WeekFocusExit Criteria
1M1 — Base InfrastructureOrchestration loop runs end-to-end with mocked tools. State machine tested. Thesis/plan generators produce structured output.
2M1 finish + M2 — Scoring + PolymarketFull pipeline works with real APIs. All 5 Polymarket enhanced modules done with tests.
3M3 — Hyperliquid + Personas + IntegrationAll milestones complete. 3 personas configured. Full integration tests pass locally.
4BufferBug fixes, edge cases, test hardening, slippage.

Team

  • Dev A (80%) — Lead. Orchestration, scoring, action engine, Hyperliquid modules, integration.
  • Dev B (20%) — Support. Polymarket tool wrapping, test fixtures, debug scripts.

Constraints

  • All modules have unit + integration tests
  • Everything runs locally with uv run pytest
  • No infra (CloudWatch/SNS/Docker) in scope
  • Nava tools are stable dependencies — no rework
  • Personas are same engine, different config/prompts

Architecture Decisions

  • Framework: kosong SDK (step() loop, SimpleToolset, CallableTool2)
  • Tool pattern: RobustTool base class (retry, timeout, JSON output)
  • Config: Module-level constants with python-dotenv
  • Models: Pydantic for tool I/O, dataclasses for internal state
  • Testing: pytest + pytest-asyncio, @pytest.mark.integration for API tests
  • Build: uv with pyproject.toml, Python 3.12

Existing Code Reuse Map

Enhanced ToolExisting CodeLocationAdaptation
Sportsbook odds benchmarkOddsClient, PropSnapshot, market configssports-odds-backtesting/src/odds_collector/Wrap as RobustTool, add Polymarket price comparison
Spike + retracement detectionfind_price_spikes(), PricePointpolymarket-scratch/insider-detection/src/polymarket_api.pyWrap as RobustTool, add retracement logic, configurable thresholds
Directional flow analysisTrade aggregation, time-window groupingpolymarket-scratch/insider-detection/scripts/analyze_all_markets.pyExtract buy/sell ratio logic, wrap as RobustTool
Account age scoringget_wallet_first_tx(), EtherscanClientpolymarket-scratch/insider-detection/src/polygon_client.pyWrap as RobustTool, add age-based scoring tiers
Concentration + cross-marketCross-market analysis, wallet groupingpolymarket-scratch/insider-detection/scripts/investigate_copy_trading.pyExtract concentration metrics, wrap as RobustTool
Open interest historyHyperliquid candles tool (existing)nava-agent/kosong_agent/tools/hyperliquid/New RobustTool, derive OI from existing candle data
Taker flow + whale detectionTrade analysis patternspolymarket-scratch/insider-detection/scripts/New RobustTool, apply volume/size thresholds to HL trades