Same-chain Deposit
Last updated
Last updated
The user selects a vault to deposit into, a funding token, and the amount to deposit into the vault
User requests routes from the Superform API
User selects a route
User approves permit2
contract for the funding token (if needed)
Atomic phase
User calls singleDirectSingleVaultDeposit
. The function sends the funding tokens and data containing the desired swap route to the SuperformRouter. The function parameters are complex; therefore, using the Superform API to generate valid function parameters is suggested
Once the request is initiated, the tokens may be swapped to the target vault's underlying token if the funding token differs from the underlying
directDepositIntoVault
is called and tokens are deposited into the target vault via the target vault's Superform
contract
Vault shares are minted to target vault’s
SuperPositions are minted to the user