feat(user-action): add TransferCrossToIso / TransferIsoToCross call messages (BE-418) - #86
Draft
0xtristan wants to merge 1 commit into
Draft
feat(user-action): add TransferCrossToIso / TransferIsoToCross call messages (BE-418)#860xtristan wants to merge 1 commit into
0xtristan wants to merge 1 commit into
Conversation
…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
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.
What
Adds two intra-account USDC transfer call messages to
UserAction:TransferCrossToIso { market_id, amount, sub_account_index }= 18TransferIsoToCross { market_id, amount, sub_account_index }= 19They 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 externalDepositIso/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)
transferCrossToIso/transferIsoToCrossfactories auto-generate from the schema on the version bump.🤖 Generated with Claude Code
Summary by cubic
Adds two intra-account
UserActionmessages 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.TransferCrossToIso { market_id, amount, sub_account_index }= 18TransferIsoToCross { market_id, amount, sub_account_index }= 19PlaceOrders)#[repr(u8)]+borsh(use_discriminant)Written for commit 868da34. Summary will update on new commits.