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

# Accounts

> How Phoenix accounts work and how cross and isolated risk differ

Phoenix separates a wallet authority from its trader accounts. The wallet signs transactions. Trader accounts hold collateral, positions, and resting orders.

Each trader account is a program-derived address (PDA) derived from:

* wallet authority
* `portfolio_index`
* `subaccount_index`

The pair `(portfolio_index, subaccount_index)` defines which account is being addressed for that authority.

## Authority and position authority

Each trader account has an `authority` and a `position_authority`.

The `authority` is the wallet authority used to derive and own the trader account. It has full account control: it can deposit and withdraw collateral, place and cancel orders, manage stop losses and conditional orders, create and sync subaccounts, and update the account's `position_authority`.

The `position_authority` is a trading signer stored on the trader account. New trader accounts start with `position_authority` set to the same wallet as `authority`, but the authority can delegate it to another wallet, such as an embedded app wallet. A position authority can sign trading actions like placing orders, cancelling orders, and managing stop losses or other conditional orders.

A `position_authority` is not a collateral owner. It cannot withdraw collateral from Phoenix and cannot call authority-only account management instructions such as `WithdrawFunds`, `DepositFunds`, or `DelegateTrader`. Some collateral transfers between trader accounts under the same wallet authority may allow a position authority signer, but a position authority cannot move collateral out to the wallet.

To set or rotate this signer from an integration, see [Set position authority](/sdk/accounts#set-position-authority) in the SDK docs.

## Portfolio index

`portfolio_index` partitions a wallet's Phoenix state into independent portfolios.

Each `portfolio_index` has its own collateral, positions, orders, and risk. Positions and collateral in one portfolio do not margin positions in another portfolio.

This lets a single wallet authority maintain separate trading books without sharing collateral or liquidation risk between them.

## Subaccount index

Within a portfolio, `subaccount_index` selects either the cross account or an isolated account.

### Cross account

`subaccount_index = 0` is the cross account for the portfolio.

The cross account uses one shared collateral pool across its active positions. PnL, funding, margin requirements, and order margin all affect the same account health.

Capacity limits:

* up to `128` active positions
* up to `64` resting bid limit orders per market
* up to `64` resting ask limit orders per market

### Isolated accounts

`subaccount_index > 0` is an isolated account under the same portfolio.

An isolated account is used for a single isolated position. Collateral is moved from the portfolio's cross account into the isolated account when the isolated position is opened or funded.

The isolated account has its own collateral and liquidation boundary. Losses in the isolated account do not automatically draw from the cross account after collateral has been allocated.

When the isolated position is closed, a crank can sweep remaining collateral back from the isolated account to the portfolio's cross account.

## Account model

For a given wallet authority:

* `(portfolio_index = 0, subaccount_index = 0)` is the first portfolio's cross account
* `(portfolio_index = 0, subaccount_index > 0)` is an isolated account under the first portfolio
* `(portfolio_index = 1, subaccount_index = 0)` is a separate cross account with independent collateral and positions
* `(portfolio_index = 1, subaccount_index > 0)` is an isolated account under that separate portfolio

The important boundary is the `portfolio_index`. Subaccounts inside one portfolio relate to that portfolio's cross account. Different portfolios do not share margin.
