After orders fill, positions appear in the account. This guide covers how to query, interpret, and display position data.Documentation Index
Fetch the complete documentation index at: https://docs.bluumfinance.com/llms.txt
Use this file to discover all available pages before exploring further.
Listing positions
Position detail
Understanding P&L fields
| Field | Calculation | Use for |
|---|---|---|
total_cost_basis | quantity * average_cost_basis | What the user paid |
market_value | quantity * current_price | What it’s worth now |
unrealized_pl | market_value - total_cost_basis | Dollar gain/loss |
unrealized_pl_percent | unrealized_pl / total_cost_basis | Percentage gain/loss |
Displaying positions in your UI
Common patterns for showing positions to users:Portfolio summary
- Total market value (sum of all
market_value) - Total unrealized P&L (sum of all
unrealized_pl) - Overall percentage return
Per-position row
- Symbol and name
- Quantity held
- Current price
- Market value
- Unrealized P&L (with color: green for positive, red for negative)
- Percentage change
Real-time updates
Positions update as market prices change. To keep your UI current:- Polling — Query positions periodically (e.g., every 30 seconds during market hours)
- Webhooks — Subscribe to
order.filledevents to know when new positions are created or existing ones change
When positions update
| Event | Effect |
|---|---|
| Buy order fills | New position created, or existing position increased |
| Sell order fills | Position decreased or removed (if fully sold) |
| Price change | current_price, market_value, unrealized_pl updated |
| Stock split | quantity and average_cost_basis adjusted proportionally |
Empty positions
When a user sells their entire holding in an asset, the position is removed from the list. AGET /positions response only includes assets the user currently holds.