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

# Portfolio & History

> Trade history, PnL analytics, and everything the Avantis portfolio page shows.

`client.info` is the read-only analytics surface. All methods take a trader address explicitly (query any account), return human units, and require no signing key.

```python theme={null}
trader = client.trade.trader   # or any address

history = await client.info.trade_history(trader, page=0, limit=20)
pnl = await client.info.portfolio_pnl(trader)
```

## History

| Method                                    | Returns                                                      |
| ----------------------------------------- | ------------------------------------------------------------ |
| `trade_history(trader, page=0, limit=20)` | Fills with full fee breakdown (gross/net PnL, fees, funding) |
| `order_history(trader, page=0, limit=20)` | Order lifecycle history                                      |
| `recent_trades(pair_index)`               | Recent market-wide trades for a pair                         |

## Portfolio analytics

| Method                                                    | Returns                                                 |
| --------------------------------------------------------- | ------------------------------------------------------- |
| `portfolio_pnl(trader, grouped=False)`                    | Total profit/loss (`grouped=True` splits by pair group) |
| `portfolio_pnl_history(trader, period, date_group="day")` | PnL over time                                           |
| `portfolio_volume(trader, grouped=False)`                 | Total traded size                                       |
| `win_rate(trader, grouped=False)`                         | Win-rate stats                                          |
| `total_fees(trader)`                                      | Total fees paid                                         |
| `loss_protection_received(trader)`                        | Loss-protection payouts received                        |
| `portfolio_highlights(trader)`                            | Best/worst trade highlights                             |
| `leaderboard(trader=None)`                                | Global leaderboard, optionally centered on a trader     |

## Referral & vault reads

| Method                                                      | Returns                                                                  |
| ----------------------------------------------------------- | ------------------------------------------------------------------------ |
| `referral_stats(trader)`                                    | `{asReferrer: {totalFees, totalRebates, totalTraders}, asTrader: {...}}` |
| `referral_count(trader)` / `referred_fees(trader)`          | Referral counts and fee volumes                                          |
| `vault_returns()` / `vault_share_rate_returns(chart=False)` | LP vault APY and share-rate returns                                      |
| `user_vault_info(vault_type, trader)`                       | A trader's vault position                                                |
| `app_status()`                                              | API/app status                                                           |

<Note>
  Endpoints degrade gracefully: one that is missing on a given deployment raises `ApiError` with status 404 rather than crashing the client.
</Note>

For **open** positions and live unrealized PnL, use [`client.account.positions()`](/account/positions). `client.info` covers settled history and aggregates.
