Skip to main content
The Bundle API builds one transaction from an ordered array of actions selected by your product. Use it for custom sequencing, dynamic outputs, checks, fees, flashloans, or protocol actions that do not fit a single Route API request.
If Enso should choose the entire path into one destination, start with the Route API. See Route API vs Bundle API before building a custom sequence.
Actions executed in one same-chain transaction succeed or revert together. Cross-chain delivery is different: the source transaction completes first, then the callback executes on the destination chain. A destination callback failure cannot revert a finalized source-chain bridge.

Before you start

  1. Create and verify an API key.
  2. Choose a supported chain, protocol, and public action.
  3. Use the Bundle Actions Reference for action inputs and outputs.
  4. Use supported actions and the per-protocol action endpoint for current protocol availability.

Request anatomy

The request body is the action array directly:
Do not wrap the array in { "bundle": [...] }. Wallet and execution settings belong in query parameters for REST, or in the first argument to getBundleData in the SDK.

Request options

Action structure

Every action has three fields:
  • protocol selects the Enso meta-action or protocol integration.
  • action selects a public action supported by that protocol.
  • args contains the action-specific inputs.
Protocol action inputs are not universal. Query the current per-protocol action metadata instead of assuming every deposit, redeem, or swap accepts the same fields.

Amounts and native assets

Use decimal strings in the token’s smallest base unit. Do not use JavaScript numbers for token amounts.
  • "1000000" is 1 USDC when the token has 6 decimals.
  • "1000000000000000000" is 1 ETH or one 18-decimal token.
  • Use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee for the native asset.
When native value is involved, send the returned tx.value exactly as provided.

Chain action outputs

A later action can consume an earlier action’s output:
If the producer returns an array, select an item explicitly:
References are zero-based and must point to an earlier output. Array outputs require index. Some checks do not expose a normal consumable output; consult the action output table before chaining them.

Receivers and intermediate assets

The query-level receiver is the default recipient for final outputs. An action-level receiver overrides recipient behavior for that action when supported. refundReceiver is for dust or applicable cross-chain refunds. Do not send every intermediate output to the user. Assets consumed by later actions must remain with the executing account until the sequence completes.

Example: route into a deposit

This source-backed example routes native ETH into rETH and deposits the route output into Aave. The deposit consumes action 0 dynamically.
Equivalent REST request:

Example: consume an array output

split returns one output per tokenOut. The following CLMM deposit selects both outputs explicitly.
For CLMM flows that require explicit protection for the internal swaps, slippage checks can sit between split and depositclmm. They reference the split outputs; they do not need to appear after the final deposit.

Example: route fee

Route fees are deducted from the corresponding input amounts before routing. fee is an array aligned with amountIn; "100" is 1%.
For a standalone fee step that returns the net amount, use the public enso:fee action.

Example: bridge callback

A bridge callback executes later on the destination chain. For supported callback bridges, the callback must begin with enso:balance; callback output references are local to the callback array.
After submitting the source transaction, monitor Bridge Status. Bridge-provider callback capabilities and refund behavior differ; see Crosschain Routing.

Execute the response

Building a bundle does not submit it.
  1. Inspect approvals. Submit each required approval transaction before the bundle transaction.
  2. Submit tx unchanged, including to, data, and value.
  3. Do not submit an expired quote; respect validUntil when present.
  4. For cross-chain bundles, monitor bridge and destination status after source confirmation.

Response fields

When skipQuote=true, quote-dependent fields such as output amounts and gas may be absent.

Limits and common errors

See the FAQ and Bundle Actions Reference for action-specific constraints.

Next steps

Bundle Actions Reference

Review public action inputs, outputs, fees, checks, and composition rules.

API Reference

Inspect the exact Bundle endpoint request and response schema.

Routing Strategies

Understand execution-account and approval behavior.

Crosschain Routing

Choose bridge protocols and monitor asynchronous destination execution.