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
- Vault has $10,000 equity, 10,000 shares outstanding
- Share price = $1.00
- User deposits $1,000 → receives 1,000 shares
- Vault now has $11,000 equity, 11,000 shares
If the vault makes a 10% profit:
- Vault equity = $12,100
- Share price = $12,100 / 11,000 = $1.10
- User's 1,000 shares = $1,100 (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
- 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)
- Lockup Periods — Fixed by the protocol (1 day for user vaults, 4 days for HLP), not chosen by the leader
- No Withdrawal Fee — The only fee is the leader's 10% profit share on gains
- Proportional Close Option — Leaders can set the vault to always close positions proportionally on withdrawals, keeping liquidation prices similar
- Leader Minimum — The leader cannot withdraw if it would drop their share below 5%
Profit Distribution
Profits are distributed through the share price mechanism:
- When the vault profits, share price increases
- When a depositor withdraws gains, the leader's 10% profit share is taken from that profit (protocol vaults such as HLP charge none)
- Depositors keep the remaining profit
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:
- Equity Curve — Total vault equity over time
- Share Price — Tracks performance net of all fees
- Drawdown — Maximum peak-to-trough decline
- Depositor Count — Growth indicator
- APR — Annualized return based on past performance (not a promise of future returns)