> 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/concepts/basket-model.md).

# The Basket model

Each wallet has a single **Basket** PDA that holds **all** of its positions and orders — one position per market. There are no standalone Position or Order accounts.

## Identifying a position

Because everything lives in one account, you identify a position by a friendly tuple rather than a raw key:

```
(owner, marketSymbol, side)
```

Long and short are **separate markets**, so a wallet can hold one long *and* one short per symbol, and `(marketSymbol, side)` is always unambiguous. The backend resolves the underlying market pubkey, owning pool, and custody roles for you.

That's why request bodies take `marketSymbol` + `side` (e.g. `"SOL"` + `"LONG"`) instead of position pubkeys.

## Reading the basket

Two endpoints decode the basket for you and return UI-ready metrics keyed by market pubkey:

* One-shot: [`GET /owner/{owner}`](/flash-trade/flash-trade-protocol/build-on-flash/flash-trade-v2/reference/account-and-positions.md)
* Live: [`GET /owner/{owner}/ws`](/flash-trade/flash-trade-protocol/build-on-flash/flash-trade-v2/reference/websocket.md)

Both return `positionMetrics` / `orderMetrics` (formatted PnL, leverage, liquidation price) **and** the raw basket bytes (base64). Use the metrics directly; decode the raw bytes with the client SDK only if you need native `PositionMeta[]` / `OrderMeta[]`.

> The basket must be **delegated** before you can trade against it — see [Funds lifecycle](/flash-trade/flash-trade-protocol/build-on-flash/flash-trade-v2/concepts/funds-lifecycle.md).

## Order slots

Per market + side, a basket holds up to **5 limit orders + 5 take-profit + 5 stop-loss**. Trigger/limit endpoints address a slot by `orderId` (0–4).


---

# 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/concepts/basket-model.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.
