Zap supply
Last updated
Last updated
Continuing from .
Zap supply enables users to swap any token and supply the swapped out token in one transaction.
Source token: the user-provided token.
Destination token: the token to be supplied to a lending protocol.
Note that the supplied token can be either liquidity or collateral, depending on the design of the lending protocol.
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:
Swap the source token to the destination token
Supply 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.