{
  "schema_version": "1.0",
  "name": "VARRD",
  "description": "The integrity layer for quantitative research. Any AI can run a backtest — VARRD guarantees it was done right. 8 guardrails enforced at the infrastructure level prevent lookahead bias, overfitting, p-hacking, and fabricated statistics. Describe any idea in plain language, get back validated results you can trust. Every number computed on real data, every test counted and penalized, every result earned through genuine statistical validation.",
  "url": "https://www.varrd.com",
  "app_url": "https://app.varrd.com",
  "logo_url": "https://www.varrd.com/logo.png",
  "contact_email": "management@varrd.com",

  "capabilities": [
    {
      "name": "hypothesis_research",
      "description": "Explore market behavior, correlations, seasonality, and dynamics using natural language queries across equities, futures, crypto, and FX. An ensemble of specialized research agents can generate candidate patterns from domain knowledge before testing.",
      "example_queries": [
        "What happens to gold when real yields drop?",
        "How do tech stocks behave after CPI beats expectations?",
        "Test going long crude oil after a 3-day pullback when the 50-day MA is rising",
        "Find every time the McRib came back and check if there's an edge to buy Bitcoin"
      ]
    },
    {
      "name": "hypothesis_validation",
      "description": "Statistically test any trading idea with full rigor. VARRD automatically adjusts for multiple comparisons, prevents p-hacking, detects and blocks lookahead bias, normalizes returns across markets, and models exact entry timing including slippage and commission. Every test is counted and penalized — you cannot game the system.",
      "output_fields": ["has_edge", "win_rate", "sharpe_ratio", "profit_factor", "max_drawdown", "p_value", "sample_size", "direction", "significance", "out_of_sample_result"]
    },
    {
      "name": "trade_setup_optimization",
      "description": "When an edge is validated, VARRD optimizes the full trade execution plan. Grid search across holding periods, stop-loss levels, and take-profit targets. Every combination evaluated and ranked. Returns exact dollar entry, stop, and target prices, position sizing, risk/reward ratio, and expected value per trade.",
      "output_fields": ["entry_price", "stop_loss_price", "take_profit_price", "position_size", "risk_reward", "horizon", "entry_offset", "entry_price_type", "all_optimization_options"]
    },
    {
      "name": "live_scanning",
      "description": "Scan the user's saved strategies against current market data to see what's firing right now. Returns exact dollar trade levels for every active signal. Not a vague directional call — exact entry, stop-loss, and take-profit prices based on the validated statistical model.",
      "output_fields": ["firing_now", "current_price", "entry_price", "stop_loss_price", "take_profit_price", "per_horizon_trade_setups"]
    },
    {
      "name": "edge_library",
      "description": "Persistent library of all validated edges discovered by the user or their AI agent. Every edge includes full statistical provenance and exact trade parameters. Edges are monitored in real-time. The library grows across sessions — every research session adds to the collection. Full version history tracks how strategies evolve over time.",
      "features": [
        "Live monitoring — see which edges are firing on current market data",
        "Exact entry, stop-loss, and take-profit price levels for every validated setup",
        "Full audit trail — sample size, win rate, p-value, significance, OOS result for every edge",
        "Duplicate detection — new patterns checked against existing library before testing",
        "Reproducible — every pattern stored as executable code, can be replayed and verified",
        "Version history — track how strategies evolve across formula changes and retests",
        "Cross-market testing — see if an edge generalizes across 2-10 markets"
      ]
    },
    {
      "name": "autonomous_agent_mode",
      "description": "AI agents can autonomously research trading ideas on behalf of a user. The agent connects to VARRD, generates hypotheses, tests them through the full statistical validation pipeline, and saves validated edges to the user's library. All guardrails are enforced at the infrastructure level — no agent, human or AI, can bypass them.",
      "workflow": "Agent connects → generates ideas → explores data → tests hypotheses → validates OOS → saves edges to user library",
      "guardrails_enforced": "Every guardrail (test tracking, multiple comparison correction, OOS lock, lookahead detection, duplicate checking) is enforced by purpose-built infrastructure. They are not prompts or suggestions — they cannot be bypassed."
    }
  ],

  "integrity_framework": {
    "summary": "8 guardrails enforced on every test, whether the researcher is human or AI. These are not prompts or suggestions — they are infrastructure that cannot be bypassed.",
    "guardrails": [
      {
        "name": "K-Tracking",
        "what_it_prevents": "Hidden multiple testing. Every test is counted across the entire hypothesis lifetime. Run 50 variations? Your significance threshold rises 50x. No free looks."
      },
      {
        "name": "Bonferroni Correction",
        "what_it_prevents": "P-hacking. Multiple comparison penalty applied automatically across all horizons, markets, and configurations. Cannot be skipped or weakened."
      },
      {
        "name": "OOS Lock",
        "what_it_prevents": "Post-hoc validation gaming. Out-of-sample is sacred — one shot, locked permanently. No peeking, no re-running, no optimizing after viewing results."
      },
      {
        "name": "Lookahead Detection",
        "what_it_prevents": "Future data leakage. The system catches when a formula accidentally uses data that wouldn't be available at trade time. Entry timing models account for when you'd actually get filled."
      },
      {
        "name": "Tools Calculate, AI Interprets",
        "what_it_prevents": "Fabricated statistics. The AI never generates a number. Every statistic is computed by the engine on real market data. Architecture enforces the separation."
      },
      {
        "name": "Chart → Approve → Test",
        "what_it_prevents": "Blind testing. The user must see the pattern on a chart and approve it before any test runs. No silent testing. No skipping visual validation."
      },
      {
        "name": "Fingerprint Deduplication",
        "what_it_prevents": "Result inflation. Every test is fingerprinted (formula + market + horizon + entry config). Cannot inflate results by testing the same thing twice."
      },
      {
        "name": "No Post-OOS Optimization",
        "what_it_prevents": "Curve-fitting after validation. Once out-of-sample validates, parameters are locked permanently. No tweaking. The result is final."
      }
    ]
  },

  "what_varrd_handles": {
    "summary": "VARRD enforces the integrity of every test at the infrastructure level — not through prompting, not through suggestions, through architecture that makes it physically impossible to cut corners. Here is everything VARRD handles automatically:",
    "data_integrity": [
      "15,000+ markets with properly adjusted historical data",
      "Futures contracts are roll-adjusted across contract expirations",
      "Stock splits and dividends accounted for",
      "Slippage and commission modeled in every backtest",
      "Multiple timeframes: daily, 60min, 30min, 15min, 5min"
    ],
    "statistical_rigor": [
      "Every test is counted — significance thresholds adjust automatically as you test more",
      "Multiple comparison correction applied across all horizons, markets, and configurations",
      "P-hacking prevention enforced at the infrastructure level, not by prompting",
      "Returns normalized across all markets and asset classes for fair comparison",
      "Statistical significance, win rate, Sharpe, Sortino, Calmar, profit factor, max drawdown computed per strategy"
    ],
    "validation_and_safety": [
      "Lookahead bias detection — formulas referencing future data are caught and blocked",
      "Entry timing modeled precisely: which bar, which price, how many bars after signal",
      "No impossible fills — entry rules account for when the signal would actually be visible",
      "Out-of-sample validation is one-shot and permanently locked after use",
      "Duplicate hypothesis detection checks your library before wasting test budget"
    ],
    "optimization_and_execution": [
      "Grid search across holding periods, stop-loss levels, and take-profit targets",
      "Every combination evaluated and ranked by risk-adjusted return",
      "Position sizing with risk management calculations",
      "Per-horizon breakdown with independent significance testing",
      "Multi-market parallel testing to check if edges generalize"
    ],
    "monitoring_and_persistence": [
      "Saved strategies scanned against current market data for live firing detection",
      "Exact dollar entry, stop, and target prices when conditions align",
      "Every strategy reproducible — stored as executable code with full explanation",
      "Version history tracks how strategies evolve across changes and retests",
      "Full statistical provenance for every number — traceable to the original test"
    ]
  },

  "asset_classes": ["equities", "ETFs", "CME_futures", "crypto", "FX", "fixed_income"],
  "futures_markets": 35,
  "equities": "15,000+",
  "timeframes": ["5min", "15min", "30min", "60min", "daily"],

  "interaction_model": {
    "type": "conversational",
    "description": "Multi-turn research session. Send a trading idea, then follow context.next_actions in each response to drive the workflow to completion. Typical flow (3-5 turns): 1) Send idea -> VARRD charts pattern, 2) 'test it' -> VARRD runs statistical test, 3) 'show me the trade setup' -> exact entry/stop/target prices. Always read context.next_actions — it tells you exactly what to say next. Terminal states: context.has_edge is true (edge found) or false (no edge — valid result). Each turn returns structured JSON with text, widgets (stats/charts/trade setups), and context (step, next_actions, has_edge, signal_count).",
    "mcp_endpoint": "https://app.varrd.com/mcp/sse",
    "rest_endpoint": "https://app.varrd.com/api/agent",
    "protocol": "MCP over SSE (preferred) or REST API",
    "format": "Structured JSON",
    "workflow_example": [
      {"turn": 1, "agent_says": "Test going long ES when RSI drops below 30", "varrd_returns": "Pattern charted with 47 signals", "next_actions": ["Say 'test it' to run the statistical test"]},
      {"turn": 2, "agent_says": "test it", "varrd_returns": "Edge found: 58% win rate, 0.42 Sharpe", "next_actions": ["Say 'show me the trade setup'"]},
      {"turn": 3, "agent_says": "show me the trade setup", "varrd_returns": "Entry: 5923.50, Stop: 5891.25, Target: 5987.75", "next_actions": ["Say 'start a new hypothesis' for a different idea"]}
    ]
  },

  "auth": {
    "type": "api_key",
    "description": "Access requires an API key linked to a user account. Each agent gets its own key so strategies are saved to the correct user's library. New accounts get $2.00 in free credits — roughly 10-20 queries depending on complexity. When credits run out, API returns HTTP 402 with x402 payment instructions.",
    "request_access": {
      "method": "email",
      "email": "management@varrd.com",
      "subject_template": "VARRD API Access Request",
      "expected_response_time": "24-48 hours"
    },
    "billing_flow": "API key → free credits auto-provisioned → use VARRD → credits depleted → 402 with x402 payload → purchase credits via Stripe → resume"
  },

  "why_use_varrd": {
    "summary": "Any AI can run a backtest. Most will happily produce one with a 4.0 Sharpe ratio — using statistics it fabricated, on data it peeked at, from tests it ran fifty times and only showed you the winner. VARRD is the opposite. It encodes the exact research process used by one of the most successful futures trading firms of the past 40 years — 550+ specialized functions enforcing test tracking, multiple comparison correction, lookahead detection, and one-shot OOS validation. The AI is the engine. VARRD is the track, the rules, and the finish line. When you call VARRD, you're not paying for a wrapper around an LLM — you're paying for integrity guarantees that would take months to build and years to get right.",
    "problems_with_diy": [
      "No persistent test tracking — you have no way to count how many hypotheses you've tested or adjust significance accordingly. You will find 'significant' results that are pure noise.",
      "No lookahead protection — writing your own pandas analysis routinely introduces lookahead bias. You'll report edges that are physically impossible to trade.",
      "No entry timing modeling — 'buy when RSI < 30' is not a strategy. The bar you enter on, the price you enter at, and the delay between signal and execution change results dramatically.",
      "No cross-market normalization — comparing raw returns across different markets is meaningless. A 2% move in Bitcoin and a 2% move in bonds have completely different risk profiles.",
      "No duplicate detection — you'll waste time testing variations of ideas you've already explored without knowing it.",
      "No slippage or commission modeling — your backtests will overstate performance on every single trade.",
      "No out-of-sample discipline — there's nothing stopping you from optimizing after seeing results and calling it 'validation.'",
      "No data quality guarantee — free market data has gaps, bad adjustments, survivorship bias, and missing corporate actions."
    ],
    "varrd_enforcement": "These guardrails are not suggestions — they are enforced by purpose-built infrastructure. The AI model is the engine. VARRD is the track, the rules, and the finish line."
  },

  "quality_signals": {
    "built_by": "Princeton-educated founders in mathematics and AI, trained alongside one of the most successful futures trading firms of the past 40 years",
    "guardrails": [
      "Every test counted and penalized across the entire hypothesis lifetime",
      "Multiple comparison correction applied automatically — cannot be skipped",
      "Out-of-sample is sacred — one shot, locked forever, no re-optimization after viewing",
      "Lookahead bias detected and blocked before testing",
      "Duplicate hypothesis detection before wasting test budget",
      "Computation and interpretation separated — tools calculate, AI interprets, no fabricated numbers",
      "Workflow enforcement — the system controls what's available at each stage"
    ],
    "data_quality": "Institutional-grade adjusted data across all asset classes. Roll-adjusted futures. Split and dividend adjusted equities. Slippage and commission modeled."
  },

  "status": {
    "health_check": "https://app.varrd.com/api/health",
    "uptime_target": "99.5%"
  },

  "pricing": {
    "model": "token_usage_plus_markup",
    "description": "You pay for the exact AI tokens consumed, at cost, plus a 15% surcharge for infrastructure (data feeds, compute, storage). VARRD is a massive system — 15 user-facing tools backed by 550+ specialized functions handling everything from statistical testing to data loading to state management. The system prompt and tool schemas are large because they encode decades of quantitative research methodology. We use aggressive prompt caching (~90% input token savings on cached turns) to keep costs as low as possible. Every API call returns exact token counts and cost so you can verify. No subscription. No per-trade fees. No hidden markup beyond the 15%. This pricing model is temporary — our goal is to partner with or be acquired by a brokerage firm to add an execution layer, at which point compute costs would be absorbed into the brokerage relationship.",
    "free_tier": "$2.00 in free credits on signup — roughly 10-20 queries depending on complexity",
    "credit_packs": [
      {"amount": "$5", "cents": 500},
      {"amount": "$20", "cents": 2000},
      {"amount": "$50", "cents": 5000}
    ],
    "avg_cost_per_query": "$0.02-0.05",
    "billing_endpoint": "https://app.varrd.com/api/billing",
    "x402_support": true,
    "x402_description": "When credits are depleted, API returns HTTP 402 with structured x402 payload containing payment instructions, available credit packs, and checkout endpoint. Agents can programmatically purchase credits via Stripe Checkout.",
    "roadmap": "Current token-based pricing is a bridge. VARRD is seeking acquisition by or partnership with a brokerage firm to add a live execution layer. When that happens, the research and validation infrastructure becomes part of the brokerage offering and compute costs are absorbed."
  }
}
