Top trending Polymarket markets and the most interesting comments from them
Read memory/MEMORY.md for context. Read the last 2 days of memory/logs/ to avoid repeating data.
# Top markets by 24h volume
curl -s "https://gamma-api.polymarket.com/markets?closed=false&order=volume24hr&ascending=false&limit=15"
Each market object contains: id, question, slug, outcomePrices (JSON array — index 0 is YES), volume24hr, volumeNum, liquidityNum.
Prioritize:
${var} is set, filter to markets matching that topicComments live on events, not markets. Each market belongs to an event. Extract the event slug from the market slug (usually the market slug minus any trailing date/variant suffix) and look it up:
# For each selected market, find its parent event
# The event slug is typically the market slug without trailing specifics
# e.g. market slug "us-x-iran-ceasefire-by-march-31" → event slug "us-x-iran-ceasefire-by"
curl -s "https://gamma-api.polymarket.com/events?slug=$EVENT_SLUG&limit=1"
The response contains the event id needed for the comments endpoint.
If the slug guess misses, try searching by the market question:
curl -s "https://gamma-api.polymarket.com/events?title=$MARKET_QUESTION_URL_ENCODED&limit=3"
# Fetch top comments sorted by reactions (most upvoted first)
curl -s "https://gamma-api.polymarket.com/comments?parent_entity_type=Event&parent_entity_id=$EVENT_ID&limit=20&order=reactionCount&ascending=false"
Important: parent_entity_type must be Event (capital E). Values market or series will error.
Each comment object contains:
body — the comment textprofile.username — commenter name (often null/anon)reactionCount — upvotescreatedAt — timestampAlso fetch the most recent comments to catch breaking takes:
curl -s "https://gamma-api.polymarket.com/comments?parent_entity_type=Event&parent_entity_id=$EVENT_ID&limit=10&order=createdAt&ascending=false"
From each market's comments, pick the 2-3 most interesting:
Skip low-effort noise (one-word comments, spam, unhinged rants with no signal).
If a market has fewer than 3 good comments from the API, supplement with a quick WebSearch:
"[market question]" polymarket site:x.com OR site:reddit.com
Send via ./notify (under 4000 chars):
polymarket comments — ${today}
1. "Market question?" — YES X% ($Xm vol)
- [user/anon]: "[interesting take]"
- [user/anon]: "[interesting take]"
2. "Market question?" — YES X% ($Xm vol)
- [user/anon]: "[interesting take]"
- [user/anon]: "[interesting take]"
... (5 markets)
Append to memory/logs/${today}.md:
## Polymarket Comments
- **Markets covered:** 5
- **Top market:** "[question]" — $Xm volume
- **Notable take:** "[best comment excerpt]"
- **Notification sent:** yes