Multi-step widgets

The development of DEXVAULT will be scheduled to our Growing Stage Period.

Use Case: DeFi Multi-Step Widgets

Executing various DeFi operations often necessitates multiple transactions, interacting with different smart contracts. Multiple steps are required due to the fundamental nature of blockchain transactions and the way DeFi protocols are designed.

Here are a few examples:

  • Swap and Stake: This is a common operation in DeFi, especially in liquidity provisioning. A user might want to swap Token A for Token B on a decentralized exchange like Uniswap. After receiving Token B, the user may wish to stake these tokens in a yield farming protocol to earn rewards. This operation involves at least two steps: the swap transaction and the staking transaction.

  • Withdraw and Migrate Liquidity: In the constantly evolving DeFi space, new liquidity pools are regularly introduced offering better yields or other advantages. This often necessitates users to withdraw their staked tokens and accumulated rewards from the existing or deprecated pools and migrate them to these new pools. This multi-step operation typically starts with the withdrawal of staked tokens and the harvesting of rewards, followed by the approval for a new smart contract to handle these tokens. Lastly, users migrate their liquidity to the new pool, potentially involving a swap transaction if the new pool requires a different token. Each step is a distinct transaction, requiring separate confirmations and interactions with different contracts.

  • Approval and Transfer: Before a smart contract can move tokens on a user's behalf, the user must first approve the smart contract to do so. This is a safety feature built into the Ethereum blockchain (and other similar blockchains) to prevent unauthorized movements of tokens. Therefore, any operation that requires a smart contract to move tokens will usually require an approval transaction first, followed by the actual operation (such as swap, stake, or unstake).

  • Minting and Interacting: In the case of DeFi lending platforms like MakerDAO or Aave, a user may first need to lock up some assets as collateral (such as ETH). This operation mints a new type of token (such as DAI on MakerDAO), which represents the loan. The user can then use this loan for other purposes, like trading or staking, each of which is a separate operation.

  • Complex DeFi Strategies: DeFi has enabled the development of complex investment strategies that can be automated through smart contracts. These strategies often involve multiple steps and interactions with different protocols. For example, a strategy might involve taking a loan from a lending platform, using the loan to provide liquidity on a decentralized exchange, and staking the liquidity provider tokens in a yield farming protocol. Each step is a separate transaction and interacts with a different protocol.

For the end-user, each of these steps typically requires interfacing with different dApps (decentralized applications), each with their own user interfaces and transaction approval processes. This scenario leads to a fragmented, often perplexing user experience, particularly for those new to the DeFi realm.

Last updated