Skip to content

feat(sub-accounts): transfer spot tokens between master and sub-account #82

@vipineth

Description

@vipineth

Parent PRD

#75

What to build

Extend the transfer modal (built in #81) with a spot token tab. When spot is selected the user sees a token picker (populated from the master's spot balances), an amount input, and the available balance for the selected token on both sides. Submitting calls exchange.subAccountSpotTransfer({ subAccountUser, isDeposit, token, amount }) where token is the Hyperliquid token identifier string and amount is a decimal string (not in wei).

The modal should retain the direction toggle from the perp tab so the same UX applies.

Acceptance criteria

  • Transfer modal has two tabs: "Perp USDC" and "Spot"
  • Spot tab shows a token picker listing tokens from the master's spot balances
  • Selecting a token shows the available balance on the source side
  • Amount input accepts a decimal string
  • Submitting with 0 or amount exceeding available balance shows a validation error
  • Submitting calls subAccountSpotTransfer with the correct token identifier and amount
  • Loading/success/error states behave the same as the perp tab

Blocked by

User stories addressed

  • User story 7 (transfer spot tokens from master to sub)
  • User story 8 (transfer spot tokens from sub to master)
  • User story 9 (modal shows available balance for both 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