GET /v1/shortcuts/quote

GET /v1/shortcuts/quote

If the EOA lacks sufficient funds or allowances to execute a transaction, the route endpoint cannot determine the optimal path.

The /quote endpoint provides a quick estimate of the tokenOut amount that will be received without requiring the user to hold the funds or set allowances.

Request

Query ParamDescriptionExample
fromAddressEthereum address of the wallet to send the transaction from (It could be an EoA, or a Smart Wallet)tokenIn=0x6b175474e8909...
tokenInEthereum address of the token to swap or use for entering a positiontokenIn=0x6b175474e8909...
amountInAmount of tokenIn to swap in weiamountIn=100000000000
tokenOutEthereum address of the token to receivetokenOut=0x182b723a587...
priceImpactFlag that indicates whether to calculate and return the price impact of the transactionpriceImpact=true
chainId(Optional) The chainId of the network. Default value is 1 for MainnetchainId=1
fee(Optional) Fee in basis points. Must be in range 0-100. If specified, this percentage of amountIn value will be sent to feeReceiverfee=100 (1%)
feeReceiver(Optional) Ethereum address that will receive the collected fee amount if fee was provided.feeReceiver=0x220866B1A22...

Response

Returns an object with the following parameters:

FieldDescription
gasAn estimation on how much gas will be spent
amountOutEstimated amount out received
feeAmountAn Array containting all the collected fee amounts for each amountIn input
(Only if fee was provided).
priceImpact(Optional) Price impact of the transaction

Examples

Quote ETH to stETH

Get a quote for spending 1 ETH for stEth

Request:

curl "https://api.enso.finance/api/v1/shortcuts/quote?chainId=1&fromAddress=0xd8da6bf26964af9d7eed9e03e53415d37aa96045&tokenIn=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&tokenOut=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&amountIn=1000000000000000000&apikey=1e02632d-6feb-4a75-a157-documentation"

Response:

{ "gas": "365895", "amountOut": "1000481280900017222", "priceImpact": 0 }