---
title: "Cron Portfolio Returns Cache"
method: POST
path: "/cron/portfolio-returns-cache"
tags: ["cron"]
---

# Cron Portfolio Returns Cache

`POST /cron/portfolio-returns-cache`

## Request

- Base URL: `https://api.equity-rank.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.equity-rank.com/cron/portfolio-returns-cache`
- Auth: none declared

Rebuild portfolio_returns_cache from price_history (pure DB→DB).

Recomputes the trailing 252-day log-return array + its trading-date grid
for every symbol with >= 30 usable returns, via the
rebuild_portfolio_returns_cache proc (mig 162). No AlphaVantage, no
yfinance, no screener batch — one statement inside Postgres.

Runs after the nightly 22:30 UTC price-history snapshot and its eod sync
(scheduler_setup.py), so the arrays always include the close that just
landed. Feeds POST /api/portfolio/optimize — the Black-Litterman covariance
matrix reads nothing else. Idempotent; a re-run just rewrites the arrays.

## Headers

- `x-cron-secret` string, nullable

## Response `202`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/equity-rank/apis/equity-rank-api.md) · [All operations](https://skmtc.dev/equity-rank/apis/equity-rank-api/llms.txt) · [OpenAPI document](https://skmtc.dev/equity-rank/apis/equity-rank-api/revisions/c2f2463fee33?raw)
