You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# From slug (fastest)resp=requests.get(f'https://gamma-api.polymarket.com/markets?slug={slug}')
market_id=resp.json()[0]['id']
# From condition IDresp=requests.get(f'https://gamma-api.polymarket.com/markets?condition_id={cond_id}')
Top Volume Markets
url='https://gamma-api.polymarket.com/markets?limit=20&order=volume24hr&ascending=false&active=true&closed=false'# Filter: price > 2¢ and < 98¢ to skip resolved
orders=get_open_orders()
# Group by asset_id prefix (first 20 chars)# Known prefixes:# 81376898... = Elon 420-439# 66924366... = Elon 380-399# 62845222... = Elon 400-419
Cancel + Replace Pattern
# 1. Get orders by asset prefixorders_target= [oforoinordersifo['asset_id'].startswith('PREFIX')]
# 2. Cancel each with 0.3s delayforoinorders_target:
cancel_order(o['id'])
time.sleep(0.3)
# 3. Wait 3s for settlement# 4. Place new orders