-
Notifications
You must be signed in to change notification settings - Fork 21
Initialize A Vault
wphan edited this page Oct 20, 2023
·
3 revisions
Vaults initialization are fully permissionless, so anyone can setup their own vault with desired configuration.
A cli utility is provided to aid in the creation of vaults.
git clone git@github.com:drift-labs/drift-vaults.git
cd ts/sdk
yarn
yarn cli --help
To initialize a new vault:
yarn cli init-vault \
--name "test vault" \
--market-index 1 \
--redeem-period 3600 \
--max-tokens 10000 \
--management-fee 2 \
--profit-share 20 \
--permissioned \
--min-deposit-amount 1 \
--url <your RPC url> \
--keypair ~/.config/solana/keypair.json
This example creates a new vault that takes SOL (spot market index 1, list of spot markets here), with a redeem-period of 3600 seconds, max vault capacity of 10000 SOL, 2% management fee, 20% profit share fee, is permissioned (whitelist required), and has a min deposit of 1 SOL. (note that vault name must be unique)
To update params:
yarn cli manager-update-vault \
--vault-address <vault_address> \
--redeem-period 1000 \
--max-tokens 200000 \
--management-fee 0 \
--profit-share 0 \
--url <your RPC url> \
--keypair ~/.config/solana/keypair.json
View the vault details:
yarn cli view-vault --vault-address=<vault_address>
For permissioned vaults, allow a <new_address>
via:
yarn cli init-vault-depositor --vault-address=<vault_address> --deposit-authority=<new_address>