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

# Positions

> GET /v1/positions, GET /v1/positions/{market}, POST /v1/positions/{market}/close

## GET /v1/positions

Your current exposure per market.

```json theme={null}
{ "positions": [
  { "market": "ETH",
    "direction": "long",
    "quantity": "0.1753",
    "entry_price": "3400.00",
    "mark_price": "3440.10",
    "notional_usd": "603.20",
    "unrealized_pnl_usd": "3.79",
    "funding_usd": "-0.12" }
] }
```

* `quantity` is base units, always positive; `direction` carries the sign.
* `notional_usd` = quantity × mark\_price (current value, not what you paid).
* `unrealized_pnl_usd` is before fees, after funding accrual.
* `funding_usd` is cumulative funding for the open position; negative means paid.
* There is no `opened_at`: the venue does not report one, and inventing one from order history would be wrong after adds and partial closes.

## GET /v1/positions/{market}

Returns the bare position, or `404 not_found.position` if you are flat.

## POST /v1/positions/{market}/close

```json theme={null}
{ }                                   // full close
{ "usd": "50" }                       // partial close (current notional)
{ "usd": "50", "idempotency_key": "..." }
```

Returns `201` with an [Order](/api-reference/orders) whose `action` is `"close"`.

* Closing a market with no position → `404 not_found.position`.
* `usd` above the current notional closes fully (clamped, not rejected).
* "Full close" always means the entire position as it stands at execution time, including on an idempotent resubmission after a crash.
