PearPear
API IntegrationTrade Activity

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.

LevelPageAnswers
One trade printFillsWhat filled, at what price, and what it cost in fees.
One actionExecutionWhat an open, adjust, close, or reverse actually did at the venue.
One finished tradeClosed PositionWhat a basket earned, after fees and funding, per leg.
The whole accountPortfolioHow 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: false means every dayFunding is 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 pro user role. Any other role gets a 403, whatever the API key's scopes are.

Two traps worth carrying here:

  • /tca/summary bounds its window with from and to, not the startDate and endDate the 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 executionContext carries positionId, scheduleId, and triggerId — the correlation GET /executions withholds. 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.

connector is required. A bare GET /funding is a 400.

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.

On this page