Pear Exchange
Prediction markets

GET /api/prediction-wallet/pnl

Privy session → linked wallets; for each target (Polygon Polymarket + Solana DFlow as applicable) the Edge API calls the portfolio service, which refetches in-window trades and returns hourly series points. combined forward-fills each wallet’s series on the union of timestamps, then sums portfolio_value / realized_pnl / unrealized_pnl / total_pnl — use this JSON to render the PnL line in the client (no image is returned). Polymarket uses full on-chain history when the service has POLYGON_RPC_URL; without it, the public data-api is capped. Query: start, end (ISO or now), wallet, source (polymarket | dflow), starting_usdc, refresh (bypass short-lived cache), max_age_ms.

GET
/api/prediction-wallet/pnl
AuthorizationBearer <token>

Privy access token. For live POST /execute, use the wallet-auth JWT instead.

In: header

Query Parameters

start?string

Window start (default 2020-01-01).

end?string

Window end (default now).

wallet?string

Optional. Restrict to one linked address (0x or Solana).

source?string

Optional. Only that venue’s linked wallet.

Value in"polymarket" | "dflow"
starting_usdc?number
refresh?string

If 1 / true / yes, prefer bypassing the edge DB cache for this key.

max_age_ms?integer

Response Body

curl -X GET "https://api.pear.trade/api/prediction-wallet/pnl"
Empty
Empty
Empty
Empty