Skip to content

feat(ts-sdk): activity as per-batch entries, one feed per account - #318

Draft
majesticwizardcat wants to merge 1 commit into
mainfrom
giannis/activity-frames
Draft

majesticwizardcat wants to merge 1 commit into
mainfrom
giannis/activity-frames

Conversation

@majesticwizardcat

@majesticwizardcat majesticwizardcat commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Tracks pod#170: GET /clob/activity/{account} and pod_activity now serve one account's activity as one entry list per batch, {"<batch>": [{k, …}]}, with a type filter, newest-first whole-batch paging and next passed back as to. The SDK reads that shape and keeps client.activity(account, query) as the one feed of everything that happened to an account.

Public API

  • One feed per account: client.activity(account) holds the one pod_activity subscription and the one paging state; activity.view({ types, from, to }) is a filtered view over its rows (client.activity(account, query) returns one), so the activity page, the chart and any other reader share a single subscription.
  • ActivityEntry rows keep activityType and timeMs (the batch) and gain the kinds the node now stores: fill (this fill, running totals, closedAs, positionAfter), modify (new and old terms), termination (status and final totals), and the stream-only modify_reject / cancel_reject. The order row is the order as /clob/orders serves it, with its current state on REST and the admission state on the stream; live entries update the held order.
  • Order.fills is gone, on /clob/orders too: fills are the activity fill rows and /clob/fills. OrderEvent.fill keeps the live fill's payload.
  • A transfer row carries counterparty: the receiver when amount is negative, the sender otherwise. On the wire the money kinds use short names (tok, amt, err, cp, sz, eq); the public rows keep their names.
  • ActivityType is the seven filter values; ActivityQuery.from/to are inclusive batch bounds in ms, limit counts entries per REST page.
  • OrderStatus/TerminalStatus gain self_trade_canceled; OrderEvent gains cancel_reject with cancelRejection, so onEvent reports a refused cancel instead of dropping it.
  • PodRestClient.activity takes {types, fromUs, toUs, limit} and returns the page as batches newest first with nextUs.

Behaviour

  • ActivityHistory seeds from the newest page, subscribes from solution_now, folds every batch in order into the orders it holds, and loadOlder passes next back as to. One batch map is the dedupe point for both sources; a reconnect re-seed fills the gap from the stream cursor and keeps the paging position.
  • pnlHistoryStream reads money flows with activity_types=backstop,bridge_transfer,transfer again.
  • Version 0.13.0: the public types changed.

Docs

doc/api-reference/rest/openapi.yaml, doc/api-reference/rest/README.md and the pod_activity parts of doc/api-reference/json-rpc/openapi.yaml describe the new shape.

Draft until pod#170 lands.

🤖 Generated with Claude Code

@majesticwizardcat majesticwizardcat changed the title feat(ts-sdk): activity history as per-batch frames feat(ts-sdk): activity as per-batch entries, every kind a row Oct 19, 2026
@majesticwizardcat
majesticwizardcat force-pushed the giannis/activity-frames branch 2 times, most recently from 2bedd86 to 2ce2afe Compare October 19, 2026 14:28
@majesticwizardcat majesticwizardcat changed the title feat(ts-sdk): activity as per-batch entries, every kind a row feat(ts-sdk): activity as per-batch entries, one feed per account Oct 19, 2026
Reads pod#170's wire: GET /clob/activity serves {"<batch>": [{k, …}]}
newest first with a type filter and `next` passed back as `to`, and
pod_activity sends the same map one tick at a time. ActivityEntry rows
keep activityType and timeMs and gain fill, modify, termination and the
stream-only refusals; the order row is the order as /clob/orders serves
it (current state on REST, admission state on the stream), so pre-upgrade
orders read correctly without folding, and live entries update the held
order. One ActivityHistory per account holds the one subscription and
the paging state; views filter it by types and window. Order.fills is
gone, on /clob/orders too: fills are the fill rows and /clob/fills.
drainFlows filters by type again. Version 0.13.0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant