Skip to content
Request a review

Vault Development · Vault Fundamentals · 3/7

Vault Deposits & Withdrawals

How Deposits Work

When a user deposits USDC into a vault, they own a proportional share of the vault's equity. Hyperliquid tracks each depositor's equity rather than issuing share tokens, but a share-price model is a useful way to reason about it:

Shares Received = Deposit Amount / Current Share Price
Share Price = Total Vault Equity / Total Shares Outstanding

Example

If the vault makes a 10% profit:

Reading Vault State

The SDK has no dedicated helper for vault details, so post the vaultDetails request directly (info endpoint docs):

from hyperliquid.info import Info
from hyperliquid.utils import constants

info = Info(constants.MAINNET_API_URL, skip_ws=True)  # read-only

# Get vault details
vault_details = info.post("/info", {"type": "vaultDetails",
                                    "vaultAddress": vault_address})

print(f"Vault Name: {vault_details['name']}")
print(f"Leader: {vault_details['leader']}")
print(f"Leader fraction: {vault_details['leaderFraction']}")
print(f"Allow deposits: {vault_details['allowDeposits']}")
print(f"APR: {vault_details['apr']}")

# Get vault equity and positions
vault_state = info.user_state(vault_address)
print(f"Account value: ${vault_state['marginSummary']['accountValue']}")
for pos in vault_state["assetPositions"]:
    p = pos["position"]
    print(f"  {p['coin']}: {p['szi']} @ {p['entryPx']}")

Withdrawals

Depositors can withdraw once the lockup has passed: 1 day after the most recent deposit for user vaults, 4 days for HLP (depositor docs).

# Testnet only. Withdraw 500 USDC (usd is an integer in micro-USDC)
exchange.vault_usd_transfer(vault_address, False, 500_000_000)

Important Considerations

  1. Withdrawal Impact — If there is not enough free margin, open orders using margin are canceled first; if that is still not enough, 20% of positions are closed repeatedly until the withdrawal can be paid (vault leader docs)
  2. Lockup Periods — Fixed by the protocol (1 day for user vaults, 4 days for HLP), not chosen by the leader
  3. No Withdrawal Fee — The only fee is the leader's 10% profit share on gains
  4. Proportional Close Option — Leaders can set the vault to always close positions proportionally on withdrawals, keeping liquidation prices similar
  5. Leader Minimum — The leader cannot withdraw if it would drop their share below 5%

Profit Distribution

Profits are distributed through the share price mechanism:

The docs give an example: deposit 100 USDC into a 900 USDC vault (10%); the vault grows to 2,000 USDC; withdrawing yields 200 USDC minus a 10 USDC profit share (10% of the 100 USDC gain), so 190 USDC, before any slippage from closing positions.

Fee Calculation

Depositor Profit = (Exit Share Price - Entry Share Price) * Shares
Leader Fee = Depositor Profit * Profit Share Rate
Net Depositor Profit = Depositor Profit - Leader Fee

Monitoring Vault Performance

Key metrics to track: