> For the complete documentation index, see [llms.txt](https://exliquid.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://exliquid.gitbook.io/docs/trading/positions.md).

# Positions

Perpetual fills create and modify positions. A position represents the account's current directional exposure in a market.

## Long and short exposure

At a product level:

* a **long** position benefits when the market price rises relative to the entry price;
* a **short** position benefits when the market price falls relative to the entry price;
* reducing a position realizes part of its PnL;
* fully closing a position removes the open exposure;
* trading through zero can create exposure in the opposite direction when the action allows it.

## Entry price

The displayed entry price summarizes the cost basis of the current open position. It changes when exposure is increased or reversed according to the current position-accounting rules.

## Realized and unrealized PnL

**Unrealized PnL** reflects the value change of the still-open position using the protocol's risk-oriented market price.

**Realized PnL** is produced when exposure is reduced or closed.

Because unrealized PnL is used in risk calculations, integrations should not substitute an arbitrary last-trade price for the protocol mark price.

## Funding

Open perpetual positions can accrue funding. Funding changes the economics of holding a position and can affect account equity and risk over time.

See [Funding and margin](/docs/trading/funding-and-margin.md).

## Margin and liquidation

Position notional and the applicable margin rules determine how much collateral is required to maintain the exposure.

If the account or position falls below the applicable maintenance requirement, it may become eligible for liquidation. See [Liquidation and risk](/docs/trading/liquidation-and-risk.md).

## API access

Use:

* `GET /api/v1/accounts/{address}/positions` for current positions;
* `GET /api/v1/accounts/{address}/risk` for risk-related account data;
* authenticated account WebSocket channels for real-time position updates.


---

# 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://exliquid.gitbook.io/docs/trading/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.
