Velocity ProtocolDevelopers
Vault Managers

Quickstart: Create and Run a Vault

This walks through creating a vault, updating its parameters, onboarding depositors, and handling day-to-day manager operations via the vaults-sdk CLI. For a conceptual overview of roles and fee constraints, see Vault Managers.

Decide vault parameters

ParameterDescription
market-index / spotMarketIndexSpot market index of the deposit token. Read the live spot market accounts to map an index to a token.
redeem-periodWithdrawal cooldown in seconds (often three to seven days; the CLI default is 604,800 seconds, seven days).
max-tokensCapacity / risk control.
management-feeAnnualized management fee.
profit-sharePerformance fee on realized gains.
permissioned + min-deposit-amountOptional onboarding controls.

Initialize the vault

Vault initialization is permissionless. From the @velocity-exchange/vaults-sdk CLI (packages/vaults-sdk in the velocity-v1 monorepo):

The velocity-v1 monorepo is not public yet. It will be published once the post-fork audit report is final. Until then, ask the team for access to run these commands.

git clone <velocity-v1>
cd velocity-v1
bun install                       # once, at the repo root
cd packages/vaults-sdk

bun run cli -- init-vault \
  --name "MyVault" \
  --market-index 0 \
  --redeem-period 604800 \
  --max-tokens 0 \
  --management-fee 2 \
  --profit-share 20

--management-fee/--profit-share take a plain percentage number (2 = 2%, not basis points): the CLI scales it against the onchain PERCENTAGE_PRECISION (1e6 = 100%), and initialize_vault rejects any value ≥ 100%.

The CLI reads -u/--url (or RPC_URL) and -k/--keypair (or KEYPAIR_PATH) for the RPC endpoint and signer; --env selects devnet or mainnet-beta (default mainnet-beta).

Add --permissioned and --min-deposit-amount <amount> for whitelisted depositors and a minimum deposit size. Vault name must be unique.

Update parameters and enable trading

After creation the manager can lower fees, shorten the redeem period, or adjust caps immediately (within the one-way constraints described in Vault Managers):

bun run cli -- manager-update-vault \
  --vault-address <VAULT_ADDRESS> \
  --redeem-period 1000 \
  --max-tokens 200000 \
  --management-fee 0 \
  --profit-share 0

To raise the management fee or profit share, or lower the hurdle rate, queue the change instead. It takes effect only after a timelock of at least max(7 days, 2x redeem period):

bun run cli -- admin-init-fee-update \
  --vault-address <VAULT_ADDRESS>

bun run cli -- manager-update-fees \
  --vault-address <VAULT_ADDRESS> \
  --management-fee 3 \
  --timelock-duration 604800

admin-init-fee-update creates the FeeUpdate account the queue is stored in (an admin action); manager-update-fees then queues the new fee, and calling it again after the timelock matures installs it. To cancel, the CLI exposes only admin-delete-fee-update, which closes the account entirely. The manager can withdraw a queued update without an admin, but only through the SDK's managerCancelFeeUpdate; there is no CLI command for it.

To enable margin trading on the vault:

bun run cli -- manager-update-margin-trading-enabled \
  --vault-address <VAULT_ADDRESS> \
  --enabled true

View vault state anytime:

bun run cli -- view-vault --vault-address <VAULT_ADDRESS>

Permissioned vaults (allowing depositors)

For permissioned vaults, the manager must initialize each depositor:

bun run cli -- init-vault-depositor \
  --vault-address <VAULT_ADDRESS> \
  --deposit-authority <AUTHORITY_TO_ALLOW_DEPOSIT>

Deposits and withdrawals are otherwise as in the standard flow: request withdrawal → wait redeem period → complete withdrawal.

Manager operations

Common manager actions:

  • Manager deposit and withdraw: manager-deposit, manager-request-withdraw, manager-withdraw, manager-cancel-withdraw
  • Apply profit share: manager-apply-profit-share for one depositor, apply-profit-share-all for every depositor
  • View state: view-vault, view-vault-depositor, list-vault-depositors
  • Change the trading delegate or the manager: manager-update-delegate, manager-update-vault-manager

Run bun run cli -- --help from packages/vaults-sdk for the full command list and flags. The SDK-level equivalents, plus borrow/repay, rebases, the queued fee update, and the vault's own insurance-fund stake, are in Manager operations.

Next steps

  • Want the full manager surface beyond the CLI basics? See Manager operations.
  • Need manager borrowing or margin beyond the base vault? See Trusted vaults.
  • Want a multisig (e.g. Squads) as vault manager instead of a single keypair? See Multisig manager.
  • Building a depositor-facing app on top of the vault? See Vault Depositors.