Create vault

Vault creation

Vault creation with the guard (f.e. Deposit lock)

The 'deploySmartVault' function allows the deployment of a new SmartVault using specified configuration.

Before utilizing the 'deploySmartVault' function, ensure that you have access to a Signer or Fireblocks provider capable of signing transactions. The 'deploySmartVault' function requires a 'SmartVaultSpecification' parameter, which defines the desired configuration for the new SmartVault.

const createVault = async () => {
  const smartVaultSpecification: SmartVaultSpecificationStruct = {
    smartVaultName: 'SDK TEST VAULT',
    svtSymbol: 'SDKT',
    baseURI: 'https://token-cdn-domain/',
    assetGroupId: asset_group_id,
    strategies: [
      'strategy_adddress1',
      'strategy_address2',
      .
      .
      .
],
  strategyAllocation: 0,
    riskTolerance: 10,
    riskProvider: "risk_provider",
    allocationProvider: "alloc_provider",
    actions: [],
    actionRequestTypes: [],
    guards: [],
    guardRequestTypes: [],
    managementFeePct: management_fee_pct,
    depositFeePct: deposit_fee_pct,
    performanceFeePct: performance_fee_pct,
    allowRedeemFor: true,
};

  const transaction = await yelaySDK.deploySmartVault(smartVaultSpecification);
  const txResponse = await transaction.wait();
  console.log(txResponse);
}

Key parameters:

Strategy allocation via Allocation provider (agent): Allocation provider is a smart contract that calculates strategy allocations based on input parameters like Risk Scores and APYs.

During the Smart Vault creation process, the Vault Creator chooses which Allocation Provider they wish to use, tailoring the asset distribution to their preferences and risk tolerance.

Yelay offers the following Allocation Providers:

  1. Linear: allocates capital linearly between different strategies, providing a balanced distribution based on the strategies' risk scores and APYs.

  2. Exponential: allocates capital exponentially between different strategies, favoring strategies with higher APYs and lower risk scores, if higher risk appetite is selected.

  3. Equal: all strategies in the vault are allocated according to the same weight, ensuring an even distribution of assets across the selected strategies.

Parameters:

  • strategyAllocation: Set to '0' if strategies are allocated using allocationProvider and not allocated manually.

  • riskTolerance: Parameter that dictates allocation of user's assets across strategies. Minimum value is -10, maximum is 10. The maximum will prioritise allocation to higher-APY strategies ignoring risk. The minimum will prioritise allocation to higher-APY strategies, giving higher weights to the risk.

  • riskProvider: Address of a risk provider used by the smart vault. Use 'spoolLabs' addresses by default.

    • The contract addresses for the risk providers on mainnet:

      • "spoolLabs": "0xC216aD6280f4fa92A5159EF383a1206D432481c8",

      • "DeFi": "0x9098c4936138536849d7ee6447777626ea202bd1"

    • The contract addresses for the risk providers on Sepolia:

      • "spoolLabs": "0x2f75193EbeF14541266696Cd87dD84fF90c02B5C"

    • Alternatively, use listRiskProviders method to list and select a risk provider.

    • In case of fixed strategy allocation this parameter can be empty.

  • allocationProvider - Address of an allocation provider used by the smart vault. In case of fixed strategy allocation this parameter can be empty.

    • The contract addresses for the allocation providers on mainnet:

      • exponential: 0xcebF2117a483EFf141c25bf8d365B9B81Af9112F

      • linear: 0x7DBadf3CC5C9C7177B6f976910eF84AD90E018a8

      • uniform: 0x6f519d997CD2027F164586718Ca248d2384D7dB1

    • The contract addresses for the allocation providers on Sepolia:

      • exponential: 0x015AFC876A4d115E2fF01000d9D3ADC714e5870B

      • linear: 0x4e1157b40e62782F04d7F4a915f340B8F445B008

      • uniform: 0xE3Eca4c4B0BB84532D43db64E505CC6eE750fD7C

Fees:

  • managementFeePct - fees collected by the vault owner. Maximum amount is 5

  • performanceFeePct - fees collected by the vault owner. Maximum amout is 20

  • depositFeePct - deposit fee percentage. Maximum amount is 5

Other: actions, actionRequestTypes, guards, guardRequestTypes are parameters required for the vault creation with the guard (f.e. deposit lock). If you create vault without guard, leave them empty. !! For the correctness and up-to-date information of the contract addresses used in the doc, always refer to:

Vault creation with the guard (f.e. Deposit lock)

In order to create vault with the guard, the following parameters need to be filled in:

  • actions - Address of predefined state changing actions to register for the smart vault (eg. when deposition, withdrawing).

  • actionRequestTypes - Defines in what occasions actions or guards are triggered (1 - Deposit, 2 - Withdrawal, 3 - TransferNFT, 4 - BurnNFT, 5 - TransferSVTs).

  • guards - predefined View only checks to register for the smart vault (eg. when deposition, withdrawing).

  • guardRequestTypes - Request types for the smart vault.

Follow this example script to create vault with 90-days deposit lock: https://github.com/YieldLayer/spool-v2-core/blob/main/script/sepolia/extended/DeployVaultWithTimelockGuard.s.sol

Manual vault creation

Alternatively, partners could send vault information to Yelay according to this template:

Vault owner address (multi-sig): 
Name of the vault: 
Deposit token (SVT) ticker: 
Strategies:    // f.e: gearbox-v3-usdc and yearn-v2-usdc
AllocationProvider:    // by default: ‘exponential’
RiskTolerance:    // by default: ’10’, majority of allocation to the strategies with higher APY

Yelay team will create on-chain transaction based on these configs and pass it to the partner so that they you can execute it via their own Vault Owner's multi-sig.

Vault management

Transferring ownership

In order to initiate this process, owner should call the transferSmartVaultOwnership method on theSpoolAccessControl contract: (https://etherscan.io/address/0x7b533e72E0cDC63AacD8cDB926AC402b846Fbd13#writeProxyContract).

After that newOwner must accept it by calling acceptSmartVaultOwnership on the same SpoolAccessControl contract.

Last updated