Open Position

Open positions are Pear's synthetic basket positions that currently have non-zero asset sizes. Each position represents a basket trade with independent PnL, entry prices, and risk parameters.

Positions with FULLY_EXTERNAL execution flag are excluded.

Access

  • REST: GET /positions

  • WebSocket: open-positions channel (requires address)

What's Computed

Raw position data (entry prices, sizes, weights) is enriched with live Hyperliquid mark prices.

Per Asset

Field
Description

unrealizedPnl

(markPrice - entryPrice) Γ— size for longs, inverse for shorts

marginUsed

markPrice Γ— size / leverage

targetWeight

From original order (normalized), or entry value share as fallback

fundingPaid

Cumulative funding paid/received

Per Position

Field
Description

entryRatio / markRatio

Geometric weighted ratio using target weights (see below)

entryPriceRatio / markPriceRatio

Simple longPrice / shortPrice, only for 1-long / 1-short pairs

unrealizedPnl

Sum across all assets

unrealizedPnlPercentage

PnL relative to total margin used

positionValue

entryPositionValue + unrealizedPnl

takeProfit / stopLoss

Active risk parameters if set

Weighted Ratio Calculation

entryRatio and markRatio use a geometric weighted product with each asset's target weight as the exponent:

Target weight comes from original order weights (normalized). If not set, falls back to asset's share of total entry value. This means the ratio reflects the basket's intended allocation, not actual filled proportions which may drift due to price movement or partial fills.

Last updated