This script initializes a Jito Vault Program through the Squads multisig SDK. It sets up the vault configuration and performs the initialization process.
- Node.js (v18 or later recommended)
- npm or yarn
-
Clone the repository:
git clone https://github.com/your-username/squads-jito-vault-init.git cd squads-jito-vault-init
-
Install dependencies:
yarn install
Before running the script, make sure to:
- Replace the relevant vault args in
src/index.ts
:
DEPOSIT_FEE_BPS
WITHDRAWAL_FEE_BPS
REWARD_FEE_BPS
DECIMALS
Run the script using:
yarn start -- [options]
The script will:
- Set up a Squads multisig
- Create and execute a transaction to initialize the Jito Vault config
- Create and execute a transaction to initialize the Jito Vault
The script accepts the following command-line arguments:
--restaking-program-id <id>
: Restaking Program ID (required)--vault-program-id <id>
: Vault Program ID (required)--multisig-address <address>
: Multisig Address (optional)--mint <address>
: Mint Address (optional)--rpc-url <url>
: RPC URL (default: https://api.devnet.solana.com)
Example:
yarn start --
--restaking-program-id ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnop \
--vault-program-id QRSTUVWXYZabcdefghijklmnopABCDEFGHIJKLMNOP \
--multisig-address 3Jq8ikZhdNtZc5NY3utNrevLRRvg5j2ADz7wLxjaPt5s \
--mint So11111111111111111111111111111111111111112 \
--rpc-url https://api.devnet.solana.com \
--wallet-path /path/to/your/wallet.json \
If --multisig-address
is not provided, the script will create a new multisig.
If --mint
is not provided, the script will create a new mint.
The script will:
- Set up a Squads multisig (if not provided)
- Create and execute a transaction to initialize the Jito Vault config
- Create and execute a transaction to initialize the Jito Vault
- Create and approve proposals for the transactions
- Execute the approved transactions
yarn build
: Compile TypeScript to JavaScriptyarn dev
: Run the script in development mode with hot reloadingyarn lint
: Lint the source code
The script uses the following configuration parameters:
mintDecimals
: Set to 9 by default. Adjust this in the script if needed.- Fees (in basis points):
depositFeeBps
: 200 (2%)withdrawalFeeBps
: 200 (2%)rewardFeeBps
: 200 (2%)
To modify these parameters, edit the values in the main
function of src/index.ts
.
npm run build
oryarn build
: Compile TypeScript to JavaScriptnpm run dev
oryarn dev
: Run the script in development mode with hot reloadingnpm run lint
oryarn lint
: Lint the source code
https://github.com/jito-foundation/restaking/blob/master/vault_program/src/initialize_vault.rs
https://github.com/jito-foundation/restaking/tree/ddcb69ff9400bdbd716bbab64508c87dc5512494/vault_sdk
This script is provided as-is, without any warranties or guarantees of any kind. The authors and contributors of this script take no responsibility for its use or any consequences that may arise from its execution. Users should exercise caution and thoroughly review the script before running it, especially when dealing with cryptocurrencies or blockchain transactions. Use this script at your own risk.