SG-Tree / Github Social Proof
sg-tree.eu / guides / github-trending-algorithm
2026-10-15 · 4 min read
undefined docs/github-trending-algorithm.md VELOCITY MATH

GitHub Trending and Trendshift velocity formula

Total lifetime star count does not put a repository on GitHub Trending. Velocity does. A five-year-old project sitting at 14,000 stars with +12 stars today will never appear on github.com/trending, while a three-week-old repository jumping from 40 to 165 stars across a single UTC workday often claims a top-ten slot in its language category.

1. The sliding-window velocity formula

GitHub computes trending ranks across three distinct sliding windows: daily (24 hours), weekly (7 days), and monthly (30 days). Raw star volume is only the numerator. The ranking score compares current-window WatchEvent arrivals against the repository's historical baseline rate.

For a repository R with baseline daily star rate λ_base over the preceding 30 days and observed star count ΔS during the active 24-hour window, the anomaly score scales proportionally to the Laplace-smoothed velocity ratio:

VelocityScore(R) = ((ΔS - E[ΔS]) / sqrt(E[ΔS] + α)) * ω(Forks, Issues, Actors)

Where E[ΔS] = λ_base * Δt represents expected organic arrivals, α is a damping constant that prevents division-by-zero on brand-new repositories, and ω ∈ [0, 1] is a graph-diversity multiplier. If ω drops below the trust floor because stars arrive from empty accounts or without secondary repository events, the repository is excluded from the public leaderboard regardless of raw ΔS.

2. Empirical daily star thresholds by language (2026 telemetry)

Different language ecosystems have vastly different daily nomination floors. We sampled GH Archive WatchEvent streams and Trendshift daily Top-25 snapshots across Q1-Q3 2026 to measure the actual 24-hour star delta required to enter github.com/trending/<language>?since=daily:

Language / feed 24h net stars (entry floor) Top-5 daily velocity Min secondary signals (24h)
All languages (global) 140 - 240 ★/day 380+ ★/day ≥ 14 forks · ≥ 5 watchers
TypeScript / Python 65 - 115 ★/day 190+ ★/day ≥ 8 forks · ≥ 3 watchers
Rust / Go 38 - 70 ★/day 120+ ★/day ≥ 5 forks · ≥ 2 watchers
C++ / Zig / Shell 22 - 45 ★/day 80+ ★/day ≥ 3 forks · ≥ 2 watchers

3. Why single-hour bursts fail qualification

Dumping 200 stars onto a quiet repository within 15 minutes does not trigger Trending. It triggers quarantine. GitHub's ingestion pipeline cross-checks WatchEvent timestamps against three independent signals:

  • Pre-star read telemetry: Legitimate traffic spikes generate git clone HTTP requests, page views, and issue reads before stars accumulate.
  • Fork-to-star equilibrium: Across organic trending repositories, the ratio of ForkEvent to WatchEvent sits between 1:8 (12.5%) and 1:12 (8.3%). A repository gaining +300 stars with 0 forks exhibits a severe statistical deviation.
  • Diurnal circadian shape: Organic developer traffic peaks between 13:00 UTC and 19:00 UTC when European afternoon hours overlap with US morning work hours, followed by a secondary Asian peak around 03:00-06:00 UTC. Flat 24-hour cron intervals expose automated scripts immediately.

4. Pacing campaigns for sustained visibility

Instead of firing a single-day spike, engineering teams use a 14-day or 21-day Gaussian bell curve (μ = D/2, σ = D/5) or front-loaded launch decay (w_d = exp(-2.4 * d / D)). Under largest-remainder integer apportionment (integerApportion), a 500-star Trending package (+500 stars, +50 forks, +20 watchers) ramps from 18 stars on day 1 to 58 stars/day during days 6-8 before tapering naturally. That bell peak crosses language-specific daily velocity floors while preserving a clean 30-day historical graph for Trendshift.io indexing.

Ready to calibrate your repository counter bar?
Pilot $15 (+50★) · Viable $123 (+250★) · Trending $232 (+500★) · Launch Sprint $462
Audit & Configure
Related engineering playbooks
ANTI-ABUSE 5 min read
StarScout heuristics and anti-purge architecture
Inside CMU and Socket's StarScout algorithm (arXiv:2412.13459): how bipartite graph clustering and Math.floor cron scripts expose cheap SMM panels, and how SG-Tree prevents purges.
LAUNCH PLAYBOOK 4 min read
Solving the open-source cold-start problem
Why 94% of developers bounce from repositories under 100 stars in four seconds, and how to combine counter calibration with AST-grounded technical issues before launch day.
Help & Engineering FAQ
Desktop interface recommended

SG-Tree interface best calibrated for desktop experience, whilst still usable through phone