VeztaVezta

Portfolio

Positions, balances, and PnL snapshots

The Portfolio API provides access to a user's trading portfolio, including open positions, order history, resolved markets, watchlist management, and performance analytics. All portfolio endpoints require authentication.

Endpoints

MethodPathAuthDescription
GET/api/v1/portfolio/summaryBearerGet portfolio summary with total value and PnL
GET/api/v1/portfolio/positionsBearerGet open positions
POST/api/v1/portfolio/positions/:id/closeBearerClose a position
PUT/api/v1/portfolio/positions/:id/tp-slBearerSet take-profit/stop-loss on a position
GET/api/v1/portfolio/ordersBearerGet order history with filters
GET/api/v1/portfolio/resolvedBearerGet resolved positions
POST/api/v1/portfolio/resolved/:id/claimBearerClaim winnings from a resolved position
GET/api/v1/portfolio/watchlistBearerGet watchlist
POST/api/v1/portfolio/watchlistBearerAdd a market to watchlist
DELETE/api/v1/portfolio/watchlist/:marketIdBearerRemove a market from watchlist
GET/api/v1/portfolio/pnl-calendarBearerGet PnL calendar data by month
GET/api/v1/portfolio/chartBearerGet portfolio value chart data

Portfolio Summary

Get an overview of the user's portfolio including total value, unrealized PnL, and balance.

// GET /api/v1/portfolio/summary

// Response 200
{
  "totalValue": 1250.00,
  "totalPnl": 185.50,
  "totalPnlPercent": 17.4,
  "openPositionCount": 8,
  "availableBalance": 500.00,
  "invested": 750.00
}

Open Positions

Get all active (open) positions for the authenticated user.

// GET /api/v1/portfolio/positions

// Response 200
{
  "positions": [
    {
      "id": "pos-uuid-123",
      "marketId": "mkt-uuid-456",
      "marketTitle": "Will the Fed cut rates in June 2026?",
      "side": "yes",
      "shares": 100.00,
      "avgPrice": 0.55,
      "currentPrice": 0.63,
      "cost": 55.00,
      "currentValue": 63.00,
      "pnl": 8.00,
      "pnlPercent": 14.55,
      "takeProfit": null,
      "stopLoss": null,
      "source": "polymarket",
      "createdAt": "2026-03-20T10:00:00.000Z"
    }
  ]
}

Order History

Get the user's past orders with optional filters.

Query Parameters:

ParameterTypeDescription
statusstringFilter by order status
typestringFilter by order type (market, limit)
marketIdstringFilter by specific market
// GET /api/v1/portfolio/orders?status=filled

// Response 200
{
  "orders": [
    {
      "id": "order-uuid-789",
      "marketId": "mkt-uuid-456",
      "marketTitle": "Will the Fed cut rates in June 2026?",
      "side": "yes",
      "type": "market",
      "amount": 50.00,
      "price": 0.55,
      "shares": 90.91,
      "fee": 0.50,
      "status": "filled",
      "createdAt": "2026-03-20T10:00:00.000Z"
    }
  ]
}

PnL Calendar

Get daily PnL data for a given month, useful for rendering a calendar heatmap of trading performance.

Query Parameters:

ParameterTypeDescription
monthnumberMonth (1-12)
yearnumberYear

Portfolio Chart

Get historical portfolio value over time for chart rendering.

Query Parameters:

ParameterTypeDescription
periodstringTime period for the chart

Notes

  • All financial values use Decimal precision
  • Positions show real-time PnL calculated from the current market price
  • The watchlist allows users to bookmark markets for quick access without holding a position
  • Resolved positions must be explicitly claimed to collect winnings

On this page