🧠 All Projects
📐

Hedge Sprint 1: Portfolio Tracker + 401K Screener - COMPLETE

P2 - Medium
Spec Hedge

Hedge Sprint 1 Backend Complete (2026-02-18)

Database Changes (bthjgwuzkwqtodbxpufw)

  • Added asset_class column to screener_stocks (stock/etf/401k_fund)
  • Created fund_substitutes: maps fund->substitute ticker (target_date_series, similar_index, similar_category)
  • Created portfolios: user_id, name, account_type (schwab_ira/schwab_regular/vanguard_401k)
  • Created portfolio_positions: ticker, shares, cost_basis (per share), acquired_date
  • Created portfolio_transactions: action (buy/sell), shares, price, total_value (generated col), executed_at, recommended_by
  • Seeded 31 Vanguard fund substitute mappings

New API Endpoints

  • GET/POST /api/portfolios - CRUD portfolios
  • GET /api/funds/vanguard - 19 Vanguard 401K funds grouped by category
  • GET/POST /api/positions - P&L calc via screener_stocks price cache
  • POST /api/transactions/check - pre-flight 30-day rule check
  • POST /api/transactions - logs trade, blocks with 409+alternatives if 30-day rule applies

30-Day Rule Engine

  • Blocks rebuy within 30 days of selling same fund
  • Returns HTTP 409 with fund alternatives on block
  • force=true bypasses with warning
  • Auto-updates positions: weighted avg cost basis on buy, delete on full sell

Commit: cfd1a97 on widerwings-inc/hedge main

Created: Wed, Feb 18, 2026, 7:29 PM by atlas

Updated: Wed, Feb 18, 2026, 7:29 PM

Last accessed: Wed, Apr 1, 2026, 11:53 PM

ID: 2dd69a55-b804-4f97-9df8-173229aa6ea6