Get an Estimate
GET v2/portal/estimate
This endpoint is for estimating the expected quantity of tokens that will be received following the portal transaction. This endpoint DOES NOT guarantee execution at the provided rate nor does it construct or validate a signable transaction. It is only provided for informational purposes to estimate the expected output based on current market conditions.
Example
Estimating Output for Swapping Yearn yvWETH for yvCurve-stETH Tokens
Request
Estimate a swap of 10 yearn yvWETH tokens (~19,617 USD) for Yearn yvCurve-stETH tokens:
"inputToken":"ethereum:0xa258c4606ca8206d8aa700ce2143d7db854d168c",
"inputAmount":"10000000000000000000",
"outputToken":"ethereum:0xdcd90c7f6324cfa40d7169ef80b12031770b4325",
"slippageTolerancePercentage":"0.5"
Response
{
"outputAmount": "8809924930635977077",
"minOutputAmount": "7928932437572379369",
"outputToken": "0xdcd90c7f6324cfa40d7169ef80b12031770b4325",
"outputTokenDecimals": 18
}
The estimated output is 8.81 (~$17,932 USD) of yvCurve-stETH tokens based on current market conditions. The minOutputAmount
is the minimum amount of tokens that will be received if the transaction encounters slippage equal to the slippageTolerancePercentage
. If the minimum amount of tokens were less than this amount, the transaction would revert (fail).