Repository navigation
feat(ts-sdk): activity as per-batch entries, one feed per account - #318
Draft
majesticwizardcat wants to merge 1 commit into
Draft
majesticwizardcat wants to merge 1 commit into
majesticwizardcat wants to merge 1 commit into
Conversation
majesticwizardcat
force-pushed
the
giannis/activity-frames
branch
from
October 19, 2026 10:17
468ee45 to
b3dccbb
Compare
majesticwizardcat
force-pushed
the
giannis/activity-frames
branch
2 times, most recently
from
October 19, 2026 14:28
2bedd86 to
2ce2afe
Compare
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>
majesticwizardcat
force-pushed
the
giannis/activity-frames
branch
from
October 19, 2026 16:34
2ce2afe to
c2c3123
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracks pod#170:
GET /clob/activity/{account}andpod_activitynow serve one account's activity as one entry list per batch,{"<batch>": [{k, …}]}, with a type filter, newest-first whole-batch paging andnextpassed back asto. The SDK reads that shape and keepsclient.activity(account, query)as the one feed of everything that happened to an account.Public API
client.activity(account)holds the onepod_activitysubscription 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.ActivityEntryrows keepactivityTypeandtimeMs(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-onlymodify_reject/cancel_reject. Theorderrow is the order as/clob/ordersserves it, with its current state on REST and the admission state on the stream; live entries update the held order.Order.fillsis gone, on/clob/orderstoo: fills are the activityfillrows and/clob/fills.OrderEvent.fillkeeps the live fill's payload.transferrow carriescounterparty: the receiver whenamountis 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.ActivityTypeis the seven filter values;ActivityQuery.from/toare inclusive batch bounds in ms,limitcounts entries per REST page.OrderStatus/TerminalStatusgainself_trade_canceled;OrderEventgainscancel_rejectwithcancelRejection, soonEventreports a refused cancel instead of dropping it.PodRestClient.activitytakes{types, fromUs, toUs, limit}and returns the page as batches newest first withnextUs.Behaviour
ActivityHistoryseeds from the newest page, subscribes fromsolution_now, folds every batch in order into the orders it holds, andloadOlderpassesnextback asto. 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.pnlHistoryStreamreads money flows withactivity_types=backstop,bridge_transfer,transferagain.Docs
doc/api-reference/rest/openapi.yaml,doc/api-reference/rest/README.mdand thepod_activityparts ofdoc/api-reference/json-rpc/openapi.yamldescribe the new shape.Draft until pod#170 lands.
🤖 Generated with Claude Code