Add inventory management with configurable limits and updater thread

This commit is contained in:
Nawaz Haider
2026-01-15 19:26:51 +06:00
parent e88752cb23
commit 02bb3eefee
4 changed files with 47 additions and 5 deletions
+15
View File
@@ -0,0 +1,15 @@
import requests
import os
def get_inventory(slug=None):
url = f"https://data-api.polymarket.com/positions?sizeThreshold=1&user={os.getenv('POLYMARKET_PROXY_ADDRESS')}&mergeable=false"
response = requests.get(url).json()
size = 0
for pos in response:
if pos and pos.get("slug") == slug:
size += pos.get("size")
print(pos)
return round(size / 5)