Skip to main content
Notifications turn a Perps account’s activity into a ready-to-display feed of position changes, canceled orders, and liquidation events. They are the same events that drive the notification bell in the Polymarket app. Read recent notifications to render the feed, then stream the live channel to keep it fresh. Mark notifications read as the user catches up. Notifications summarize activity for display. To reconcile order, fill, and position state, use Reconcile Trade State instead.
Notifications require an authenticated session.

Read Notifications

Start with a read to render the feed. It returns the account’s notifications newest first, together with the unread count for the badge.
Fetch the first page of notifications.
Each entry pairs one notification with its read state, and readAt stays null until the notification is marked read. The read is paginated, so iterate it to walk older history.
For the unread badge, fetch the count directly.

Stream Notifications

Subscribe to the live channel to append new notifications and bump the unread badge without polling.
Notification events arrive on the session stream alongside the other private session updates.
The stream yields PerpsNotificationUpdateEvent objects like this.

Mark Notifications Read

Read state drives the unread count. Mark notifications read when the user views them, either one by one or everything up to the newest one they have seen. Read state is scoped to the account, so a session can only mark its own notifications read.
Mark specific notifications read by id, or mark everything up to an entry read.
upTo marks the given notification and every earlier one read, inclusive. Pass the newest entry the user has seen to clear the feed in one call.

Backfill Missed Notifications

The live channel can miss notifications. A reconnect leaves a gap, and under load the server can drop frames. The notifications read closes these gaps. Pass a sequence lower bound and it returns every notification from that point forward, so the feed catches up with stored history. Anchor the bound at the sequence of the last notification you processed, not at the sequence of the signal that told you to resync. The bound is inclusive and one event can emit several notifications that share one sequence, so the backfill re-covers the boundary. Deduplicate merged results by notification id, which is identical across the read and the live channel.
Track the sequence of the last notification event you processed. When the session signals a resync, run the backfill from that anchor.
Follow-up pages keep the same sinceSeq bound automatically. If you have not processed any notifications yet, leave sinceSeq unset and the read returns the newest notifications.

Notification Types

Every notification carries a type and a small type-specific payload. Fill-driven position notifications (position_opened, position_increased, position_reduced, and position_closed) can include an order_type field that names the kind of order behind the fill: market, limit, take_profit, or stop_loss. An order fired by a take-profit or stop-loss trigger reports the trigger that fired it. Otherwise an aggressing order submitted without a limit price reports market, and everything else reports limit, including fills on a resting maker order. The field is omitted when the fill cannot be attributed to an order, so treat it as optional display metadata. A liquidation_warning for an isolated-margin position names the instrument and its liquidation price. A cross-margin warning covers the whole account instead. It has no single instrument or liquidation price and lists the affected instruments. See Liquidation Mechanics for how liquidations work.
The PerpsNotificationType and PerpsNotificationOrderType enums export the type and order_type values. Each notification type carries these fields.
On position_liquidated, pnl is null when no fill produced a realized figure, for example a backstop close. viaBackstop reports whether an insurance-fund backstop applied to the liquidation.