Enter a single position from 1 token
When using a Smart Wallet, there's no need for token approvals!
In this example, we have a smart wallet (e.g. Gnosis Safe, Enso Smart Wallet) that is holding 1 WETH (opens in a new tab), and wants to: 4. Deposit 1 WETH into Beefy Aura wstETH-ETH (opens in a new tab)
Beefy Aura wstETH-ETH token is multihopping over 4 DeFi protocols
Set Smart-wallet address
If you know your address or you are using another smart wallet such as Safe, you can skip to the next step.
You will need to set the smart wallet address in the fromAddress
field.
If you are using an Enso Smart Wallet, and don't remember the address you can fetch using the metadata API.
Fetch Enso Smart Wallet address from an EoA:
curl -X GET \
-H "Accept: application/json" \
"https://api.enso.finance/api/v1/wallet?chainId=1&fromAddress=<EOA_ADDRESS>"
It returns the following:
{
"address": "0xD6A4217CF6A3587B4E33e9a59C52BF57469e713a", // Enso Smart Wallet Address
"isDeployed": true
}
Step 2: Execute
Execute: Fetch the actions
We are using the Route endpoint as it compares the best execution route for token amount out, and gas execution price. For example, it might be better to purchase yvWETH on a secondary exchange than directly depositing it depending upon the exchange rate of that token on the secondary market.
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer 1e02632d-6feb-4a75-a157-documentation" \
"https://api.enso.finance/api/v1/shortcuts/route?chainId=1&fromAddress=0xD6A4217CF6A3587B4E33e9a59C52BF57469e713a&spender=0xD6A4217CF6A3587B4E33e9a59C52BF57469e713a&receiver=0xD6A4217CF6A3587B4E33e9a59C52BF57469e713a&priceImpact=false&amountIn=1000000000000000000&slippage=300&tokenIn=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&tokenOut=0xe0d5f9da3613c047003b77caa31270abe3eda6b0"
The data
value contains the bundle calldata to be submitted to the user.