# Positions

Positions are scoped to a subaccount and product. A positive size is long; a negative size is short.

## Position Values

The Trading API returns these main values:

| Field                   | Meaning                                  |
| ----------------------- | ---------------------------------------- |
| `size`                  | Current signed quantity.                 |
| `cost`                  | Current position cost in USD.            |
| `unrealizedPnl`         | Estimated PnL at the latest mark.        |
| `realizedPnl`           | PnL from completed reductions or closes. |
| `fundingUsd`            | Charged but not yet applied funding.     |
| `fundingAccruedUsd`     | Funding already applied to the position. |
| `positionFeeUsd`        | Outstanding position fee.                |
| `positionFeeAccruedUsd` | Position fees already applied.           |
| `feesAccruedUsd`        | Trading fees accrued on the position.    |

All USD and quantity decimals have at most nine decimal places.

## Position Changes

Same-side fills increase a position; opposite-side fills reduce it. A reduce-only order cannot increase or flip the position.

If a normal opposite-side order is larger than the position, the fill can close the old position and open a new position on the other side. This is a position flip.

A market-close order cancels applicable working orders and uses the current position size.

## Settlement of Accrued Amounts

Funding and position fees can accrue before the balance update is finalized for that position. The exchange includes outstanding amounts in risk calculations. When the position is touched by a later state change, the exchange realizes the outstanding amount against the applicable quote-token balance.

## Position History

Use these endpoints:

* `GET /v1/position` to list positions for a subaccount.
* `GET /v1/position/active` to get the open position for one product.
* `GET /v1/position/fill` to list fills for a position.
* `GET /v1/position/liquidation` to list liquidation records.
* Archive API `GET /v1/subaccount/funding` for funding history.
* Archive API `GET /v1/subaccount/position-fee` for position-fee history.
