majjha.developers
Open beta

Public beta: activity uses test Dots with no monetary value. There is no money in or out, and interfaces may change before launch.

Portfolio

Read your test-Dot balance, open positions, fills, settlement history, and watchlist. 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.fun/api/portfolio/balance" \
  -H "Authorization: Bearer $MAJJ_TOKEN"

Response

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

List watchlist

Requires auth
GET/api/portfolio/watchlist

Returns your saved markets, newest saved first. The response includes `market_ids` for lightweight clients and full market rows for rendering discovery cards.

Request

cURL
curl "https://api.majjha.fun/api/portfolio/watchlist" \
  -H "Authorization: Bearer $MAJJ_TOKEN"

Response

200 OK
{
  "market_ids": ["mkt_btc5m_a1"],
  "markets": [
    {
      "id": "mkt_btc5m_a1",
      "ticker": "BTC-5MIN-25JUN04T0900-Y",
      "title": "BTC above $68,500 at 09:05?",
      "status": "ACTIVE",
      "lastYesPrice": "0.54",
      "lastNoPrice": "0.46",
      "volume": "12840.00",
      "category_name": "Crypto",
      "category_slug": "crypto",
      "trade_count": 381
    }
  ]
}

Save market

Requires auth
PUT/api/portfolio/watchlist/{market_id}

Adds a market to your watchlist. The path accepts either a market id or ticker and stores the canonical market id. Re-saving an existing market is a no-op.

Path parameters

  • market_idstringpathrequired

    Market id or ticker to save.

Request

cURL
curl -X PUT "https://api.majjha.fun/api/portfolio/watchlist/{market_id}" \
  -H "Authorization: Bearer $MAJJ_TOKEN"

Response

200 OK
{
  "market_id": "mkt_btc5m_a1",
  "watched": true,
  "added": true
}

Remove saved market

Requires auth
DELETE/api/portfolio/watchlist/{market_id}

Removes a market from your watchlist. Removing a market that is not currently saved is a no-op.

Path parameters

  • market_idstringpathrequired

    Market id or ticker to remove.

Request

cURL
curl -X DELETE "https://api.majjha.fun/api/portfolio/watchlist/{market_id}" \
  -H "Authorization: Bearer $MAJJ_TOKEN"

Response

200 OK
{
  "market_id": "mkt_btc5m_a1",
  "watched": false,
  "removed": true
}

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.fun/api/portfolio/positions" \
  -H "Authorization: Bearer $MAJJ_TOKEN"

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.fun/api/portfolio/fills" \
  -H "Authorization: Bearer $MAJJ_TOKEN"

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.fun/api/portfolio/settlements" \
  -H "Authorization: Bearer $MAJJ_TOKEN"

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"
    }
  ]
}