curl --request GET \
--url https://api.example.com/api/v1/trading/positions{
"positions": [
{
"market_id": "<string>",
"token_id": "<string>",
"side": "<string>",
"size": 123,
"average_price": 123
}
]
}Get your current positions (basic)
curl --request GET \
--url https://api.example.com/api/v1/trading/positions{
"positions": [
{
"market_id": "<string>",
"token_id": "<string>",
"side": "<string>",
"size": 123,
"average_price": 123
}
]
}positions = client.get_positions()
from polyhush import PolyhushClient
client = PolyhushClient(api_key="your-api-key")
positions = client.get_positions()
for pos in positions:
cost = pos['size'] * pos['average_price']
print(f"Market: {pos['market_id']}")
print(f" {pos['side']}: {pos['size']} shares @ ${pos['average_price']:.2f}")
print(f" Cost basis: ${cost:.2f}")
print()
[
{
"market_id": "0x1234...abcd",
"token_id": "12345678901234567890",
"side": "Yes",
"size": 100,
"average_price": 0.55
},
{
"market_id": "0x5678...efgh",
"token_id": "09876543210987654321",
"side": "No",
"size": 50,
"average_price": 0.30
}
]
get_position_details() instead.