Depositing 2 USDC results in 2,000,000 ERC-1155 tokens, and so on.
Deposit "on behalf" of another user (specifying shares receiver)
This feature allows depositing tokens into vault's pool, but the resulting shares will be credited to a different address (the receiver address). This is useful, for example, for depositing funds on behalf of users.
Depositing with any asset
Depositing any ERC-20 Token
To deposit any ERC-20 token and swap it on the way, use the sdk.vaults.swapAndDeposit method:
Where:
vault – Address of the vault.
pool – Pool set up by the client within the vault.
amount – Deposit amount.
swapCallData – Swap arguments from 1inch.
swapTarget – Should match the asset of the vault.
tokenToSwap – ERC-20 token to be swapped before depositing.
⚠ Note:
This method requires obtaining a 1inch API key and retrieving swapCallData from it.
Users will incur swap costs when using this method.
Wrap ETH when depositing to WETH vault
To deposit ETH into a WETH vault (i.e., to wrap ETH instead of swapping it and avoid swap fees), use the depositEth method:
Where:
vault – Address of the Yelay V3 WETH vault on the given chain.
poolId – ID of the pool where the user deposits.
amount – Amount of ETH to deposit.
This method leverages the VaultWrapper contract to handle ETH wrapping and depositing in a single transaction.
Note that it is not possible to do 'depositOnBehalf' with swapAndDeposit and depositEth. Contact @guilhermemussi on Telegram if you want this to be enabled.