Skip to content本文へ移動

Vault Development · Vault Fundamentals · 2/7

Creating a Vault

Vault Creation via the UI

Vaults are created through the Hyperliquid web interface:

  1. Navigate to the Vaults section
  2. Click "Create Vault"
  3. Enter a name and description (these cannot be changed later)
  4. Deposit at least 100 USDC as the vault leader

As of October 2026, creating a vault also costs a 10,000 USDC fee, and the leader must keep at least 5% of the vault at all times (vault leader docs). Check the docs for the current numbers before you start.

What About the API?

The official Python SDK (hyperliquid-python-sdk) has no vault-creation helper, and the public exchange endpoint docs do not document a vault-creation action. Treat creation as a one-time UI step; everything after that (deposits, trading, monitoring) can be done through the API.

Vault Address

Every vault gets a unique address (similar to a wallet address). This address:

A vault has no private key. Actions for the vault are signed by the leader (or the leader's API wallet) with the vaultAddress field set to the vault (exchange endpoint docs).

Depositing More as the Leader

The leader's first deposit happens during creation. Later deposits and withdrawals use a vault transfer. The usd amount is an integer in micro-USDC (1 USDC = 1,000,000):

# Testnet only — never hard-code real keys
import eth_account
from hyperliquid.exchange import Exchange
from hyperliquid.utils import constants

leader = eth_account.Account.from_key("<TESTNET_LEADER_KEY>")
exchange = Exchange(leader, base_url=constants.TESTNET_API_URL)

vault_address = "0xYourVaultAddress"
exchange.vault_usd_transfer(vault_address, True, 1_000_000_000)  # deposit 1,000 USDC

Delegate Trading with an API Wallet

Instead of using the vault leader's wallet directly for every trade, the leader approves an API wallet (also called an agent wallet) — a separate key that can sign trading actions. The SDK generates the agent key for you:

# The leader (master account) approves a new API wallet.
# Do not call this from an agent — agents cannot approve agents.
approve_result, agent_key = exchange.approve_agent("keeper")

The approved agent can then trade for the vault by creating an Exchange with vault_address set:

# Testnet only — the agent key should live only on the keeper server
agent_wallet = eth_account.Account.from_key(agent_key)
vault_exchange = Exchange(agent_wallet, constants.TESTNET_API_URL,
                          vault_address=vault_address)

# Every action from vault_exchange is signed with vaultAddress = vault_address
result = vault_exchange.order("BTC", True, 0.01, 90000.0,
                              {"limit": {"tif": "Gtc"}})

Why Use API Wallets?

If the agent key is compromised, the attacker can trade but cannot transfer or withdraw funds. Bad trades can still lose the vault's entire equity, so treat the agent key as sensitive. Do not reuse an agent address after deregistering it: its nonce state may be pruned, which can let old signed actions be replayed.

vault 開発 · vault の基礎 · 2/7

vault を作る

UI から vault を作る

vault は Hyperliquid のウェブ画面から作ります。

  1. Vaults の画面を開きます
  2. 「Create Vault」を押します
  3. 名前と説明を入れます(後から変えられません)
  4. vault のリーダーとして 100 USDC 以上を入れます

2026年10月時点では、vault を作るのに 10,000 USDC の手数料もかかります。また、リーダーは常に vault の5%以上を持っていなければなりません(vault リーダー向けの資料)。始める前に、資料で今の数字を確かめてください。

API では作れないのか

公式の Python SDK(hyperliquid-python-sdk)には、vault を作る関数がありません。公開されている exchange エンドポイントの資料にも、vault を作るアクションは載っていません。作るのは UI での1回きりの作業と考えてください。その後のこと(入金、売買、監視)は、すべて API でできます。

vault のアドレス

vault には、それぞれ固有のアドレスがあります(ウォレットのアドレスと同じようなものです)。このアドレスは次の役目を持ちます。

vault には秘密鍵がありません。vault の操作は、リーダー(またはリーダーの API ウォレット)が署名します。そのとき vaultAddress の欄に vault を指定します(exchange エンドポイントの資料)。

リーダーが追加で入金する

リーダーの最初の入金は、作るときに行います。その後の入金と引き出しには、vault への振替を使います。usd の額は micro-USDC 単位の整数です(1 USDC = 1,000,000)。

# Testnet only — never hard-code real keys
import eth_account
from hyperliquid.exchange import Exchange
from hyperliquid.utils import constants

leader = eth_account.Account.from_key("<TESTNET_LEADER_KEY>")
exchange = Exchange(leader, base_url=constants.TESTNET_API_URL)

vault_address = "0xYourVaultAddress"
exchange.vault_usd_transfer(vault_address, True, 1_000_000_000)  # deposit 1,000 USDC

API ウォレットに売買を任せる

売買のたびに vault リーダーのウォレットをそのまま使うのはやめましょう。代わりに、リーダーは API ウォレット(agent ウォレットとも呼びます)を承認します。売買の操作に署名できる、別の鍵です。agent の鍵は SDK が作ってくれます。

# The leader (master account) approves a new API wallet.
# Do not call this from an agent — agents cannot approve agents.
approve_result, agent_key = exchange.approve_agent("keeper")

承認された agent は、vault_address を指定した Exchange を作れば、vault のために売買できます。

# Testnet only — the agent key should live only on the keeper server
agent_wallet = eth_account.Account.from_key(agent_key)
vault_exchange = Exchange(agent_wallet, constants.TESTNET_API_URL,
                          vault_address=vault_address)

# Every action from vault_exchange is signed with vaultAddress = vault_address
result = vault_exchange.order("BTC", True, 0.01, 90000.0,
                              {"limit": {"tif": "Gtc"}})

なぜ API ウォレットを使うのか

agent の鍵が漏れても、攻撃者にできるのは売買だけです。資金の移動や引き出しはできません。それでも、ひどい売買で vault の資産をすべて失うことはあり得ます。agent の鍵は大切に扱ってください。登録を外した agent のアドレスは、使い回さないでください。nonce の記録が消されていることがあり、過去に署名した操作を再送されるおそれがあります。