> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sesameterminal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Portfolio

# Portfolio

All positions with live value and one-click actions (`/portfolio`). Main workflow:
manage many positions and their resting orders without opening each market.

## Content

* **Summary strip:** liquidation value of all positions, unrealised P\&L, cash, exposure,
  open orders.
* **Positions**, grouped by event (default), league, expiry or venue, or ungrouped.
* **Per position:** market and outcome, live score, size, average price, best bid,
  liquidation value, unrealised P\&L, resting-order count, actions.
* **Resolved positions:** status and a link to claim on polymarket.com. There is no
  in-app redeem.
* **Activity tab:** P\&L chart and the fill and trade history.

### Values

| Value | Definition | Source |
| - | - | - |
| Liquidation value | What selling the whole position into the current bids would pay, walking the book level by level (not size × midpoint) | `engine/portfolio` |
| Unrealised P\&L | Liquidation value − cost basis | `engine/portfolio` |
| Exit price | The **walk price**: the lowest bid level needed to fill the whole size. Shown on the Exit button | `engine/portfolio` |
| Size, average | Data API positions | backend |

The browser displays these values and does no money arithmetic.

### Row actions

Every action is one click, visible on the row (not hover-only): Exit, Join and Add show
live prices, so they are content as much as controls. Each has a fixed width so live
label changes never shift it. All are price buttons except the cancel button.

| Button | Colour | Action | Label |
| - | - | - | - |
| **Exit** | sell (red) | Sell the whole position with a GTC limit at the walk price. It fills against the bids from the best down; any unfilled rest stays at the walk price | `Exit 39¢` |
| **Join** (Exit at join ask) | sell (red) | Sell the whole position resting at the best ask | `Join 43¢` |
| **Add** | buy (green) | Buy the active stake at the best ask | `Add 43¢` |
| **Cancel orders** | destructive-ghost | Cancel all your orders in this market; N = count. Blank at 0, width kept | `[x] 2` (the `x` icon and the count; accessible name `Cancel 2 orders in this market`) |

Cursor tags state the full effect, e.g. Exit:
`Sell 120 sh down to 39¢ · est. $49.20`.

## Desktop (content 1376 px)

```
 ┌──────────────────────────────────────────────────────────────────────────────────────────────────────┐
 │ Positions 12   Activity                         Group [Event [chevron-down]]  [ ] Show resolved (2)  │ 36 tabs, grouping
 ├──────────────────────────────────────────────────────────────────────────────────────────────────────┤
 │ Liq value      Unrealised P&L    Cash          Exposure      Open orders                             │ 56 summary figures
 │ $4,410.20      +$182.40          $1,234.56     $3,210.00     7                                       │
 ├──────────────────────────────────────────────────────────────────────────────────────────────────────┤
 │ Market / outcome       Game / ends     Size  Bid     Liq      P&L Actions                            │ 32 column headers
 ├──────────────────────────────────────────────────────────────────────────────────────────────────────┤
 │ Lakers v Celtics · NBA Q3 4:12 88–84              $73.20   +$2.80                               [x] 3│ 32 group
 │ Lakers · Moneyline     Q3 4:12       120 sh  41¢  $49.20   +$4.80 [Exit 39¢][Join 43¢][Add 43¢] [x] 2│ 36
 │ LAL −4.5 · Spread                     50 sh  48¢  $24.00   −$2.00 [Exit 47¢][Join 50¢][Add 50¢] [x] 1│ 36
 │ Fed decision Decemb…   31 Dec                    $124.00  +$10.00                                    │ 32 group
 │ Yes · Cut 25bp         31 Dec 17:00  200 sh  62¢ $124.00  +$10.00 [Exit 62¢][Join 63¢][Add 63¢]      │ 36
 │ Resolved                                                                                             │ 32 group
 │ Knicks · Moneyline     Final 108–99   80 sh       $80.00  +$44.80 Won · Claim [external-link]        │ 36
 └──────────────────────────────────────────────────────────────────────────────────────────────────────┘
   Drawn without the expand chevrons and the Avg and Orders columns, to fit. Group rows lead
   with [chevron-down]; position rows with [chevron-right] (expand). A blank [x] N slot means
   no open orders; the width stays reserved.
```

### Columns

| Column | Width | Notes |
| - | - | - |
| Expand | 32 | Chevron; also toggled by clicking the row body or `Enter` |
| Market / outcome | flex (≥ 280) | Outcome (body), market type (body-sm, muted). Click the text: open the market view |
| Game / ends | 112 | Header `Game / ends`, left-aligned over the text and sortable. Compact score badge for games (the start before it, in the one start format; then the live clock and score; `Final`); for other markets the end date through `formatWhen` (`in 3h`, `31 Dec 17:00`), muted, with the exact time in the tooltip |
| Size | 80 | `120 sh` |
| Avg | 56 | Cents |
| Bid | 56 | Best bid, price cell with flash |
| Liq value | 96 | With flash |
| P\&L | 96 | Signed, green or red, with flash |
| Orders | 48 | Count of your resting orders in this outcome |
| Actions | 312 | Exit 72, Join 72, Add 72, cancel `[x] N` 48, 8 px gaps |

* Group header 32 px: group name, live score for event groups, summed liq value and P\&L,
  order count, and a group-level `[x] N` (cancel all orders in the group).
* Market / outcome takes the free width and truncates only when the row is full; sizes,
  prices, values and P\&L never truncate (their slots reserve the widest value).
* Group by: Event (default), League, Expiry (Today, This week, Later), Venue, None.
  Saved in `layouts`.
* Sorting: click a column header (Game / ends, size, liq value, P\&L). Row reorders from live
  values are deferred while the list is in use.
* Resolved positions sit in a `Resolved` group at the bottom, hidden unless
  `Show resolved` is on; the count shows next to the toggle. The Actions cell shows
  `Won` / `Lost` and `Claim on polymarket.com [external-link]` for winners (a link, opens
  a new tab).

### Expanded row (inline ladder)

```
 │ [chevron-down] Lakers · Moneyline   Q3 4:12   120 sh ...     [Exit 39¢][Join 43¢][Add 43¢] [x] 2 │
 ├────────────────────┬─────────────────────────────────────────────────────────────────────────────┤
 │ Ladder (232)       │ Orders in this market                                                       │ 360 tall
 │ (price-ladder.md)  │ Buy   Lakers   [−] 40¢ [+]    25    0/25   Open    2m                   [x] │
 │                    │ Sell  Lakers   [−] 47¢ [+]    60    0/60   Open    5m                   [x] │
 ├────────────────────┴─────────────────────────────────────────────────────────────────────────────┤
```

The expanded area sits in the row's own space, split by one vertical divider: no nested
box.

* 360 px tall, inset 32 px from the left. Ladder on the left (focusable panel), and the
  market's open orders on the right (orders.md rows, with steppers).
* Several rows can be expanded at once. Expansion state is kept per session.
* Motion: height appears in one frame, then the contents fade in (motion.md).

### Keys

`↑` `↓` select, `E` exit, `J` join, `A` add, `C` cancel market orders, `Enter` expand
(interactions.md).

## Activity tab

* P\&L chart (Data API P\&L series), 200 px tall, ranges 1D 1W 1M All, line in
  `--foreground`, zero line `--border`.
* History table (36 px rows): time, market / outcome, type (Fill, Trade, Resolution),
  side, price, size, value, fee. Filters: date range, market text, side. Newest first,
  virtualised, paged by date.

## Mobile

```
 ┌──────────────────────────────────────┐
 │ app header                           │ 52
 ├──────────────────────────────────────┤
 │ Liq value         Unrealised P&L     │ 96 summary: a 2 × 2 grid of figures on the
 │ $4,410.20         +$182.40           │    surface, no cards
 │ Cash              Exposure           │
 │ $1,234.56         $3,210.00          │
 ├──────────────────────────────────────┤
 │ Positions  Activity    [Event]       │ 44 tabs and the group select
 ├──────────────────────────────────────┤
 │ Lakers v Celtics · NBA  Q3 4:12 88–84│ 32 group header (sticky)
 │ ┌──────────────────────────────────┐ │
 │ │ Lakers · Moneyline               │ │ 20
 │ │ 120 sh at 41¢ · $49.20    +$4.80 │ │ 28 (P&L numeric-lg)
 │ │[Exit 39¢][Join 43¢][Add 43¢][x] 2│ │ 44 actions, 4 px gaps
 │ └──────────────────────────────────┘ │
 │ ┌──────────────────────────────────┐ │
 │ │ LAL −4.5 · Spread                │ │
 │ │ 50 sh at 52¢ · $24.00     −$2.00 │ │
 │ │[Exit 47¢][Join 50¢][Add 50¢][x] 1│ │
 │ └──────────────────────────────────┘ │
 ├──────────────────────────────────────┤
 │ tab bar                              │ 56
 └──────────────────────────────────────┘
```

* Cards 358 px, 12 px padding (a position card is a separate, actionable thing). The
  action row buttons are 44 px tall and two-line like every mobile price button (caption
  label, then price): `Exit / 39¢`, `Join / 43¢`, `Add $25 / 43¢`. Exit, Join and Add share
  the width; the cancel `[x] N` button is 56 px. All four sit 4 px apart.
* There is no stake bar on this tab, so the Add button carries the active stake in its
  label (principle 4). The stake is changed from the Live or Watchlist stake bar or the
  ladder sheet.
* Tap the card body: ladder sheet for that outcome. Long-press: action sheet (Open
  market, Set alert…, Cancel orders).
* Resolved cards show `Won` / `Lost` and the `Claim on polymarket.com [external-link]` link instead of
  the action row.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.