Skip to main content
GET
/
api
/
v1
/
trading
/
positions
Get Positions
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
    }
  ]
}

Usage

positions = client.get_positions()

Response

Returns a list of position objects.
positions
array

Example

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()

Response

[
  {
    "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
  }
]
For more detailed position information including P&L calculations, use get_position_details() instead.