You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/glossary.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ In 90% LTV Vaults, the process of closing an unhealthy osToken position that exc
55
55
### LTV (Loan-to-Value)
56
56
The ratio of minted osToken value to staked collateral value, expressed as a percentage. Standard Vaults have 90% LTV, while DAO-approved Vaults can have up to 99.99% LTV (osETH) or 99.95% LTV (osGNO). This determines the maximum amount of osToken that can be minted against staked assets.
57
57
58
-
### Meta Vault
58
+
### MetaVault
59
59
A Vault type that does not register validators directly, instead delegating accumulated assets to sub-Vaults managed by the Vault Admin. Deposits are distributed across underlying sub-Vaults (up to 50 maximum) according to curator-defined allocation logic.
Copy file name to clipboardExpand all lines: docs/docs/vaults/vault-types.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,10 +39,10 @@ A MetaVault is a specialized Vault that doesn't run validators itself. Instead,
39
39
40
40
### Use Cases
41
41
42
-
[Anyone can deploy a MetaVault permissionlessly](https://blog.stakewise.io/productUpdate/meta-vaults-in-different-flavors-now-open-to-everyone) through the [`EthMetaVaultFactory` ↗](https://etherscan.io/address/0x6107dB0bdd84023228E0aB11099190E88B073c1D#code) contract. Two common setups:
42
+
Any third party can deploy a MetaVault permissionlessly, which opens up modular, layered staking strategies:
43
43
44
-
-**Node operator diversification.** A Vault operator runs one MetaVault on top of several sub-vaults, spreading stake to simplify management and reduce single-operator risk.
45
-
-**Institutional setups.** A top-level MetaVault routes deposits into client-specific MetaVaults — each with its own fee and branding — while a single validator fleet sits underneath them all.
44
+
-[Diversified staking ↗](https://blog.stakewise.io/guide/diversified-staking-with-metavaults) — spread stake across multiple operators through a single MetaVault, reducing single-operator exposure, optimizing fees, and giving you one place to deposit, withdraw, and manage your osETH position.
45
+
-[Dedicated MetaVaults for clients ↗](https://blog.stakewise.io/guide/setting-up-per-client-metavaults) — create a separate MetaVault for each client while routing all deposits into a shared Regular Vault. This keeps client funds isolated, supports per-client fees, delivers higher and more stable APY, and simplifies operations by managing a single validator fleet.
description: Use the StakeWise SDK addSubVault method to add a sub-vault to a StakeWise V3 meta vault registry on Mainnet, Hoodi, or Gnosis. Called by the meta vault curator to extend the registry of underlying vaults receiving routed deposits.
5
+
---
6
+
7
+
#### Description:
8
+
9
+
Adds a new sub-vault to a meta vault's registry. Called by the meta vault admin (curator).
10
+
11
+
#### Prerequisites before calling addSubVault
12
+
13
+
The contract reverts if the sub-vault is unreachable for the meta vault. Pre-check on the frontend so the user gets an informative error instead of a generic revert:
14
+
15
+
- If the sub-vault is **private** (`isPrivate: true` from `sdk.vault.getVault`), the meta vault address must be in the sub-vault's whitelist. Read the whitelist with `sdk.vault.getWhitelist({ vaultAddress: subVaultAddress })` and skip or warn the user if the meta vault is not present.
16
+
- If the sub-vault has a **blocklist** (`isBlocklist: true`), the meta vault address must not be on the blocklist. Read it with `sdk.vault.getBlocklist({ vaultAddress: subVaultAddress })`.
17
+
- The sub-vault itself must not be a meta vault (`isMetaVault: false`). Nesting meta vaults is not supported.
18
+
- The sub-vault should not already be in the meta vault's registry. Check the current list with `sdk.vault.getSubVaults({ vaultAddress })`.
@@ -6,29 +6,38 @@ description: Use the StakeWise SDK createVault method to deploy a new staking va
6
6
7
7
#### Description:
8
8
9
-
Create a vault. When the transaction is executed, one gwei of the deposit token must be stored in the vault to avoid [inflation attack](https://blog.openzeppelin.com/a-novel-defense-against-erc4626-inflation-attacks).
10
-
Pay attention to chains where the deposit token is not a native token such as Gnosis.
11
-
On these chains before creating the vault, ensure that you call the `approve` function on the deposit token contract,
12
-
allowing the vault factory address to spend one gwei.
13
-
You can retrieve the vault factory contract using the helper function: `sdk.getVaultFactory({ vaultType: params.type, isErc20: params.isErc20 })`.
9
+
How to deploy a StakeWise V3 vault: call `sdk.vault.create({ userAddress, type, ... })` on a write-capable SDK (browser wallet or backend signer). The simplest case is `VaultType.Default` with no `vaultToken`, no `capacity`, no `keysManagerFee` - the SDK applies sensible defaults and the returned hash points at a fully working open vault.
10
+
11
+
The optional `vaultToken: { name, symbol }` argument toggles between an **ERC20 vault** (vault mints a transferable share token) and a **non-ERC20 vault** (shares tracked internally). The `type` argument selects `Default`, `Private`, `Blocklist`, `MetaVault`, or `PrivateMetaVault` access. Regular vault types combine with the ERC20 toggle into six factories; meta vault types add their own factories. The SDK picks the right factory automatically.
12
+
13
+
When the transaction is executed, one gwei of the deposit token must be stored in the vault to avoid [inflation attack](https://blog.openzeppelin.com/a-novel-defense-against-erc4626-inflation-attacks).
14
+
On Mainnet and Hoodi the deposit token is the native asset (ETH) and the SDK attaches the 1 gwei automatically.
15
+
On Gnosis the deposit token is GNO, so before calling `sdk.vault.create` you must call `approve` on GNO to allow the vault factory to spend 1 gwei. Retrieve the factory address with `sdk.vault.getVaultFactory({ vaultType: params.type, isErc20: Boolean(params.vaultToken) })`.
16
+
17
+
**Important**: When creating a meta vault on Gnosis, only `VaultType.MetaVault` is supported (open access). `VaultType.PrivateMetaVault` is Mainnet and Hoodi only. ERC20 share tokens (`vaultToken`) are not available for meta vaults on Gnosis. All meta vaults reject the `isOwnMevEscrow` parameter on every chain.
| userAddress |`string`|**Yes**| The address of the user initiating the action. This address will become the vault admin |
20
-
| type |`VaultType`|**No**|Allowed vault types: Default, Private and Blocklist. Available vault types can be found in the `enum VaultType` which you can be imported from the library|
21
-
| vaultToken |`{ name: string, symbol: string }`|**No**| If provided, the vault will be created with its own ERC20 token |
22
-
| capacity |`bigint`|**No**| If provided, should be defined in gwei. By default, capacity is `MaxUint256`; the minimum allowed capacity is `parseEther('32')`|
23
-
| keysManagerFee |`number`|**No**| If provided, should be between `0` and `100`, inclusive with a maximum of two decimal digits allowed (e.g., `15.35`). By default, the fee is `0`|
24
-
| isOwnMevEscrow |`boolean`|**No**| Defines whether to send block rewards to the Smoothing Pool (`false`) or keep them only to your Vault (`true`). By default, this value is `false`|
25
-
| image |`string`|**No**| The vault image in base64 string format (will be uploaded to IPFS; maximum size is 1 MB)|
26
-
| displayName |`string`|**No**| The vault display name (will be uploaded to IPFS; maximum size is 30 characters)|
27
-
| description |`string`|**No**| The vault description (will be uploaded to IPFS; maximum size is 1000 characters)|
28
-
29
-
#### Example:
25
+
| userAddress |`string`|**Yes**| The address of the user initiating the action. This address will become the vault admin |
26
+
| type |`VaultType`|**No**|One of: `Default`, `Private`, `Blocklist`, `MetaVault`, `PrivateMetaVault`. Imported from the library: `import { VaultType } from '@stakewise/v3-sdk'`. Use `MetaVault` / `PrivateMetaVault` to deploy a meta vault that holds a registry of sub-vaults; `PrivateMetaVault` is Mainnet/Hoodi only.|
27
+
| vaultToken |`{ name: string, symbol: string }`|**No**| If provided, the vault will be created with its own ERC20 token |
28
+
| capacity |`bigint`|**No**| If provided, should be defined in gwei. By default, capacity is `MaxUint256`; the minimum allowed capacity is `parseEther('32')`|
29
+
| keysManagerFee |`number`|**No**| If provided, should be between `0` and `100`, inclusive with a maximum of two decimal digits allowed (e.g., `15.35`). By default, the fee is `0`|
30
+
| isOwnMevEscrow |`boolean`|**No**| Defines whether to send block rewards to the Smoothing Pool (`false`) or keep them only to your Vault (`true`). By default, this value is `false`. **Note**: This parameter is not supported for metavaults|
31
+
| image |`string`|**No**| The vault image in base64 string format (will be uploaded to IPFS; maximum size is 1 MB)|
32
+
| displayName |`string`|**No**| The vault display name (will be uploaded to IPFS; maximum size is 30 characters)|
33
+
| description |`string`|**No**| The vault description (will be uploaded to IPFS; maximum size is 1000 characters)|
34
+
35
+
#### Example: ERC20 vault on Mainnet
30
36
31
37
```ts
38
+
import { MaxUint256 } from'ethers'
39
+
import { VaultType } from'@stakewise/v3-sdk'
40
+
32
41
const params = {
33
42
userAddress: '0x...',
34
43
type: VaultType.Default,
@@ -44,11 +53,127 @@ const params = {
44
53
description: 'Example description',
45
54
}
46
55
47
-
// Transaction example
48
-
// Send transaction to create a vault
56
+
// Send transaction
49
57
const hash =awaitsdk.vault.create(params)
58
+
59
+
// Wait for the transaction to be confirmed and indexed
60
+
awaitsdk.provider.waitForTransaction(hash)
61
+
awaitsdk.utils.waitForSubgraph({ hash })
62
+
50
63
// When you sign transactions on the backend (for custodians)
51
-
const { data, to, value } =awaitsdk.vault.deposit.encode(params)
64
+
const { data, to, value } =awaitsdk.vault.create.encode(params)
52
65
// Get an approximate gas per transaction
53
-
const gas =awaitsdk.vault.deposit.estimateGas(params)
66
+
const gas =awaitsdk.vault.create.estimateGas(params)
67
+
```
68
+
69
+
#### Example: non-ERC20 Private vault
70
+
71
+
Omit `vaultToken` to deploy a non-ERC20 vault and switch `type` to restrict access:
72
+
73
+
```ts
74
+
import { VaultType } from'@stakewise/v3-sdk'
75
+
76
+
const hash =awaitsdk.vault.create({
77
+
userAddress: '0x...',
78
+
type: VaultType.Private,
79
+
isOwnMevEscrow: false,
80
+
keysManagerFee: 5,
81
+
displayName: 'Private vault',
82
+
})
83
+
84
+
// Wait for the transaction to be confirmed and indexed
85
+
awaitsdk.provider.waitForTransaction(hash)
86
+
awaitsdk.utils.waitForSubgraph({ hash })
87
+
```
88
+
89
+
#### Example: ERC20 vault on Gnosis (with GNO approve)
90
+
91
+
On Gnosis the 1 gwei security deposit is GNO, not native xDAI. Approve the vault factory before `sdk.vault.create`:
// Wait for the transaction to be confirmed and indexed
122
+
awaitsdk.provider.waitForTransaction(hash)
123
+
awaitsdk.utils.waitForSubgraph({ hash })
124
+
```
125
+
126
+
#### Example: meta vault on Gnosis
127
+
128
+
On Gnosis a meta vault uses `VaultType.MetaVault` (open) - `PrivateMetaVault` is not supported. Meta vaults do not accept `vaultToken` (no ERC20 share token on Gnosis meta vaults) and never accept `isOwnMevEscrow`. The sub-vaults underneath the meta vault keep their own MEV configuration.
// Wait for the transaction to be confirmed and indexed
156
+
awaitsdk.provider.waitForTransaction(hash)
157
+
awaitsdk.utils.waitForSubgraph({ hash })
158
+
```
159
+
160
+
After deploying the meta vault, the curator (the `userAddress` above) populates its registry by calling `sdk.vault.addSubVault({ vaultAddress: metaVaultAddress, subVaultAddress, userAddress })` for each sub-vault.
161
+
162
+
#### Example: private meta vault on Mainnet
163
+
164
+
On Mainnet and Hoodi, `VaultType.PrivateMetaVault` is supported. Mainnet does not require an approve step (the 1 gwei security deposit is native ETH and the SDK attaches it automatically):
165
+
166
+
```ts
167
+
import { VaultType } from'@stakewise/v3-sdk'
168
+
169
+
const hash =awaitsdk.vault.create({
170
+
userAddress: '0x...',
171
+
type: VaultType.PrivateMetaVault,
172
+
keysManagerFee: 5,
173
+
displayName: 'Private Meta Vault',
174
+
})
175
+
176
+
// Wait for the transaction to be confirmed and indexed
description: Use the StakeWise SDK ejectSubVault method to remove an active sub-vault from a StakeWise V3 meta vault registry. Called by the meta vault curator to drop an in-use sub-vault from the registry.
0 commit comments