> For the complete documentation index, see [llms.txt](https://docs.flash.trade/flash-trade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flash.trade/flash-trade/flash-trade-protocol/build-on-flash/flash-trade-v2/reference/account-and-positions.md).

# Account & positions

A wallet's live state, decoded from its basket. Shared conventions: [Conventions](/flash-trade/flash-trade-protocol/build-on-flash/flash-trade-v2/reference/conventions.md).

| Method | Path                       |
| ------ | -------------------------- |
| `GET`  | `/owner/{owner}`           |
| `GET`  | `/positions/owner/{owner}` |
| `GET`  | `/orders/owner/{owner}`    |

For the live WebSocket form, see [WebSocket](/flash-trade/flash-trade-protocol/build-on-flash/flash-trade-v2/reference/websocket.md).

***

## Basket snapshot

`GET /owner/{owner}`

One-shot fetch of the full basket — the same payload the WebSocket streams.

| Param   | In   | Description         |
| ------- | ---- | ------------------- |
| `owner` | path | Owner wallet pubkey |

**Response** — `BasketSnapshotDto`

```json
{
  "owner": "bRXn4PPnUCLKP3kdHbX6FFQFpw2AhFzBVMgo4ZaWvtfb",
  "basketPubkey": "…",
  "basketData": "base64-raw-basket-bytes…",
  "positionMetrics": { "<marketPubkey>": { /* PositionMetricsDto */ } },
  "orderMetrics": { "<marketPubkey>": { /* OrderMetricsDto */ } }
}
```

| Field             | Description                                                                                                                 |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `basketPubkey`    | Basket PDA (derived from owner); `null` if not yet ingested                                                                 |
| `basketData`      | Base64 raw basket bytes; `null` if not yet ingested. Decode with the client SDK for native `PositionMeta[]` / `OrderMeta[]` |
| `positionMetrics` | Per-position metrics keyed by market pubkey (active-pool, non-zero size)                                                    |
| `orderMetrics`    | Per-market order metrics keyed by market pubkey (non-empty slots)                                                           |

Field lists for `PositionMetricsDto` / `OrderMetricsDto` are on [WebSocket](/flash-trade/flash-trade-protocol/build-on-flash/flash-trade-v2/reference/websocket.md#dtos).

***

## Positions

`GET /positions/owner/{owner}`

The snapshot's `positionMetrics` on their own — a map of `marketPubkey → PositionMetricsDto`.

| Param   | In   | Description         |
| ------- | ---- | ------------------- |
| `owner` | path | Owner wallet pubkey |

Key fields per position: `sideUi`, `marketSymbol`, `entryPriceUi`, `sizeUsdUi`, `collateralUsdUi`, `pnlWithFeeUsdUi`, `pnlPercentageWithFee`, `liquidationPriceUi`, `leverageUi` (full list: [WebSocket › DTOs](/flash-trade/flash-trade-protocol/build-on-flash/flash-trade-v2/reference/websocket.md#dtos)).

***

## Orders

`GET /orders/owner/{owner}`

The snapshot's `orderMetrics` on their own — a map of `marketPubkey → OrderMetricsDto`, each with `limitOrders[]`, `takeProfitOrders[]`, `stopLossOrders[]` (trigger price, size, `orderId`, leverage).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flash.trade/flash-trade/flash-trade-protocol/build-on-flash/flash-trade-v2/reference/account-and-positions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
