From 09f3cb90662517d739f3fe2ce46aa4f1b1df0a0a Mon Sep 17 00:00:00 2001 From: shoko <270575765+shokollm@users.noreply.github.com> Date: Thu, 26 Mar 2026 17:06:25 +0000 Subject: [PATCH] Add comment explaining total_pages ceiling division calculation --- skills/polymarket-browse/scripts/browse.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/skills/polymarket-browse/scripts/browse.py b/skills/polymarket-browse/scripts/browse.py index 63c3b8f..1dda2bb 100644 --- a/skills/polymarket-browse/scripts/browse.py +++ b/skills/polymarket-browse/scripts/browse.py @@ -235,6 +235,8 @@ def fetch_all_pages( if total_raw == 0: return {"events": [], "total_raw": 0, "partial": False} + # API always returns exactly 5 events per page regardless of 'limit' param. + # This is integer ceiling division: ceil(total_raw / 5) = (total_raw + 5 - 1) // 5 = (total_raw + 4) // 5 total_pages = (total_raw + 4) // 5 concurrency = min(MAX_PARALLEL_FETCHES, total_pages)