Portfolio

Read your trading state: open positions, fills, settlements and balance, plus deposit/withdraw funding actions. All endpoints require a Bearer token.

Get balance

Requires auth
GET/api/portfolio/balance

Returns your cash balance: `available` to trade, `reserved` against resting orders, `total` cash, and total `portfolio_value` (cash + mark-to-market positions). Amounts are decimal strings.

Request

cURL
curl "https://api.majjha.com/api/portfolio/balance" \
  -H "Authorization: Bearer $PMX_API_KEY"

Response

200 OK
{
  "available": "842.50",
  "reserved": "157.50",
  "total": "1000.00",
  "portfolio_value": "1063.20"
}

List positions

Requires auth
GET/api/portfolio/positions

Returns your open positions, cursor-paginated, with mark-to-market value and P&L.

Query parameters

  • limitintegerqueryoptionaldefault: 20

    Page size. Max 100.

  • cursorstringqueryoptional

    Opaque cursor from the previous page.

Request

cURL
curl "https://api.majjha.com/api/portfolio/positions" \
  -H "Authorization: Bearer $PMX_API_KEY"

Response

200 OK
{
  "cursor": null,
  "positions": [
    {
      "position_id": "pos_77",
      "market_id": "mkt_btc5m_a1",
      "market_title": "BTC above $68,500 at 09:05?",
      "market_status": "ACTIVE",
      "side": "YES",
      "quantity": "100",
      "avg_entry_price": "0.54",
      "current_price": "0.58",
      "value": "58.00",
      "unrealized_pnl": "4.00",
      "realized_pnl": "0.00"
    }
  ]
}

List fills

Requires auth
GET/api/portfolio/fills

Returns your individual trade fills (executions), cursor-paginated and optionally filtered by ticker.

Query parameters

  • tickerstringqueryoptional

    Filter by market ticker.

  • limitintegerqueryoptionaldefault: 20

    Page size. Max 100.

  • cursorstringqueryoptional

    Opaque cursor from the previous page.

Request

cURL
curl "https://api.majjha.com/api/portfolio/fills" \
  -H "Authorization: Bearer $PMX_API_KEY"

Response

200 OK
{
  "cursor": null,
  "fills": [
    {
      "fill_id": "fil_31",
      "trade_id": "trd_9f2",
      "order_id": "ord_a1b2c3",
      "ticker": "BTC-5MIN-25JUN04T0900-Y",
      "side": "bid",
      "count": "40",
      "price": "0.54",
      "is_taker": true,
      "created_at": "2026-06-04T09:03:05Z"
    }
  ]
}

List settlements

Requires auth
GET/api/portfolio/settlements

Returns markets that have resolved against your positions, with realized P&L.

Query parameters

  • tickerstringqueryoptional

    Filter by market ticker.

  • limitintegerqueryoptionaldefault: 20

    Page size. Max 100.

  • cursorstringqueryoptional

    Opaque cursor from the previous page.

Request

cURL
curl "https://api.majjha.com/api/portfolio/settlements" \
  -H "Authorization: Bearer $PMX_API_KEY"

Response

200 OK
{
  "cursor": null,
  "settlements": [
    {
      "settlement_id": "stl_12",
      "market_id": "mkt_btc5m_z9",
      "market_title": "BTC above $68,400 at 08:55?",
      "market_status": "RESOLVED",
      "side": "YES",
      "avg_entry_price": "0.48",
      "realized_pnl": "26.00",
      "settled_at": "2026-06-04T08:55:00Z"
    }
  ]
}

Create deposit

Requires auth
POST/api/portfolio/deposits

Credits play-money funds to your balance (Phase 1 off-chain). Returns the updated balance.

Body parameters

  • amountnumberbodyrequired

    Amount to deposit.

Request

cURL
curl -X POST "https://api.majjha.com/api/portfolio/deposits" \
  -H "Authorization: Bearer $PMX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 500
  }'
Request body
{
  "amount": 500
}

Response

200 OK
{
  "available": "1342.50",
  "reserved": "157.50",
  "total": "1500.00"
}

Create withdrawal

Requires auth
POST/api/portfolio/withdrawals

Debits funds from your available balance. Returns the updated balance.

Body parameters

  • amountnumberbodyrequired

    Amount to withdraw (must be ≤ available).

Request

cURL
curl -X POST "https://api.majjha.com/api/portfolio/withdrawals" \
  -H "Authorization: Bearer $PMX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 200
  }'
Request body
{
  "amount": 200
}

Response

200 OK
{
  "available": "1142.50",
  "reserved": "157.50",
  "total": "1300.00"
}