Zap supply
Continuing from #id-4.-select-an-use-case.
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.
5. Preview the estimated post-zap-supply portfolio
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
6. Obtain the required approval permission and send the router transaction
To perform the logics, certain approvals need to be processed. You may refer to Estimate Router Data and Send Router Transaction for more details.
Last updated