Vaults

An overview of the Vault component.

Overview

The Vault Account:

  • Serves as the repository for supported token and VRT (Vault Receipt Token).
  • Tracks the state of tokens deposits, withdrawals, and delegate assets.
  • Manages a set of administrative roles, responsible for different aspects of vault operations.

Key functionalities include:

  • Token Management: Handles deposits, withdrawals, and minting/burning of VRT tokens with fee calculations and slippage protection.
  • Fee Management: Supports dynamic fee adjustments (deposit, withdrawal, reward) with built-in validation and limits.
  • Delegation Management: Tracks and manages the delegation of assets to operators, ensuring sufficient reserves for withdrawals.
  • State Tracking: Maintains a detailed record of vault activity, including cooldowns, ready-to-claim amounts, and delegation states.
  • Administrative Role Management: Assigns and verifies various admin roles (e.g., delegation admin, fee admin) for secure and efficient operations.

Key Components

1. Vault Structure

General Information

FieldTypeDescription
basePubkeyThe base account used as a PDA seed.

Token Information and Accounting

FieldTypeDescription
vrt_mintPubkeyThe pubkey of VRT's mint account.
supported_mintPubkeyThe pubkey of supported_mint's mint account.
vrt_supplyu64The total number of VRT in circulation.
tokens_depositedu64The total number of tokens deposited.
deposit_capacityu64The total number of tokens deposited.
delegation_stateDelegationStateRolled-up stake state for all operators in the set.
additional_asssets_need_unstakingu64The amount of additional assets that need unstaking to fulfill VRT withdrawals.
vrt_enqueued_for_cooldown_amountu64The amount of VRT tokens in VaultStakerWithdrawalTickets enqueued for cooldown.
additional_asssets_need_unstakingu64The amount of VRT tokens cooling down.
vrt_ready_to_claim_amountu64The amount of VRT tokens ready to claim.

Admins

FieldTypeDescription
adminPubkeyVault admin.
delegation_adminPubkeyThe delegation admin responsible for adding and removing delegations from operators.
operator_adminPubkeyThe operator admin responsible for adding and removing operators.
ncn_adminPubkeyThe node consensus network admin responsible for adding and removing support for NCNs.
slasher_adminPubkeyThe admin responsible for adding and removing slashers.
capacity_adminPubkeyThe admin responsible for setting the capacity.
fee_adminPubkeyThe admin responsible for setting the fees.
delegate_asset_adminPubkeyThe delegate_admin responsible for delegating assets.
fee_walletPubkeyFee wallet account.
mint_burn_adminPubkeyOptional mint signer.
metadata_adminPubkeyAuthority to update the vault's metadata.

Indexing and Counters

FieldTypeDescription
vault_indexu64The index of the vault in the vault list.
ncn_countu64Number of VaultNcnTicket accounts tracked by this vault.
operator_countu64Number of VaultOperatorDelegation accounts tracked by this vault.
slasher_countu64Number of VaultNcnSlasherTicket accounts tracked by this vault.
last_fee_change_slotu64The slot of the last fee change.
last_full_state_update_slotu64The slot of the last time the delegations were updated.
deposit_fee_bpsu16The deposit fee in basis points.
withdrawal_fee_bpsu16The withdrawal fee in basis points.
next_withdrawal_fee_bpsu16The next epoch's withdrawal fee in basis points.
reward_fee_bpsu16Fee for each epoch.
program_fee_bpsu16The program fee in basis points.
is_pausedboolPause flag.

Vault's PDA

use jito_restaking_core::operator::Operator;

let program_id = jito_restaking_program::id();
let base_pubkey = pubkey!("base pubkey here");
let vault_pubkey = Vault::find_program_address(&program_id, &base_pubkey).0;