Skip to content

feat(user-action): add TransferCrossToIso / TransferIsoToCross call messages (BE-418) - #86

Draft
0xtristan wants to merge 1 commit into
mainfrom
be-418-on-0111
Draft

feat(user-action): add TransferCrossToIso / TransferIsoToCross call messages (BE-418)#86
0xtristan wants to merge 1 commit into
mainfrom
be-418-on-0111

Conversation

@0xtristan

@0xtristan 0xtristan commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

What

Adds two intra-account USDC transfer call messages to UserAction:

  • TransferCrossToIso { market_id, amount, sub_account_index } = 18
  • TransferIsoToCross { market_id, amount, sub_account_index } = 19

They move collateral between the account's cross pool and a market's isolated-margin bucket. Funds never leave the account, so these are delegate-authorizable (same risk class as PlaceOrders) — unlike the external DepositIso/WithdrawIso. Uses the previously-reserved discriminants 18/19 (ABI-safe: explicit #[repr(u8)] + borsh(use_discriminant)).

Why

Enables Hyperliquid/CEX-parity isolated-margin UX: fund an iso position from your existing cross balance, agent-signed and instant — no external deposit, no wallet popup. Today there is no cross↔iso primitive at all.

Downstream (separate PRs)

  • Rollup: handlers for these actions + bump the interface pin to this release (Linear BE-418).
  • SDK: transferCrossToIso/transferIsoToCross factories auto-generate from the schema on the version bump.
  • Trading API / frontend: consume the new flow.

🤖 Generated with Claude Code


Summary by cubic

Adds two intra-account UserAction messages to move USDC between cross margin and a market’s isolated margin, enabling instant, agent-signed iso funding without external deposits (Linear BE-418). Uses reserved discriminants 18/19 to keep the ABI stable.

  • New Features
    • TransferCrossToIso { market_id, amount, sub_account_index } = 18
    • TransferIsoToCross { market_id, amount, sub_account_index } = 19
    • Intra-account only; delegate-authorizable (same risk as PlaceOrders)
    • ABI-safe via #[repr(u8)] + borsh(use_discriminant)

Written for commit 868da34. Summary will update on new commits.

Review in cubic

…sages (BE-418)

Add two intra-account, delegate-authorizable USDC transfer variants between the
cross margin pool and a market's isolated margin bucket, using the previously
reserved discriminants 18/19 (ABI-safe).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PypqF2ZyuPApGKuc3szjLA
@0xtristan
0xtristan requested review from kelvinlau20100 and vmmon July 4, 2026 09:04
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