Zap withdraw
Last updated
Last updated
Continuing from .
Zap withdraw enables users to withdraw an asset and swap it for any token in one transaction.
Source token: the token to be withdrawn from a lending protocol.
Destination token: the token that the user receives.
By specifying the source token, the source token amount, and the destination token, the function will return the destination token amount, the updated user portfolio, and the logics to be executed.
The logic should include:
Withdraw the source token
Swap the source token to the destination token
To perform the logics, certain approvals need to be processed. You may refer to Estimate Router Data and Send Router Transaction for more details.