Skip to main content
The Enso Shortcuts system offers two powerful APIs for building DeFi workflows:
  • Automated Routing: The POST shortcuts/route API calculates optimized multi-step paths for entering/exiting DeFi positions or swapping ERC20 tokens. It automatically creates a path between two positions specified in the request.
  • Bundling DeFi Actions: The POST shortcuts/bundle API lets you orchestrate DeFi workflows by composing multi-step sequences of Actions of your choosing.
Would route do the job?
The route API might be the simpler way to route your assets. Before using the bundle API, check if route would work using happypath.
Both APIs return a transaction object with calldata representing your workflow, ready to be submitted to EnsoRouter for execution.

1. Automated Routing

The POST route API is suitable for single-path operations with automatic optimization.

Token Swaps

Optimize conversions between tokens by leveraging automated routing across DEXs. Example: Swapping 1 ETH to USDC with the best execution price and 0.5% slippage
  • Input: 1 ETH
  • Slippage: 0.5%
  • Output: USDC worth of 1 ETH
Typescript SDK

Multi-Token Deposits

Deposit multiple tokens simultaneously into a liquidity pool to receive LP tokens in a single transaction. Example: Depositig 10 DAI + 10 USDC + 10 USDT to 3Crv LP tokens (Curve 3pool) in one step
  • Input: 10 DAI, 10 USDC, 10 USDT
  • Slippage: 0.5%
  • Output: 3Crv LP tokens
SDK

LST Staking Entry

Transform base tokens directly into staked liquid staking positions with a single call. Example: Converting 1 ETH to stETH (Lido Staked ETH) in one step
  • Input: 1 ETH
  • Slippage: 0.5%
  • Output: stETH
SDK

Yield Position Entry

Enter yield-generating positions from base assets. Example: Moving from 1 WETH to a Yearn vault (yvWETH)
  • Input: 1 WETH Output: yvWETH (exact amount depends on the vault’s share price)
  • Slippage: 0.5%
SDK

Position Exit (Single Token)

Exit completely from a DeFi position back to a single base token. Example: Converting 1 yvWETH (Yearn ETH vault) back to WETH
  • Input: 1 yvWETH
  • Output: WETH (actual amount depends on accrued yield)
  • Slippage: 0.5%
SDK

LP Position Entry

Enter into LP token positions with automatic routing and slippage protection. Example: Going from 1 ETH to Curve stETH/ETH LP tokens (steCRV)
  • Output: ~0.92 steCRV LP tokens (varies with pool composition)
  • Slippage: 0.5%
SDK

Zap into a Morpho Blue Vault

Zap a Morpho USDC vault position, represented by 0xBEeFFF209270748ddd194831b3fa287a5386f5bC. Example: Going from 1 ETH to Morpho USDC position
  • Output: Morpho Blue USDC vault tokens
  • Slippage: 0.5%
SDK

Simple LST Zapping

Direct entry into or exit from liquid staking tokens. Example: Converting 1 stETH back to ETH
  • Input: 1 stETH (Lido Staked ETH)
  • Output: ETH (varies with current discount/premium)
  • Slippage: 0.5%
SDK
Note: Limited to simple LST interactions without complex staking steps. Use Bundle API for multi-step LST staking flows.

2. Bundling DeFi Actions

The Bundle API (POST /v1/shortcuts/bundle) excels at orchestrating complex sequences of operations.

Multi-Position Entry

Splitting funds across several positions simultaneously Example: Distributing 1 ETH into three LST tokens in one transaction
  • Input: 1 ETH
  • Slippage: 0.5% for each conversion
  • Outputs:
    1. stETH (Lido Staked ETH)
    2. rETH (Rocket Pool ETH)
    3. cbETH (Coinbase Staked ETH)
  • Process:
    1. Convert 1/3 ETH (0.333 ETH) to stETH
    2. Convert 1/3 ETH (0.333 ETH) to rETH
    3. Convert 1/3 ETH (0.334 ETH) to cbETH
SDK

Single-Asset Zap into Uniswap V3 Concentrated Liquidity

Provide liquidity to a two-asset Uniswap V3 pool using a single token as input. Enso automatically handles swapping for the second token and balancing the pair before depositing. Example: Use AAVE to provide concentrated liquidity to a WETH/AAVE pool on Uniswap v3 on Arbitrum.
  • Input: 10 AAVE
  • Output token: the NonfungiblePositionManager that mints and manages NFT-based receipts for provided liquidity.
  • Final Result: A Uniswap V3 NFT representing a concentrated liquidity position in the WETH/AAVE pool.
  • Process:
    1. The enso.split action takes the input AAVE and swaps the optimal amount for WETH to create a balanced pair required by the Uniswap pool.
    2. Check the split WETH and AAVE amounts against 0.5% slippage.
    3. The uniswap-v3.depositclmm action takes the resulting WETH and AAVE from the split.
    4. It deposits both tokens as liquidity into the specified pool within the defined tick range (26520 to 28440).
SDK

Multiple-Asset Zap to SushiSwap V3 LP

To deposit into Sushiswap V3 AUSD/USDC poool, you need to use the bundle API. Bundle Design:
  • Input of 100 USDC must be split into 2 tokens: AUSD and USDC, using Enso’s split action that converts part of the USDC into AUSD in the ratio the pool needs, and keeps the rest as USDC
  • Check the split AUSD and USDC amounts against 0.5% slippage
  • Deposit using depositclmm action of sushiswap-v3 protocol.
    • tokenIn are the pool’s tokens (AUSD/USDC)
    • amountIn is an array of amounts obtained from the split into AUSD and USDC respectively, using dynamic quantity reference (useOutputOfCallAt).
    • The tokenOut value is the address of Sushiswap’s position manager contract.
    • Provide correct fee and ticks.

Mint and top up a Uniswap V3 position

Mint a Uniswap V3 position and add more liquidity to it in the same transaction, under the router strategy. Shows two Bundle-API rules for position NFTs:
  • Reference the minted id with index: 0: depositclmm returns [tokenId, liquidity]. The top-up and the transfer both take { useOutputOfCallAt: 0, index: 0 }.
  • A consumed NFT stays in the executor: because a later action uses the minted position, the router keeps it instead of sending it to the user after the mint. The trailing erc721:transfer delivers it; without it the NFT leaves the executor after the mint and the top-up reverts.
Example: Mint a USDC/WETH 0.05% position on Ethereum, then add to it
  • Input: 4,000 USDC and 1.3 WETH
  • Final result: one Uniswap V3 position NFT owned by the user, holding both deposits
  • Process:
    1. Mint a position with 3,000 USDC + 1 WETH between ticks 196000 and 199000 (kept by the router)
    2. Add 1,000 USDC + 0.3 WETH to the position just minted
    3. Transfer the position NFT to the user
Under router the response’s preTransactions are the two ERC-20 approvals; no NFT approval is needed.
SDK

Staking Pipeline

Chain multiple actions together to create a complete Curve LP staking workflow. Example: Creating a staked Curve 3pool position starting with 1 ETH
  • Input: 1 ETH
  • Final Output: 3pool LP tokens staked in Curve gauge
  • Process:
    1. Swap 1 ETH to USDC
    2. Deposit USDC into Curve 3pool to get 3pool LP tokens
    3. Stake 3pool LP tokens in the Curve gauge
    4. Check the received gauge token amount against 0.5% slippage
SDK

Portfolio Rebalancing

Adjusting position sizes across multiple protocols. Example: Rebalancing from 70% ETH + 30% USDC to 50% ETH + 50% USDC across Aave positions
  • Input: 0.6 WETH (for reallocation)
  • Output:
    1. 0.4 WETH deposited to Aave (aWETH)
    2. ~$580 USDC (from 0.2 WETH) deposited to Aave (aUSDC)
  • Process:
    1. Convert 0.2 WETH to USDC
    2. Deposit 0.4 WETH into Aave (aWETH position)
    3. Deposit the acquired USDC into Aave (aUSDC position)
    4. Check the received aUSDC amount against 0.5% slippage
SDK

Position Migration

Moving from one protocol to another Example: Migrating 1 aWETH from Aave V3 to Compound V3 on Arbitrum
  • Input: 1 aWETH (Aave V3 WETH)
  • Output: cWETHv3 (Compound V3 WETH)
  • Process:
    1. Withdraw 1 WETH from Aave by redeeming aWETH
    2. Supply the WETH to the Compound V3 WETH market to get cWETHv3
SDK

Leveraged Positions

Creating leveraged positions through multiple actions Example: Creating a 2x ETH position using Aave
  • Input: 1 WETH initial collateral
  • Final Result: WETH worth of collateral in Aave
  • Process:
    1. Deposit 1 WETH as collateral in Aave
    2. Borrow ~1,000 USDC against the WETH collateral
    3. Swap the borrowed 1,000 USDC back to ~0.35 WETH
    4. Deposit the additional WETH back into Aave as more collateral
SDK

Zap into multiple LPs

Multi-step entry into or exit from liquid staking tokens with additional operations. Example: Creating diversified LP and LST positions with 1 ETH
  • Input: 1 ETH split evenly
  • Slippage: 0.5% for each conversion
  • Process:
    1. Convert 0.5 ETH to stETH/ETH Curve LP tokens
    2. Convert 0.5 ETH to BAL/WETH Balancer LP tokens
SDK

Yield Compounding Flow

Automate yield compounding by harvesting rewards, swapping, and redepositing in a single transaction. Example: Compounding Curve gauge rewards back into the stETH/ETH pool
  • Input: Existing position in stETH/ETH Curve gauge
  • Slippage: 0.5%
  • Process:
    1. Harvest accumulated wstETH rewards from the Curve gauge
    2. Convert wstETH rewards to stETH
    3. Deposit stETH back into the stETH/ETH Curve pool
    4. Check the received stETH/ETH Curve LP amount against 0.5% slippage
SDK

Liquid Staking Derivative Looping

Create a leveraged position with liquid staking tokens through recursive borrowing and depositing in a lending protocol. Example: Implement a two-loop leveraged position on Lido Staked ETH (wstETH) using Aave V3 as the lending platform.
  • Input: 10 wstETH
  • Final Result: ~17.2 wstETH deposited with 9 WETH borrowed (~1.7x leverage)
  • Process:
    1. Deposit 10 wstETH as collateral into Aave V3
    2. Borrow 6 WETH against your deposited collateral
    3. Route the borrowed WETH to wstETH
    4. Deposit the wstETH back as additional collateral
    5. Borrow 3 WETH against your increased collateral
    6. Route the borrowed WETH to wstETH
    7. Deposit this amount back again as additional collateral
SDK

Alchemix alUSD Leverage Loop (2 Borrows, Router Strategy)

Open and loop a leveraged Alchemix AlchemistV3 alUSD position in a single bundle: deposit MIXUSD collateral, mint an NFT, borrow alUSD, swap to USDC, wrap to MIXUSD, deposit back into the same NFT, then borrow alUSD again. Shows three useful Bundle-API patterns at once:
  • Mint-then-reuse NFT tokenId: the first deposit mints a fresh position (tokenId: "0"); subsequent actions reference the minted id via useOutputOfCallAt(0, index: 0).
  • Hold-in-router across actions: setting receiver: address(0) on intermediate steps keeps the NFT and tokens inside the router until the final borrow ships alUSD to the EOA.
  • Loop with output chaining: every later amountIn is derived from a prior action’s output, so the bundle adapts to actual amounts at execution time.
Example: Loop on Ethereum with 10 MIXUSD as initial collateral
  • Input: 10 MIXUSD (alchemix-myts USDC) on Ethereum
  • Final result: One AlchemistV3 NFT with ~17 MIXUSD collateral + ~14.5 alUSD debt, plus the second-borrow alUSD delivered to the EOA
  • Process:
    1. Deposit 10 MIXUSD → mint AlchemistV3 NFT (held by router)
    2. Borrow 7.5 alUSD against the new NFT
    3. Swap 7.5 alUSD → USDC (0.5% slippage)
    4. Wrap USDC → MIXUSD via alchemix-myts.deposit
    5. Deposit the new MIXUSD back into the same NFT
    6. Borrow another 7.0 alUSD against the now-bigger position, sent to the EOA
SDK

Cross-Chain Route-Bridge

Execute a route and bridge tokens to another chain in a single transaction using the route-bridge functionality. Example: Bridging 1 ETH from Ethereum to Optimism and converting to USDT
  • Input: 1 ETH on Ethereum
  • Output: USDT on Optimism
  • Process:
    1. Route 1 ETH to USDT on Ethereum
    2. Bridge the resulting USDT to Optimism
    3. Receive USDT on Optimism
Important: When using destinationChainId, you must include refundReceiver to handle any potential refunds from failed bridge operations.
SDK

Updated 2025-11-03