> For the complete documentation index, see [llms.txt](https://docs.boba.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.boba.xyz/agents/boba-agents/core-capabilities/perpetuals-trading/fills-and-pnl.md).

# Fills & PNL

***

### Overview

Every time an order executes, it generates a **fill**, a record of exactly what was traded, at what price, and what you paid in fees. Combined with portfolio and fee views, you get a complete picture of how your trading is performing on Hyperliquid.

**What you can do:**

* View recent fills with execution prices and fees
* Track unrealized PnL on open positions in real-time
* Review realized PnL from closed trades
* Analyze portfolio performance over time
* Check your fee tier and total fees paid
* Query historical fills by time range

***

### Recent Fills

Fills are your executed trades. Every market order, limit fill, stop-loss trigger, and take-profit execution generates a fill.

| Prompt                           | Interpretation                 |
| -------------------------------- | ------------------------------ |
| "Show my recent fills"           | All recent trade executions    |
| "What trades have I made today?" | Fills from today               |
| "Show my last 10 fills"          | Most recent executions         |
| "What did I trade this week?"    | Fills from the past 7 days     |
| "Show my BTC fills"              | Filters to BTC executions only |

#### What You'll See

For each fill:

| Field          | What It Shows                                     |
| -------------- | ------------------------------------------------- |
| **Asset**      | The token traded (BTC, ETH, SOL, etc.)            |
| **Side**       | Buy or Sell                                       |
| **Direction**  | Open Long, Open Short, Close Long, or Close Short |
| **Price**      | The exact execution price                         |
| **Size**       | Quantity in contract units                        |
| **Notional**   | USD value of the fill                             |
| **Fee**        | Fee paid (negative means you earned a rebate)     |
| **Order Type** | Market, Limit, Stop-Market, etc.                  |
| **Time**       | When the fill occurred                            |

***

### Unrealized PnL

Unrealized PnL is the profit or loss on your **currently open** positions. It's what you'd make or lose if you closed right now. It changes with every price tick.

```
Long:  Unrealized PnL = (Current Price - Entry Price) × Size
Short: Unrealized PnL = (Entry Price - Current Price) × Size
```

| Prompt                               | Interpretation                             |
| ------------------------------------ | ------------------------------------------ |
| "What's my unrealized PnL?"          | Sum of PnL across all open positions       |
| "How much am I up on BTC?"           | BTC position PnL in dollars and percentage |
| "Am I profitable right now?"         | Overall unrealized PnL snapshot            |
| "Which position is doing best?"      | Ranks positions by PnL performance         |
| "Which position is losing the most?" | Identifies worst performer                 |

**Example:**

| Asset | Side  | Size   | Entry Price | Mark Price | Unrealized PnL | ROE   |
| ----- | ----- | ------ | ----------- | ---------- | -------------- | ----- |
| BTC   | Long  | $5,000 | $96,500     | $97,200    | +$36.27        | +3.6% |
| ETH   | Short | $2,000 | $3,450      | $3,380     | +$40.58        | +8.1% |
| SOL   | Long  | $1,000 | $148.50     | $145.20    | -$22.22        | -4.4% |

{% hint style="info" %}
Unrealized PnL only becomes realized when you close the position.
{% endhint %}

***

### Realized PnL

Realized PnL is the actual profit or loss from **closed** trades. Once a position is closed, the PnL is locked in and added to your account balance.

| Prompt                                      | Interpretation                        |
| ------------------------------------------- | ------------------------------------- |
| "What's my realized PnL?"                   | Total profit/loss from closed trades  |
| "How much did I make on my last BTC trade?" | PnL from most recent BTC close        |
| "Show my realized PnL this week"            | Closed trade PnL over the past 7 days |
| "How much have I made today?"               | Today's realized PnL                  |
| "What was my worst trade this month?"       | Largest realized loss                 |

***

### Portfolio Performance

Get a high-level view of your overall account performance over time.

| Prompt                          | Interpretation                    |
| ------------------------------- | --------------------------------- |
| "Show my portfolio performance" | Full account performance overview |
| "How's my perps account doing?" | Portfolio snapshot with total PnL |
| "What's my account value?"      | Current equity and margin usage   |
| "Show my PnL history"           | Performance over time             |

**Portfolio includes:**

* Total account equity
* Total realized PnL (cumulative)
* Total unrealized PnL (current)
* Margin usage and free margin
* Historical performance

***

### Historical Fills

Query fills from a specific time period for deeper analysis.

| Prompt                                 | Interpretation                  |
| -------------------------------------- | ------------------------------- |
| "Show my fills from the last 24 hours" | Fills from the past day         |
| "What trades did I make last week?"    | Last 7 days of fills            |
| "Show all my SOL fills this month"     | SOL-specific fills over 30 days |
| "Show fills from January"              | Fills within a specific month   |
| "My trading history since Monday"      | Fills from start of the week    |

The agent handles time conversion automatically. Just say "last week", "today", "since Monday", or any natural timeframe.

***

### Understanding Your Trade Flow

Here's how a complete trade maps to fills and PnL:

```
1. Open Position
   "Long $1000 of BTC"
   → Fill generated: "Open Long" at execution price
   → Position appears in your positions view
   → Unrealized PnL starts tracking

2. Price Moves
   → Unrealized PnL updates in real-time
   → No new fills (nothing executed)
   → Funding payments may accrue

3. Close Position
   "Close my BTC position"
   → Fill generated: "Close Long" at execution price
   → Realized PnL = Close Price - Entry Price (× size, minus fees)
   → Position removed from positions view
   → Margin freed back to account
   → Realized PnL added to portfolio history
```

***

### Funding Impact on PnL

Funding payments are included in your realized PnL and can meaningfully affect your returns on longer holds.

* **Positive funding, you're long**: You're paying. This eats into your PnL over time.
* **Positive funding, you're short**: You're earning. This adds to your PnL.
* **Negative funding, you're long**: You're earning.
* **Negative funding, you're short**: You're paying.

| Prompt                                  | Interpretation                        |
| --------------------------------------- | ------------------------------------- |
| "How much funding have I paid?"         | Cumulative funding payments           |
| "Is funding eating into my BTC profit?" | Checks funding impact on BTC position |

{% hint style="info" %}
**Tip**: If you're holding a position for days or weeks, check the funding rate. A 0.01% funding rate paid every 8 hours adds up to \~1.1% per month.
{% endhint %}

***

### Pro Tips

1. **Check unrealized PnL before closing** - Make sure you're exiting at a level you're comfortable with
2. **Use limit orders to reduce fees** - Maker rebates add up significantly over time
3. **Track funding payments** - On longer holds, funding can eat into profits or boost returns
4. **Review fills after stop-losses trigger** - Verify execution price matched expectations, especially in volatile markets
5. **Monitor margin usage** - Low free margin means higher liquidation risk
6. **Compare entry vs average price** - If you scaled into a position, your average entry may differ from individual fills

***


---

# 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://docs.boba.xyz/agents/boba-agents/core-capabilities/perpetuals-trading/fills-and-pnl.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.
