Skip to content

feat(data): add range-event activity types - #404

Merged
kartojal merged 4 commits into
mainfrom
feat/range-event-activity-types
Nov 5, 2026
Merged

kartojal merged 4 commits into
mainfrom
feat/range-event-activity-types

Conversation

@kartojal

@kartojal kartojal commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Adds DIRECTIONAL_SPLIT, DIRECTIONAL_MERGE, THRESHOLD_COMPOSE and THRESHOLD_DECOMPOSE activity types and accepts them in activity filters.

Threshold compose and decompose rows move no collateral, so they report shares and have no amount. These rows used to come back as UnknownActivity, so code that reads amount on every typed row now needs to handle them:

for row in page.items:
    match row:
        case ThresholdComposeActivity() | ThresholdDecomposeActivity():
            print(row.shares)
        case UnknownActivity():
            print(row.raw)
        case _:
            print(row.amount)

The list_activity docstrings on all four clients now say this.


Note

Low Risk
Additive data-model and parsing changes with tests; no auth, trading, or payment logic touched.

Overview
Adds four range-event wallet activity kinds—DIRECTIONAL_SPLIT, DIRECTIONAL_MERGE, THRESHOLD_COMPOSE, and THRESHOLD_DECOMPOSE—to ActivityType, activity filters, parsing, and public exports.

Directional split/merge rows are modeled as event-level activity with a USDC amount (no per-market condition_id). Threshold compose/decompose rows are tied to a line market (condition_id, outcome) and expose moved tokens as shares instead of collateral amount.

list_activity docs on all sync/async public and secure clients now call out threshold rows and that unrecognized types still deserialize as UnknownActivity with the full payload in raw. Unit tests cover parsing shapes and adjust the generic activity-variant test so threshold types are not forced through the USDC-only path.

Reviewed by Cursor Bugbot for commit e5191e6. Bugbot is set up for automated code reviews on this repo. Configure here.

kartojal and others added 2 commits November 4, 2026 17:40
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Activity

Threshold compose/decompose rows move line tokens without collateral: the
feed serves the amount in size and 0 in usdc_size. Expose it as shares
instead of an always-zero USDC amount.

UnknownActivity gains is_combo, amount, condition_id, title, slug, icon and
event_slug, parsed leniently, so callers can tell Combo rows apart without
reading raw. Matches the TypeScript SDK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop is_combo, amount, condition_id and the display fields added to
UnknownActivity so callers do not build on fields of types the SDK does
not model yet. raw still keeps the full row. Matches the TypeScript SDK,
where unlisted rows carry only the shared account fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kartojal
kartojal marked this pull request as ready for review November 5, 2026 12:07
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kartojal
kartojal requested a review from cesarenaldi November 5, 2026 15:33
@kartojal
kartojal merged commit acc548c into main Nov 5, 2026
7 checks passed
@kartojal
kartojal deleted the feat/range-event-activity-types branch November 5, 2026 17:53
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.

2 participants