The Bundle API supports a variety of actions to build complex DeFi strategies. This reference guide explains all available actions and their parameters.

To get the up-to date list of available actions and parameters, use GET /integration/actions.
To get a list of actions available for a specific protocol, use GET standards/{slug}/.

Chaining Actions

Bundle API allows using output of one action as the input for another.

To reference outputs from previous actions use the useOutputOfCallAt syntax. For array-outputs such as split, you can specify the index within that action’s output array

{
  "amountIn": {
    "useOutputOfCallAt": 0 // Use the output amount from the action at index 0
    "index": 1 // Optional: access outputOfCallAtZero[1]
  }
}

Here’s an example of a more complex chaining sequence that splits WETH into three different

[
  {
    "protocol": "enso",
    "action": "route",
    "args": {
      "tokenIn": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // USDC
      "tokenOut": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH
      "amountIn": "1000000000" // 1000 USDC
    }
  },
  {
    "protocol": "enso",
    "action": "split",
    "args": {
      "amount": { "useOutputOfCallAt": 0 },
      "percentages": ["5000", "3000", "2000"] // 50%, 30%, 20%
    }
  },
  {
    "protocol": "aave-v3",
    "action": "deposit",
    "args": {
      "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH
      "amountIn": { "useOutputOfCallAt": 1, "index": 0 }, // 50% portion
      "primaryAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" // Aave V3 pool
    }
  },
  {
    "protocol": "curve",
    "action": "deposit",
    "args": {
      "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH
      "amountIn": { "useOutputOfCallAt": 1, "index": 1 }, // 30% portion
      "primaryAddress": "0xDC24316b9AE028F1497c275EB9192a3Ea0f67022" // Curve ETH/stETH pool
    }
  },
  {
    "protocol": "yearn",
    "action": "deposit",
    "args": {
      "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH
      "amountIn": { "useOutputOfCallAt": 1, "index": 2 }, // 20% portion
      "primaryAddress": "0xa258C4606Ca8206D8aA700cE2143D7db854D168c" // Yearn WETH vault
    }
  }
]

slippage

Applies slippage protection to ensure the received amount is within the acceptable range of the expected output.

The action calculates the minimum acceptable amount based on the specified slippage tolerance (amountOut * (10000 - bps) / 10000). If the actual received amount falls below this threshold, the transaction will revert. This action should be included manually when not using the route action, which has built-in slippage protection.

When using the bundler without the route action, always include slippage protection via the slippage action to prevent excessive price impact. The route action includes slippage protection by default, but other actions require manual slippage configuration.

{
  "protocol": "enso",
  "action": "slippage",
  "args": {
    "bps": "100", // 1% maximum slippage (100 basis points)
    "amountOut": "980000000000000000" // Expected output amount (0.98 ETH with 18 decimals)
  }
}
ParameterDescriptionRequired
bpsMaximum acceptable slippage in basis points (1 bps = 0.01%, 100 bps = 1%)Yes
amountOutExpected output amount (with full decimals) or a return value from a previous action via useOutputOfCallAtYes

Core Actions

route

The route action determines the optimal path to swap one token for another across multiple DeFi protocols supported by Enso.

When using the route action, slippage is automatically calculated and applied. The action will revert if the received amount is below the expected output after applying slippage.

For other actions, make sure to add slippage action to the bundle to ensure the transaction doesn’t revert due to price impact.

{
  "protocol": "enso",
  "action": "route",
  "args": {
    "tokenIn": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", // ETH address
    "tokenOut": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84", // stETH address
    "amountIn": "1000000000000000000", // Amount in wei (1 ETH)
    "slippage": "300", // 3% slippage tolerance (in basis points)
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", // Optional: Receiver address
    "primaryAddress": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D", // Optional: Primary contract address
    "poolFee": "3000" // Optional: Pool fee in basis points (e.g., 3000 for 0.3%)
  }
}
ParameterDescriptionRequired
tokenInAddress of the token to send. For ETH, use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeYes
tokenOutAddress of the token to receiveYes
amountInAmount of tokenIn to send in wei (with full decimals)Yes
slippageSlippage tolerance in basis points (100 = 1%)No
receiverAddress to receive the output tokens if not the callerNo
primaryAddressOptional address of the router or primary contract to useNo
poolFeeOptional pool fee in basis points when using specific poolsNo

swap

Swaps one token for another using a specific pool or exchange protocol.

{
  "protocol": "uniswap-v2",
  "action": "swap",
  "args": {
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH
    "tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
    "amountIn": "1000000000000000000", // 1 WETH (18 decimals)
    "primaryAddress": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D", // Uniswap V2 Router
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", // Optional: Receiver
    "slippage": "100", // Optional: 1% slippage (100 basis points)
    "poolFee": "3000" // Optional: Pool fee in basis points (e.g., 3000 for 0.3%)
  }
}
ParameterDescriptionRequired
tokenInAddress of token to swap fromYes
tokenOutAddress of token to swap toYes
amountInAmount of tokenIn to swap in wei (with full decimals)Yes
primaryAddressAddress of the router or pool contractNo
receiverAddress to receive the output tokens if not the callerYes
slippageSlippage tolerance in basis points (100 = 1%)No
poolFeeOptional pool fee in basis points when using specific poolsNo

call

Makes an arbitrary call to any contract, allowing for custom interactions. This is useful for executing complex logic or interacting with contracts that are not directly supported by the Enso API.

{
  "protocol": "enso",
  "action": "call",
  "args": {
    "address": "0xD0aF6F692bFa10d6a535A3A321Dc8377F4EeEF12", // Contract address
    "method": "percentMul", // Method name
    "abi": "function percentMul(uint256,uint256) external", // ABI signature
    "args": [
      "1000000000000000000", // 1 ETH (first argument)
      "7000" // 70% (second argument)
    ]
  }
}
ParameterDescriptionRequired
addressAddress of the contract to callYes
methodName of the method to callYes
abiABI signature of the methodYes
argsArray of arguments to pass to the methodYes

Deposit Actions

deposit

Deposits tokens into a protocol to receive a position token or add liquidity.

{
  "protocol": "aave-v3",
  "action": "deposit",
  "args": {
    "tokenIn": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // WETH address
    "tokenOut": "0x4d5F47FA6A74757f35C14fD3a6Ef8E3C9BC514E8", // aWETH address (optional)
    "amountIn": "1000000000000000000", // Amount in wei (1 WETH)
    "primaryAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2", // Aave V3 pool
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Optional: Receiver address
  }
}
ParameterDescriptionRequired
tokenInAddress of token to deposit. Can be a single address or an array for multiple tokensYes
tokenOutAddress of token to receive. Can be a single address or an array for multiple tokensNo
amountInAmount of tokenIn to deposit in wei (with full decimals). Can be a single value or an array for multiple tokensYes
primaryAddressAddress of the protocol contract to interact withYes
receiverAddress to receive the output tokens if not the callerNo

singleDeposit

Deposits a single token into a protocol. This is a specialized version of the deposit action for single token deposits.

{
  "protocol": "yearn",
  "action": "singledeposit",
  "args": {
    "tokenIn": "0x6B175474E89094C44Da98b954EedeAC495271d0F", // DAI address
    "tokenOut": "0xdA816459F1AB5631232FE5e97a05BBBb94970c95", // yvDAI address (optional)
    "amountIn": "10000000000000000000", // 10 DAI (18 decimals)
    "primaryAddress": "0xdA816459F1AB5631232FE5e97a05BBBb94970c95", // Yearn vault
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Optional: Receiver
  }
}
ParameterDescriptionRequired
tokenInAddress of the single token to depositYes
tokenOutAddress of the token to receive (usually a receipt or share token)No
amountInAmount of tokenIn to deposit in wei (with full decimals)Yes
primaryAddressAddress of the protocol contract to interact withYes
receiverAddress to receive the output tokens if not the callerNo

multiDeposit

Deposits multiple tokens into a protocol (like Curve or Balancer) in a single operation.

{
  "protocol": "curve",
  "action": "multideposit",
  "args": {
    "tokenIn": [
      "0x6B175474E89094C44Da98b954EedeAC495271d0F", // DAI
      "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
      "0xdAC17F958D2ee523a2206206994597C13D831ec7"  // USDT
    ],
    "tokenOut": "0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490", // 3Crv LP token (optional)
    "amountIn": [
      "10000000000000000000", // 10 DAI (18 decimals)
      "10000000", // 10 USDC (6 decimals)
      "10000000"  // 10 USDT (6 decimals)
    ],
    "primaryAddress": "0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7", // Curve 3pool
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Optional: Receiver
  }
}
ParameterDescriptionRequired
tokenInArray of addresses of tokens to depositYes
tokenOutAddress of the LP token or receipt token to receiveNo
amountInArray of amounts to deposit in wei (with full decimals). Must match the length of tokenIn arrayYes
primaryAddressAddress of the pool or protocol contract to interact withYes
receiverAddress to receive the LP tokens if not the callerNo

tokenizedSingleDeposit

Deprecation Notice: This action is deprecated in favor of using singleDeposit with the appropriate protocol. It will be removed in a future API version.

Deposits a single token and receives a tokenized position.

{
  "protocol": "compound-v3",
  "action": "tokenizedsingledeposit",
  "args": {
    "tokenIn": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
    "tokenOut": "0xc3d688B66703497DAA19211EEdff47f25384cdc3", // cUSDCv3
    "amountIn": "10000000", // 10 USDC (6 decimals)
    "primaryAddress": "0xc3d688B66703497DAA19211EEdff47f25384cdc3", // Compound market
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Optional: Receiver
  }
}
ParameterDescriptionRequired
tokenInAddress of token to depositYes
tokenOutAddress of tokenized position to receiveYes
amountInAmount of tokenIn to deposit in wei (with full decimals)Yes
primaryAddressAddress of the protocol contract to interact withYes
receiverAddress to receive the position tokens if not the callerNo

tokenizedMultiDeposit

Deprecation Notice: This action is deprecated in favor of using multiDeposit with the appropriate protocol. It will be removed in a future API version.

Deposits multiple tokens and receives a tokenized position.

{
  "protocol": "balancer-v2",
  "action": "tokenizedmultideposit",
  "args": {
    "tokenIn": [
      "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", // WBTC
      "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"  // WETH
    ],
    "tokenOut": "0x8353157092ED8Be69a9DF8F95af097bbF33Cb2aF", // BPT token
    "amountIn": [
      "100000", // 0.01 WBTC (8 decimals)
      "10000000000000000" // 0.01 WETH (18 decimals)
    ],
    "primaryAddress": "0x8353157092ED8Be69a9DF8F95af097bbF33Cb2aF", // Balancer Pool
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Optional: Receiver
  }
}
ParameterDescriptionRequired
tokenInArray of addresses of tokens to depositYes
tokenOutAddress of the tokenized position to receiveYes
amountInArray of amounts to deposit in wei (with full decimals). Must match the length of tokenIn arrayYes
primaryAddressAddress of the protocol contract to interact withYes
receiverAddress to receive the position token if not the callerNo

multiOutSingleDeposit

Deposits a single token and receives multiple output tokens (typically used for certain AMM positions).

{
  "protocol": "uniswap-v3",
  "action": "multioutsingledeposit",
  "args": {
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH
    "tokenOut": [
      "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", // WBTC
      "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"  // USDC
    ],
    "amountIn": "1000000000000000000", // 1 WETH (18 decimals)
    "primaryAddress": "0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640", // Uniswap pool
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Optional: Receiver
  }
}
ParameterDescriptionRequired
tokenInAddress of the single token to depositYes
tokenOutArray of addresses of tokens to receiveYes
amountInAmount of tokenIn to deposit in wei (with full decimals)Yes
primaryAddressAddress of the protocol contract to interact withYes
receiverAddress to receive the output tokens if not the callerNo

depositCLMM

Deposits tokens into a Concentrated Liquidity Market Maker pool (like Uniswap V3).

{
  "protocol": "uniswap-v3",
  "action": "depositclmm",
  "args": {
    "tokenIn": [
      "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH
      "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"  // USDC
    ],
    "tokenOut": "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", // UNI-V3-POS NFT
    "amountIn": [
      "1000000000000000000", // 1 WETH (18 decimals)
      "1000000"  // 1 USDC (6 decimals)
    ],
    "ticks": ["-76800", "-73728"], // Lower and upper tick bounds
    "fee": "3000", // 0.3% fee tier
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Optional: Receiver
  }
}
ParameterDescriptionRequired
tokenInArray of addresses of tokens to deposit (usually 2 tokens)Yes
tokenOutAddress of the position NFT to receiveYes
amountInArray of amounts to deposit in wei (with full decimals). Must match the length of tokenIn arrayYes
ticksArray containing lower and upper tick bounds defining the price rangeYes
feePool fee tier in basis points (e.g., 3000 for 0.3%)Yes
receiverAddress to receive the position NFT if not the callerNo

Withdrawal/Redeem Actions

withdraw

Withdraws tokens from a DeFi position.

{
  "protocol": "erc4626",
  "action": "withdraw",
  "args": {
    "primaryAddress": "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0", // Vault address
    "tokenIn": "0x6b175474e89094c44da98b954eedeac495271d0f", // Token to withdraw (e.g. yvDAI)
    "tokenOut": "0x6b175474e89094c44da98b954eedeac495271d0f", // Output token (e.g. DAI)
    "amountOut": "1000000000000000000", // Amount to withdraw in wei (1 DAI)
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Optional: Receiver
  }
}
ParameterDescriptionRequired
primaryAddressAddress of the protocol contract to interact withYes
tokenInAddress of the token to withdraw from (often a share or receipt token)Yes
tokenOutAddress of the underlying token to receiveYes
amountOutAmount of tokenOut to withdraw in wei (with full decimals)Yes
receiverAddress to receive the withdrawn tokens if not the callerNo

redeem

Redeems underlying assets from a protocol by exchanging shares or tokens. Use it to exit a position and retrieve the desired tokens.

{
  "protocol": "erc4626",
  "action": "redeem",
  "args": {
    "tokenIn": "0xdA816459F1AB5631232FE5e97a05BBBb94970c95", // yvDAI (optional)
    "tokenOut": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // USDC
    "amountIn": "1000000000000000000", // Amount of shares to redeem (1 yvDAI)
    "primaryAddress": "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0", // ERC4626 vault
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Optional: Receiver
  }
}
ParameterDescriptionRequired
tokenInAddress of shares/tokens to redeemNo
tokenOutAddress of token(s) to receive upon redemption. Can be a single address or an arrayYes
amountInAmount of shares/tokens to redeem in wei (with full decimals)Yes
primaryAddressAddress of the contract to interact withYes
receiverAddress to receive the output tokens if not the callerNo

singleRedeem

Redeems a single token from a protocol.

{
  "protocol": "yearn",
  "action": "singleredeem",
  "args": {
    "tokenIn": "0xdA816459F1AB5631232FE5e97a05BBBb94970c95", // yvDAI (optional)
    "tokenOut": "0x6B175474E89094C44Da98b954EedeAC495271d0F", // DAI
    "amountIn": "10000000000000000000", // 10 yvDAI (18 decimals)
    "primaryAddress": "0xdA816459F1AB5631232FE5e97a05BBBb94970c95", // Yearn vault
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Optional: Receiver
  }
}
ParameterDescriptionRequired
tokenInAddress of the share/receipt token to redeemNo
tokenOutAddress of the underlying token to receiveYes
amountInAmount of shares to redeem in wei (with full decimals)Yes
primaryAddressAddress of the protocol contract to interact withYes
receiverAddress to receive the underlying tokens if not the callerNo

multiRedeem

Redeems a token from a protocol and receives multiple tokens (like LP token redemption).

{
  "protocol": "curve",
  "action": "multiredeem",
  "args": {
    "tokenIn": "0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490", // 3Crv LP token (optional)
    "tokenOut": [
      "0x6B175474E89094C44Da98b954EedeAC495271d0F", // DAI
      "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
      "0xdAC17F958D2ee523a2206206994597C13D831ec7"  // USDT
    ],
    "amountIn": "10000000000000000000", // 10 3Crv (18 decimals)
    "primaryAddress": "0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7", // Curve 3pool
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Optional: Receiver
  }
}
ParameterDescriptionRequired
tokenInAddress of the LP token or share token to redeemNo
tokenOutArray of addresses of underlying tokens to receiveYes
amountInAmount of tokenIn to redeem in wei (with full decimals)Yes
primaryAddressAddress of the protocol contract to interact withYes
receiverAddress to receive the underlying tokens if not the callerNo

tokenizedSingleRedeem

Deprecation Notice: This action is deprecated in favor of using singleRedeem with the appropriate protocol. It will be removed in a future API version.

Redeems a tokenized position for a single underlying token.

{
  "protocol": "compound-v3",
  "action": "tokenizedsingleredeem",
  "args": {
    "tokenIn": "0xc3d688B66703497DAA19211EEdff47f25384cdc3", // cUSDCv3
    "tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
    "amountIn": "10000000000000000000", // 10 cUSDCv3 (18 decimals)
    "primaryAddress": "0xc3d688B66703497DAA19211EEdff47f25384cdc3", // Compound market
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Optional: Receiver
  }
}
ParameterDescriptionRequired
tokenInAddress of the tokenized position to redeemYes
tokenOutAddress of the underlying token to receiveYes
amountInAmount of tokenIn to redeem in wei (with full decimals)Yes
primaryAddressAddress of the protocol contract to interact withYes
receiverAddress to receive the underlying tokens if not the callerNo

tokenizedMultiRedeem

Deprecation Notice: This action is deprecated in favor of using multiRedeem with the appropriate protocol. It will be removed in a future API version.

Redeems a tokenized position for multiple underlying tokens.

{
  "protocol": "balancer-v2",
  "action": "tokenizedmultiredeem",
  "args": {
    "tokenIn": "0x8353157092ED8Be69a9DF8F95af097bbF33Cb2aF", // BPT token
    "tokenOut": [
      "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", // WBTC
      "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"  // WETH
    ],
    "amountIn": "10000000000000000000", // 10 BPT (18 decimals)
    "primaryAddress": "0x8353157092ED8Be69a9DF8F95af097bbF33Cb2aF", // Balancer pool
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Optional: Receiver
  }
}
ParameterDescriptionRequired
tokenInAddress of the tokenized position to redeemYes
tokenOutArray of addresses of underlying tokens to receiveYes
amountInAmount of tokenIn to redeem in wei (with full decimals)Yes
primaryAddressAddress of the protocol contract to interact withYes
receiverAddress to receive the underlying tokens if not the callerNo

redeemCLMM

Redeems tokens from a Concentrated Liquidity Market Maker position (like Uniswap V3).

{
  "protocol": "uniswap-v3",
  "action": "redeemclmm",
  "args": {
    "tokenIn": "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", // UNI-V3-POS NFT
    "tokenOut": [
      "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH
      "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"  // USDC
    ],
    "liquidity": "1000000000000", // Liquidity amount to withdraw
    "tokenId": "123456", // The NFT token ID
    "receiver": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Optional: Receiver
  }
}
ParameterDescriptionRequired
tokenInAddress of the position NFT tokenYes
tokenOutArray of addresses of tokens to receiveYes
liquidityAmount of liquidity to withdrawYes
tokenIdID of the position NFTYes
receiverAddress to receive the underlying tokens if not the callerNo

Lending Actions

borrow

Borrows a token from a lending protocol using a deposited token as collateral.

{
  "protocol": "aave-v3",
  "action": "borrow",
  "args": {
    "collateral": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // WETH address (collateral)
    "tokenOut": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // USDC address (to borrow)
    "amountOut": "1000000000", // Amount to borrow in wei (1000 USDC with 6 decimals)
    "primaryAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" // Aave V3 pool
  }
}
ParameterDescriptionRequired
collateralAddress of the token used as collateral. Can be an array for multiple collateral tokensYes
tokenOutAddress of the token to borrowYes
amountOutAmount to borrow in wei (with full decimals)Yes
primaryAddressAddress of the lending pool contractYes

repay

Repays a loan on a lending protocol.

{
  "protocol": "aave-v3",
  "action": "repay",
  "args": {
    "tokenIn": "0xdac17f958d2ee523a2206206994597c13d831ec7", // USDT address
    "amountIn": "100000000", // Amount to repay in wei (100 USDT with 6 decimals)
    "primaryAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" // Aave V3 pool
  }
}
ParameterDescriptionRequired
tokenInAddress of token to repayYes
amountInAmount to repay in wei (with full decimals)Yes
primaryAddressAddress of the lending pool contractYes

Yield Farming Actions

harvest

Harvests rewards from yield-generating positions.

{
  "protocol": "curve-gauge",
  "action": "harvest",
  "args": {
    "token": "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0", // Token address (LP token or gauge token)
    "primaryAddress": "0x182B723a58739a9c974cFDB385ceaDb237453c28" // Curve gauge address
  }
}
ParameterDescriptionRequired
tokenAddress of token to harvest rewards forYes
primaryAddressAddress of the contract to interact with (e.g., gauge, farm)Yes

Token Management Actions

approve

Approves a spender to use tokens.

{
  "protocol": "erc20",
  "action": "approve",
  "args": {
    "token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // WETH address
    "spender": "0xe592427a0aece92de3edee1f18e0157c05861564", // Spender address (e.g., Uniswap router)
    "amount": "1000000000000000000000000" // Amount to approve in wei (1M WETH)
  }
}
ParameterDescriptionRequired
tokenAddress of the token to approveYes
spenderAddress of the spender (protocol or router)Yes
amountAmount to approve in wei (with full decimals)Yes

transfer

Transfers tokens to a specified address.

{
  "protocol": "erc20",
  "action": "transfer",
  "args": {
    "token": "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07", // OMG token address
    "receiver": "0x80eba3855878739f4710233a8a19d89bdd2ffb8e", // Recipient address
    "amount": "1000000000000000000", // Amount to transfer in wei (1 OMG)
    "id": "1234" // Optional: ID for ERC721 or ERC1155 tokens
  }
}
ParameterDescriptionRequired
tokenAddress of the token to transferYes
receiverAddress of the recipientYes
amountAmount to transfer in wei (with full decimals)Yes
idToken ID for ERC721 or ERC1155 tokensNo

transferFrom

Transfers tokens from a specified address to another address.

{
  "protocol": "erc20",
  "action": "transferfrom",
  "args": {
    "token": "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07", // OMG token address
    "sender": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", // Sender address
    "receiver": "0x93621DCA56fE26Cdee86e4F6B18E116e9758Ff11", // Recipient address
    "amount": "1000000000000000000", // Amount to transfer in wei (1 OMG)
    "id": "1234" // Optional: ID for ERC721 or ERC1155 tokens
  }
}
ParameterDescriptionRequired
tokenAddress of the token to transferYes
senderAddress of the senderYes
receiverAddress of the recipientYes
amountAmount to transfer in wei (with full decimals)Yes
idToken ID for ERC721 or ERC1155 tokensNo

permitTransferFrom

Approves and transfers a token that supports permit in a single step using a signature. A permit signature needs to be generated offchain and passed to the API.

{
  "protocol": "permit2",
  "action": "permittransferfrom",
  "args": {
    "token": "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07", // Token address
    "amount": "1000000000000000000", // Amount in wei (1 token)
    "sender": "0xb67f3CE46bB9E1a1127796c27f38DbaB9f643ec0", // Sender address
    "receiver": "0x35a2839b617F7da6534d636f22945f6Cb6137130", // Receiver address
    "nonce": "1", // Nonce to prevent replay attacks
    "deadline": "1710150268", // Timestamp deadline for signature validity
    "signature": "0x..." // Permit signature
  }
}
ParameterDescriptionRequired
tokenAddress of the token to transfer. Can be an array for multiple tokensYes
amountAmount to transfer in wei (with full decimals). Can be an array for multiple tokensYes
senderAddress of the senderYes
receiverAddress of the recipientYes
nonceNonce value to prevent signature replayYes
deadlineTimestamp after which the signature is invalidYes
signatureThe EIP-2612 permit signatureYes

Bridging

bridge

Facilitates cross-chain token transfers using various bridge protocols with optional callback actions on the destination chain.

When used with callback actions (callback array), it can automatically execute a series of actions on the destination chain once tokens arrive.

Callbacks can reference outputs from previous callback actions using the useOutputOfCallAt syntax to create complex cross-chain operations. Each callback action is executed sequentially on the destination chain.

{
  "protocol": "stargate",
  "action": "bridge",
  "args": {
    "primaryAddress": "0x38EA452219524Bb87e18dE1C24D3bB59510BD783", // Source pool address
    "destinationChainId": 42161, // Target chain ID (e.g., Arbitrum)
    "tokenIn": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // Source token address (USDC)
    "amountIn": "1000000000", // Amount to bridge (1000 USDC with 6 decimals)
    "receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", // Destination address
    "callback": [ // Optional array of actions to execute on destination chain
      {
        "protocol": "enso",
        "action": "balance",
        "args": {
          "token": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8" // Destination token address
        }
      },
      // Additional callback actions...
    ]
  }
}
ParameterDescriptionRequired
primaryAddressSource bridge pool addressYes
destinationChainIdTarget blockchain network IDYes
tokenInToken address to bridge from source chainYes
amountInAmount to bridge (with full decimals) or a reference to a previous action’s outputYes
receiverAddress to receive bridged tokens on destination chainYes
callbackArray of actions to execute on the destination chain after bridgingNo

fee

Calculates and deducts a fee from a specified amount, sending the fee to a designated receiver. This action is typically prepended to bridge operations to facilitate fee collection.

The fee action calculates the fee as amount * (bps/10000) and sends this amount to the receiver. It returns amount - fee, which can be used in subsequent actions via useOutputOfCallAt.

curl -X POST 'https://api.enso.finance/api/v1/shortcuts/bundle' \
  -H 'Content-Type: application/json' \
  -d '{
    "chainId": 1,
    "fromAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "routingStrategy": "delegate",
    "receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "spender": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "actions": [
      {
        "protocol": "enso",
        "action": "ensofee",
        "args": {
          "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
          "amount": 1000000000000,
          "bps": "500",
          "receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045"
        }
      }
    ]
  }'

ParameterDescriptionRequired
tokenToken address to apply the fee toYes
amountAmount to apply the fee to (with full decimals) or a return value from a previous actionYes
bpsFee percentage in basis points (1 bps = 0.01%, 100 bps = 1%)Yes
receiverAddress to receive the feeYes

Utility Actions

split

Splits an amount into multiple parts based on specified percentages.

{
  "protocol": "enso",
  "action": "split",
  "args": {
    "amount": "1000000000000000000", // 1 ETH (18 decimals)
    "percentages": ["5000", "3000", "2000"] // 50%, 30%, 20% (in basis points)
  }
}
ParameterDescriptionRequired
amountAmount to split in wei (with full decimals)Yes
percentagesArray of percentages in basis points (must sum to 10000)Yes

merge

Merges multiple amounts into a single total.

{
  "protocol": "enso",
  "action": "merge",
  "args": {
    "amounts": [
      "500000000000000000", // 0.5 ETH
      "300000000000000000", // 0.3 ETH
      "200000000000000000"  // 0.2 ETH
    ]
  }
}
ParameterDescriptionRequired
amountsArray of amounts to merge (must be in the same denomination)Yes

balance

Gets the balance of a token for a specified account.

{
  "protocol": "erc20",
  "action": "balance",
  "args": {
    "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
    "account": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" // Account to check
  }
}
ParameterDescriptionRequired
tokenAddress of the token to check balanceYes
accountAddress of the account to checkYes

minAmountOut

Calculates the minimum amount out based on expected amount and slippage.

{
  "protocol": "enso",
  "action": "minAmountOut",
  "args": {
    "amount": "1000000000000000000", // 1 ETH (18 decimals)
    "slippage": "100" // 1% slippage (100 basis points)
  }
}
ParameterDescriptionRequired
amountExpected output amount in wei (with full decimals)Yes
slippageSlippage tolerance in basis points (100 = 1%)Yes

Protocol Support

The Bundle API supports a wide range of protocols. Some common ones include:

  • aave-v2, aave-v3: Aave lending/borrowing
  • balancer-v2: Balancer liquidity pools
  • curve: Curve Finance stable swaps and gauges
  • curve-gauge: Curve gauges for staking
  • erc20: Standard token operations
  • erc4626: ERC4626 vaults
  • enso: General Enso operations including route and arbitrary calls
  • permit2: Uniswap’s Permit2 operations
  • uniswap-v2, uniswap-v3: Uniswap pools and routers
  • yearn: Yearn Finance vaults
  • compound-v2, compound-v3: Compound lending/borrowing
  • axelar: Cross-chain bridging

For a complete list of supported protocols, use the Projects API endpoint: GET /standards.

Updated