Trade History
Read what already happened on the account, from single fills up to portfolio analytics.
History comes at four levels of detail. Pick the one that answers your question, rather than composing a coarse view out of a fine one.
| Level | Page | Answers |
|---|---|---|
| One trade print | Fills | What filled, at what price, and what it cost in fees. |
| One action | Execution | What an open, adjust, close, or reverse actually did at the venue. |
| One finished trade | Closed Position | What a basket earned, after fees and funding, per leg. |
| The whole account | Portfolio | How the account is doing over time. |
Pear composes each level from the one below it, so the numbers agree. Read the composed level when you can: deriving realized PnL from raw fills means reimplementing the basket accounting described in Synthetic Position.
Portfolio
Two endpoints answer how the account is doing: GET /portfolio for the scoreboard, and GET /portfolio/analytics for risk metrics, a per-asset and per-pair breakdown, and a daily series.
Two things to know before you plot anything:
- Portfolio metrics are JSON numbers, not decimal strings, unlike every other read in this section.
config.fundingSynced: falsemeans everydayFundingis unknown, not zero. See Syncing Venue Activity.
Full parameters, every response field, and the fields that ignore your date window are on Portfolio.
Transaction cost analysis
TCA measures execution quality: what you paid against the price when the order arrived. Three endpoints cover one action, one position, and the account.
All three need the
prouser role. Any other role gets a403, whatever the API key's scopes are.
Two traps worth carrying here:
/tca/summarybounds its window withfromandto, not thestartDateandendDatethe portfolio endpoints use. The wrong pair is silently ignored, so you get an unbounded window.- TCA is the only place an execution's provenance is exposed. A summary's
executionContextcarriespositionId,scheduleId, andtriggerId— the correlationGET /executionswithholds. See Execution.
Every field, including the benchmark object and how to read slippage against implementation shortfall, is on Transaction Cost Analysis.
Funding
GET /funding (SDK: sdk.core.funding.list) returns current funding rates.
connectoris required. A bareGET /fundingis a400.
curl "https://pro-gateway.pearprotocol.io/funding?connector=hyperliquid" \
-H "x-api-key: $PEAR_API_KEY"{
"funding": {
"0": { "r": "0.0000125", "nft": 1767225600000 }
}
}The map is keyed by instrument ID. r is the funding rate as a decimal string. nft is the next funding time in epoch milliseconds.
This is the one endpoint on this page that is not scoped to a trade account, so it needs no x-trade-account-id header.
What a position has actually paid is on the position itself, in totalFundingPayment. See Net Funding.
Basket-scoped, not asset-scoped
Every number here is measured against the basket's own entry, not the exchange's global average for the asset. Expect it to differ from the venue's UI. See Synthetic Position.