v1

latestOpenAPI 3.0.02026-07-26278284.4 KB
DeFi Shortcuts

Routing to a non-tokenized position

Calculates optimal transaction with the best route entering a non-tokenized position, which may involve several actions that interact with various DeFi protocols.

get/api/v1/shortcuts/route/nontokenized

Query parameters

chainIdnumber
Example:80094

Chain ID of the network to execute the transaction on

fromAddressstring required
Example:0xd8da6bf26964af9d7eed9e03e53415d37aa96045

Ethereum address of the wallet to send the transaction from

routingStrategy'delegate' | 'delegate-legacy' nullable

Routing strategy to use. For this API, always use delegate in conjunction with a Smart Wallet.

tokenInstring[] required

Ethereum address of the token to swap from. For ETH, use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

[
  "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
]
positionOutstring required
Example:0xf99be47baf0c22b7eb5eac42c8d91b9942dc7e84

Ethereum address of the position to receive

slippagestring
Example:300

Slippage in basis points (1/10000), e.g. 50 = 0.50%. Takes precedence over minAmountOut.

feestring[]

Fee in basis points (1/10000) for each amountIn value, e.g. 50 = 0.50%. Must be in range 0-100. If specified, this percentage of each amountIn value will be sent to feeReceiver

[
  "100"
]
feeReceiverstring
Example:0x220866B1A2219f40e72f5c628B65D54268cA3A9D

The Ethereum address that will receive the collected fee. Required if fee is provided

amountInstring[] required

Amount of tokenIn to swap in wei

[
  "1000000000000000000"
]
receiverstring required
Example:0xd8da6bf26964af9d7eed9e03e53415d37aa96045

Ethereum address of the receiver of the positionOut

spenderstring
Example:0xd8da6bf26964af9d7eed9e03e53415d37aa96045

Ethereum address of the spender of the tokenIn

referralCodestring
Example:0123456789ABCDEF

Referral code that will be included in an on-chain event.

Response

gasstring required
amountOutstring required
priceImpactnumber nullable required

Price impact in basis points, null if USD price not found

feeAmountstring[] required

An array of the fee amount collected for each tokenIn

minAmountOutstring required

The minimum allowable amount out after slippage

createdAtnumber required

Block number the transaction was created on

ensoFeeAmountstring[] required