For the complete documentation index, see llms.txt. This page is also available as Markdown.

Deploying a Vault

A vault is created in a single transaction against the Vault Deployer for the asset you want to hold. The deployer pulls your initial deposit and mints shares to your wallet in the same call.

Pick the right deployer

One deployer per asset:

Read the current minimum initial deposit

Before deploying, read the minimum initial deposit from the deployer — it's configured per asset and can change, so read it on-chain rather than hard-coding.

const deployerAbi = [
  {type: 'function', stateMutability: 'view', name: 'minInitialDeposit',
   inputs: [], outputs: [{type: 'uint256'}]},
] as const

const minDeposit = await client.readContract({
  address: deployer, abi: deployerAbi, functionName: 'minInitialDeposit',
})

Approve the initial deposit

The deployer needs to be able to pull initialDeposit of the underlying asset from your wallet:

If the underlying token supports EIP‑2612 permit (USDC does), you can skip the separate approval transaction by using deployVaultWithPermit instead — see below.

Call deployVault

maxManagementFee and maxPerformanceFee are slippage guards — the transaction reverts if the deployer's currently configured fees exceed them. Use the agreed contractual values so an accidental on-chain fee bump can't deploy a vault with fees higher than what you signed up for.

Extract the vault address

The deployer emits a VaultDeployed event. Parse it from the receipt:

Save plasmaVault (the vault address you'll interact with for deposits / withdrawals) and withdrawManager (per-vault manager for scheduled withdrawals). Both are also discoverable later via the Public API.

Using permit (one transaction)

For underlying tokens that support EIP‑2612, you can skip the separate approval and deploy in a single transaction:


Once your vault exists, continue to Strategy Assignment to start managing it, or Deposits if you want to add more capital first.

Last updated

Was this helpful?