Skip to content

feat(sub-accounts): pass vaultAddress on exchange mutations + trading banner #78

@vipineth

Description

@vipineth

Parent PRD

#75

What to build

When a sub-account is active, every exchange mutation (place order, cancel order, update leverage, switch margin mode, etc.) must pass the sub-account address as vaultAddress so Hyperliquid routes execution to the correct account. Without this, orders placed while a sub-account is selected would incorrectly land on the master account.

In addition, add a persistent banner at the top of the trading terminal when a sub-account is active: "Trading on behalf of sub-account: [name]" with a button to switch back to master. Disable the deposit and external withdrawal buttons (with an explanatory tooltip) since Hyperliquid only supports L1 deposits to the master account.

Acceptance criteria

  • Placing an order while a sub-account is active sends vaultAddress: <subAccountAddress> in the request
  • Cancelling an order while a sub-account is active includes vaultAddress
  • Updating leverage or margin mode while a sub-account is active includes vaultAddress
  • A banner is visible in the trading terminal whenever a sub-account is the active account
  • The banner shows the sub-account name and includes a "Switch to Master" control
  • Clicking "Switch to Master" in the banner resets the active account to master and hides the banner
  • Deposit button is disabled with a tooltip when a sub-account is active
  • External withdrawal is disabled with a tooltip when a sub-account is active

Blocked by

User stories addressed

  • User story 12 (persistent banner when sub-account active)
  • User story 13 (trading actions execute in the active account's context)
  • User story 14 (deposit and withdrawal disabled for sub-accounts)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions