Introduction

What is the Bundle API?

The Bundle API is a powerful tool within the Enso API suite that lets developers pack several DeFi actions into one single transaction. This REST API is designed for simplicity and effectiveness. With just one API call, you can trigger several operations, making your interaction with various DeFi simpler and cheaper.

The Bundle API excels in gas optimization. The more transactions you bundle, the more you can save on gas fees. This makes it an economical choice for users seeking to execute multiple operations efficiently in the DeFi space.

💡

Only delegate call transactions are supported with Bundle API

Seamless Multi-Protocol Bundling

From entering and exiting positions to multi-token swaps, the Bundle API supports bundling across a wide range of DeFi protocols, including:

  • Liquidity pools
  • Lending platforms
  • Automated market makers (AMMs)
  • Yield optimizers
  • And more

The Bundle API takes care of optimizing the execution sequence and estimating the gas costs for the bundled actions, providing users with a clear picture of the transaction before execution.

Gas Savings

More transactions bundled together means more gas savings. The Bundle API is designed to optimize the execution sequence of the bundled actions, which can result in significant gas savings:


Gas Chart
💡

Try out the bundle

👉 Run this curl request to see a live route response for entering into a steCRV Curve pool and stETH position with ETH

 
curl -X POST \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer 1e02632d-6feb-4a75-a157-documentation' \
  -d '[
    {
      "protocol": "enso",
      "action": "route",
      "args": {
        "tokenIn": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
        "tokenOut": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
        "amountIn": "1000000000"
      }
    },
    {
      "protocol": "enso",
      "action": "route",
      "args": {
        "tokenIn": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
        "tokenOut": "0x06325440d014e39736583c165c2963ba99faf14e",
        "amountIn": "1000000000"
      }
    }
  ]' \
  'https://api.enso.finance/api/v1/shortcuts/bundle?chainId=1&fromAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&routingStrategy=delegate'

👉 Or try it out in the Swagger UI (opens in a new tab)

Understanding the process

Suppose you want to enter the steCRV Curve pool and stETH with WETH. With the bundle endpoint, you only need to specify 2 actions:

  • route action from ETH to stETH
  • route action from ETH to steCRV Curve pool

Enso will handle a swap with specified tokenIn to the required token (if needed), deposit the LP into the Curve Gauge and stake the LP tokens into the Curve Gauge.