DeFi Shortcuts
Optimal route between two tokens
DeFi Shortcuts
Optimal route between two tokens
Calculates optimal transaction with the best route between two tokens, which may involve several actions that interact with various DeFi protocols.
To enter a non-tokenized position, use the GETÂ
/shortcuts/route/nontokenized
.POST
/
api
/
v1
/
shortcuts
/
route
curl --request POST \
--url https://api.enso.finance/api/v1/shortcuts/route \
--header 'Content-Type: application/json' \
--data '{
"chainId": 1,
"fromAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"routingStrategy": "router",
"tokenIn": [
"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
],
"tokenOut": [
"0x6b175474e89094c44da98b954eedeac495271d0f"
],
"toEoa": true,
"receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"spender": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"amountIn": [
"1000000000000000000"
],
"minAmountOut": null,
"slippage": "300",
"fee": [
"100"
],
"feeReceiver": "0x220866B1A2219f40e72f5c628B65D54268cA3A9D",
"ignoreAggregators": [
"<string>"
],
"ignoreStandards": [
"<string>"
],
"variableEstimates": null,
"referralCode": "0123456789ABCDEF"
}'
{
"gas": "<string>",
"amountOut": 123,
"priceImpact": 123,
"feeAmount": [
"<string>"
],
"createdAt": 123,
"tx": {
"data": "<string>",
"to": "<string>",
"from": "<string>",
"value": "<string>"
},
"route": [
{
"tokenIn": [
"<string>"
],
"tokenOut": [
"<string>"
],
"protocol": "<string>",
"action": "<string>",
"primary": "<string>",
"internalRoutes": [
"<string>"
],
"args": {}
}
]
}
Body
application/json
Response
200
application/json
The response is of type object
.
Was this page helpful?
curl --request POST \
--url https://api.enso.finance/api/v1/shortcuts/route \
--header 'Content-Type: application/json' \
--data '{
"chainId": 1,
"fromAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"routingStrategy": "router",
"tokenIn": [
"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
],
"tokenOut": [
"0x6b175474e89094c44da98b954eedeac495271d0f"
],
"toEoa": true,
"receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"spender": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"amountIn": [
"1000000000000000000"
],
"minAmountOut": null,
"slippage": "300",
"fee": [
"100"
],
"feeReceiver": "0x220866B1A2219f40e72f5c628B65D54268cA3A9D",
"ignoreAggregators": [
"<string>"
],
"ignoreStandards": [
"<string>"
],
"variableEstimates": null,
"referralCode": "0123456789ABCDEF"
}'
{
"gas": "<string>",
"amountOut": 123,
"priceImpact": 123,
"feeAmount": [
"<string>"
],
"createdAt": 123,
"tx": {
"data": "<string>",
"to": "<string>",
"from": "<string>",
"value": "<string>"
},
"route": [
{
"tokenIn": [
"<string>"
],
"tokenOut": [
"<string>"
],
"protocol": "<string>",
"action": "<string>",
"primary": "<string>",
"internalRoutes": [
"<string>"
],
"args": {}
}
]
}