5. Preview the Estimated Post-Zap-Withdraw Position & Approval Permissions
Specify the srcToken, srcAmount that represents the base or collateral token the user wants to withdraw, along with the destToken which the user wants. Then It returns a quotation used for getting the estimated position. approvals need to be signed and submitted on-chain. logics is the detailed steps used for building transaction. Logics workflow is as follows:
Withdraw the base or collateral token from the market.
Swap the base or collateral token to the destination token.
Provides transaction data that is needed to execute this operation. Armed with the logics from the previous step, it generates the to, data and value including fees then signs and submits to finalize the operation.
If you wish to include a referral for fee sharing, you can append the referral property to the routerData object. For detailed information on using routerData, please refer to the Router Data Documentation.