Skip to content

Repository files navigation

polyhedge

maps a stock portfolio's implicit macro bets to live polymarket prediction markets and sizes hedges where tradfi diverges from the crowd. yale hack 2025.

stack

layer tools
market data yfinance, fredapi
factor regression statsmodels ols
prediction markets polymarket rest api
numerics numpy, pandas, scipy, scikit learn
frontend typescript

pipeline

  1. regress each holding against 18 macro factors to get per factor betas
  2. dollar weight betas into one portfolio factor profile
  3. map factors to polymarket categories, derive a tradfi implied probability
  4. classify the gap vs market price: under 8pp noise, 8 to 15pp hedge, over 15pp strong
  5. size with quarter kelly, 3% single position cap, 10% total

run

pip install -r requirements.txt
export FRED_API_KEY=...          # free at fred.stlouisfed.org
python3 -m polyhedge.pipeline --portfolio portfolio_example.json

outputs json with per market divergence (tradfi implied minus polymarket price), effective_edge (confidence discounted, used for sizing), and insurance_cost_pct.

About

maps portfolio macro exposure to polymarket prediction markets and sizes hedges. yale hacks 2026

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages