Developers

Account state

Read balances, portfolio exposure, position details, and account history.

Balance

GET /polymarket/balance/{address}

Returns the full balance breakdown — availableBalance, totalBalance (signed), totalLoanPrincipal, accruedInterest, equity, openPositionValue, unrealizedPnl, freshness (fresh / settling / stale), plus *Formatted counterparts.

Also triggers a once-per-minute background reconcile of unrecorded Polygon Transfer events to the Deposit Wallet (self-heals dropped bridge deposits).

Portfolio (account-margin pipeline)

GET /polymarket/pipeline/{address}

Returns an array of pipeline entries — one per position (all opens and all closes, kept indefinitely), each containing the position, the loan that funded it, the margin/leverage breakdown, current price, uPnL, depth-adjusted liquidation price, and equity. Each position carries openedAt (ISO timestamp of the open request) and, for closed positions, closedAt. This is the structure the frontend uses to render the positions table; it's also the easiest single shot for a bot to read its open exposure and full trade history.

Account history

GET /polymarket/account-history/{address}
GET /polymarket/account-history/{address}?since=<ISO 8601 | epoch ms>

Chronological event log of all account activity, newest first: DEPOSIT, LOAN_ISSUED / LOAN_REPAID / LOAN_FAILED, WITHDRAWAL, and POSITION_OPENED / POSITION_CLOSED — with amounts, fees, interest, penalties, and tx hashes. Useful for PnL reconstruction and reconciliation.

Position events carry positionId, marketSlug, marketName, outcome, entryPrice, shares, and leverage (plus exitPrice on closes); loan events also carry the positionId they funded. POSITION_OPENED.amount is the gross position size; POSITION_CLOSED.amount is the signed net PnL (trade PnL minus liquidation penalty plus any redemption credit), and its status distinguishes CLOSED / LIQUIDATED / MERGED. In-flight (not-yet-filled) opens are not events; they appear once filled.

since returns only events at or after the given instant, so bots can poll incrementally instead of re-diffing the full list.

Wallet status

GET /polymarket/wallet/{address}

Deposit-Wallet provisioning status — whether the proxy is deployed, approvals are seeded, and the CLOB API key is registered. Should be clobReady: true before placing orders.

Position lookup

GET /polymarket/positions/{id}
GET /polymarket/positions/{id}/status   # adds currentPrice, pnlUsd, distanceToLiquidation