Skip to content

feat: add HIP-4 userOutcome actions (split/merge/negate/mergeQuestion)#3

Merged
smypmsa merged 1 commit into
mainfrom
hip-4-useroutcome-actions
Jun 29, 2026
Merged

feat: add HIP-4 userOutcome actions (split/merge/negate/mergeQuestion)#3
smypmsa merged 1 commit into
mainfrom
hip-4-useroutcome-actions

Conversation

@smypmsa

@smypmsa smypmsa commented Jun 29, 2026

Copy link
Copy Markdown
Member

HIP-4 added explicit userOutcome L1 actions after this repo's initial commit; the Python SDK (through 0.24.0) has no helpers for them. Add hand-signed wrappers and an example, and correct the docs that claimed no split/merge primitive existed.

  • hl4/outcome_actions.py: split_outcome, merge_outcome, negate_outcome, merge_question — signed via sign_l1_action + _post_action.
  • examples/13_split_merge.py: CLI for all four.
  • examples/11_mint_burn_demo.py, README.md: split explicit-actions vs engine classification; fees now zero; document fallback restrictions and that negate is unidirectional (mergeQuestion is its unwind).
  • pyproject.toml/uv.lock: bump hyperliquid-python-sdk floor to >=0.24.0.

All four actions verified live on testnet (split/merge/negate/mergeQuestion round-trip returns to the exact starting balance).

Summary by CodeRabbit

  • New Features

    • Added explicit outcome-share actions for splitting, merging, negating, and merging questions.
    • Introduced a new runnable example showing how to use these actions from the command line.
    • Re-exported the new outcome helpers for easier access.
  • Documentation

    • Updated the README and demo notes with clearer HIP-4 examples, current SDK compatibility, and revised split/merge guidance.
  • Chores

    • Updated the supported SDK version requirement.

HIP-4 added explicit userOutcome L1 actions after this repo's initial commit;
the Python SDK (through 0.24.0) has no helpers for them. Add hand-signed
wrappers and an example, and correct the docs that claimed no split/merge
primitive existed.

- hl4/outcome_actions.py: split_outcome, merge_outcome, negate_outcome,
  merge_question — signed via sign_l1_action + _post_action.
- examples/13_split_merge.py: CLI for all four.
- examples/11_mint_burn_demo.py, README.md: split explicit-actions vs engine
  classification; fees now zero; document fallback restrictions and that
  negate is unidirectional (mergeQuestion is its unwind).
- pyproject.toml/uv.lock: bump hyperliquid-python-sdk floor to >=0.24.0.

All four actions verified live on testnet (split/merge/negate/mergeQuestion
round-trip returns to the exact starting balance).
@smypmsa smypmsa merged commit 728f781 into main Jun 29, 2026
1 of 2 checks passed
@smypmsa smypmsa deleted the hip-4-useroutcome-actions branch June 29, 2026 16:57
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 44e5c5d3-82fe-48b7-951a-b3e0e8ebc8ff

📥 Commits

Reviewing files that changed from the base of the PR and between c937e9b and 7249afa.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • README.md
  • examples/11_mint_burn_demo.py
  • examples/13_split_merge.py
  • hl4/__init__.py
  • hl4/outcome_actions.py
  • pyproject.toml

📝 Walkthrough

Walkthrough

Adds a new hl4/outcome_actions.py module implementing four explicit HIP-4 userOutcome L1 actions (split_outcome, merge_outcome, negate_outcome, merge_question), exports them from hl4/__init__.py, introduces a CLI example script examples/13_split_merge.py, bumps the hyperliquid-python-sdk dependency to >=0.24.0, and updates README and existing example docs.

Changes

HIP-4 Explicit Outcome Actions

Layer / File(s) Summary
outcome_actions module and package exports
hl4/outcome_actions.py, hl4/__init__.py
New module adds _post_user_outcome (signs and posts L1 action) plus split_outcome, merge_outcome, negate_outcome, and merge_question functions. All four are imported and added to __all__ in the package init.
CLI example, dependency bump, and docs
examples/13_split_merge.py, pyproject.toml, README.md, examples/11_mint_burn_demo.py
New CLI script parses subcommands and dispatches to the four action functions. SDK dependency bumped to >=0.24.0. README split/merge section and 11_mint_burn_demo.py explainer updated to document explicit vs. implicit fill classification paths.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop, hop — a new command arrives,
Split your outcomes, merge your YES and NO,
Negate a share and watch the balance thrive,
Four tidy functions put on quite a show.
The rabbit signs each action with a stamp,
And docs now glow without a single damp!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hip-4-useroutcome-actions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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