Actions are interactions with DeFi protocols Enso supports.
route
do the job? route
API might be the simpler way to route your assets.
Before using the bundle API, check if route
would work using happypath./integration/actions
.
standards/{slug}/
.useOutputOfCallAt
syntax.
For array-outputs such as split
, you can specify the index within that action’s output array
route
swap
, deposit
, and redeem
actions, similar to /route
API.
The /bundle
API will return a route
object that contains a list of all such actions.
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 one of slippage protection actionsParameter | Description | Required |
---|---|---|
tokenIn | Address of the token to send. For ETH, use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee | Yes |
tokenOut | Address of the token to receive | Yes |
amountIn | Amount of tokenIn to send in wei (with full decimals) | Yes |
slippage | Slippage tolerance in basis points (100 = 1%) | No |
receiver | Address to receive the output tokens if not the caller | No |
primaryAddress | Optional address of the router or primary contract to use | No |
poolFee | Optional pool fee in basis points when using specific pools | No |
swap
Parameter | Description | Required |
---|---|---|
tokenIn | Address of token to swap from | Yes |
tokenOut | Address of token to swap to | Yes |
amountIn | Amount of tokenIn to swap in wei (with full decimals) | Yes |
primaryAddress | Address of the router or pool contract | No |
receiver | Address to receive the output tokens | Yes |
slippage | Slippage tolerance in basis points (100 = 1%) | No |
poolFee | Optional pool fee in basis points when using specific pools | No |
deposit
Parameter | Description | Required |
---|---|---|
tokenIn | Address of token to deposit. Can be a single address or an array for multiple tokens | Yes |
tokenOut | Address of token to receive. Can be a single address or an array for multiple tokens | No |
amountIn | Amount of tokenIn to deposit in wei (with full decimals). Can be a single value or an array for multiple tokens | Yes |
primaryAddress | Address of the protocol contract to interact with | Yes |
receiver | Address to receive the output tokens if not the caller | No |
redeem
Parameter | Description | Required |
---|---|---|
tokenIn | Address of shares/tokens to redeem | No |
tokenOut | Address of token(s) to receive upon redemption. Can be a single address or an array | Yes |
amountIn | Amount of shares/tokens to redeem in wei (with full decimals) | Yes |
primaryAddress | Address of the contract to interact with | Yes |
receiver | Address to receive the output tokens if not the caller | No |
route
action includes configurable slippage protection by default, but other actions require manual slippage configuration.
slippage
or minAmountOut
actions to prevent price impact.slippage
bps
) 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.
Parameter | Description | Required |
---|---|---|
amountOut | Expected output amount - must be output of one of previous actions useOutputOfCallAt | Yes |
bps | Maximum acceptable slippage in basis points (1 bps = 0.01%, 100 bps = 1%) | Yes |
minAmountOut
minAmountOut
) to ensure the received amount is within the acceptable range of the expected output.
Parameter | Description | Required |
---|---|---|
amountOut | Expected output amount - must be output of one of previous actions useOutputOfCallAt | Yes |
minAmountOut | Minimum acceptable amount of out token | Yes |
depositCLMM
Parameter | Description | Required |
---|---|---|
tokenIn | Array of addresses of tokens to deposit (usually 2 tokens) | Yes |
tokenOut | Address of the position NFT to receive | Yes |
amountIn | Array of amounts to deposit in wei (with full decimals). Must match the length of tokenIn array | Yes |
ticks | Array containing lower and upper tick bounds defining the price range | Yes |
poolFee | Pool fee tier in basis points (e.g., 3000 for 0.3%) | Yes |
receiver | Address to receive the position NFT if not the caller | No |
redeemCLMM
Parameter | Description | Required |
---|---|---|
tokenIn | Address of the position NFT token | Yes |
tokenOut | Array of addresses of tokens to receive | Yes |
liquidity | Amount of liquidity to withdraw | Yes |
tokenId | ID of the position NFT | Yes |
receiver | Address to receive the underlying tokens if not the caller | No |
singleDeposit
deposit
action for single token deposits.
Parameter | Description | Required |
---|---|---|
tokenIn | Address of the single token to deposit | Yes |
tokenOut | Address of the token to receive (usually a receipt or share token) | No |
amountIn | Amount of tokenIn to deposit in wei (with full decimals) | Yes |
primaryAddress | Address of the protocol contract to interact with | Yes |
receiver | Address to receive the output tokens if not the caller | No |
multiDeposit
Parameter | Description | Required |
---|---|---|
tokenIn | Array of addresses of tokens to deposit | Yes |
tokenOut | Address of the LP token or receipt token to receive | No |
amountIn | Array of amounts to deposit in wei (with full decimals). Must match the length of tokenIn array | Yes |
primaryAddress | Address of the pool or protocol contract to interact with | Yes |
receiver | Address to receive the LP tokens if not the caller | No |
tokenizedSingleDeposit
singleDeposit
with the appropriate protocol. It will be removed in a future API version.Parameter | Description | Required |
---|---|---|
tokenIn | Address of token to deposit | Yes |
tokenOut | Address of tokenized position to receive | Yes |
amountIn | Amount of tokenIn to deposit in wei (with full decimals) | Yes |
primaryAddress | Address of the protocol contract to interact with | Yes |
receiver | Address to receive the position tokens if not the caller | No |
tokenizedMultiDeposit
multiDeposit
with the appropriate protocol. It will be removed in a future API version.Parameter | Description | Required |
---|---|---|
tokenIn | Array of addresses of tokens to deposit | Yes |
tokenOut | Address of the tokenized position to receive | Yes |
amountIn | Array of amounts to deposit in wei (with full decimals). Must match the length of tokenIn array | Yes |
primaryAddress | Address of the protocol contract to interact with | Yes |
receiver | Address to receive the position token if not the caller | No |
multiOutSingleDeposit
Parameter | Description | Required |
---|---|---|
tokenIn | Address of the single token to deposit | Yes |
tokenOut | Array of addresses of tokens to receive | Yes |
amountIn | Amount of tokenIn to deposit in wei (with full decimals) | Yes |
primaryAddress | Address of the protocol contract to interact with | Yes |
receiver | Address to receive the output tokens if not the caller | No |
borrow
Parameter | Description | Required |
---|---|---|
collateral | Address of the token used as collateral. Can be an array for multiple collateral tokens | Yes |
tokenOut | Address of the token to borrow | Yes |
amountOut | Amount to borrow in wei (with full decimals) | Yes |
primaryAddress | Address of the lending pool contract | Yes |
repay
Parameter | Description | Required |
---|---|---|
tokenIn | Address of token to repay | Yes |
amountIn | Amount to repay in wei (with full decimals) | Yes |
primaryAddress | Address of the lending pool contract | Yes |
onBehalfOf | Address to repay debt for | Yes |
repay
on Behalf of Another addressonBehalfOf
enables you to repay a loan on behalf of a given address:
harvest
Parameter | Description | Required |
---|---|---|
token | Address of token to harvest rewards for | Yes |
primaryAddress | Address of the contract to interact with (e.g., gauge, farm) | Yes |
approve
Parameter | Description | Required |
---|---|---|
token | Address of the token to approve | Yes |
spender | Address of the spender (protocol or router) | Yes |
amount | Amount to approve in wei (with full decimals) | Yes |
transfer
Parameter | Description | Required |
---|---|---|
token | Address of the token to transfer | Yes |
receiver | Address of the recipient | Yes |
amount | Amount to transfer in wei (with full decimals) | Yes |
id | Token ID for ERC721 or ERC1155 tokens | No |
transferFrom
Parameter | Description | Required |
---|---|---|
token | Address of the token to transfer | Yes |
sender | Address of the sender | Yes |
receiver | Address of the recipient | Yes |
amount | Amount to transfer in wei (with full decimals) | Yes |
id | Token ID for ERC721 or ERC1155 tokens | No |
permitTransferFrom
Parameter | Description | Required |
---|---|---|
token | Address of the token to transfer. Can be an array for multiple tokens | Yes |
amount | Amount to transfer in wei (with full decimals). Can be an array for multiple tokens | Yes |
sender | Address of the sender | Yes |
receiver | Address of the recipient | Yes |
nonce | Nonce value to prevent signature replay | Yes |
deadline | Timestamp after which the signature is invalid | Yes |
signature | The EIP-2612 permit signature | Yes |
bridge
callback
array), it can automatically execute a series of actions on the destination chain once tokens arrive.
useOutputOfCallAt
syntax to create complex cross-chain operations. Each callback action is executed sequentially on the destination chain.Parameter | Description | Required |
---|---|---|
primaryAddress | Source bridge pool address | Yes |
destinationChainId | Target blockchain network ID | Yes |
tokenIn | Token address to bridge from source chain | Yes |
amountIn | Amount to bridge (with full decimals) or a reference to a previous action’s output | Yes |
receiver | Address to receive bridged tokens on destination chain | Yes |
callback | Array of actions to execute on the destination chain after bridging (must start with balance action) | No |
balance
Parameter | Description | Required |
---|---|---|
token | Address of the token to check balance | Yes |
split
Parameter | Description | Required |
---|---|---|
tokenIn | Address of the token to split | Yes |
tokenOut | Array of token addresses for the split outputs | Yes |
amountIn | Amount to split in wei (with full decimals) | Yes |
receiver | Address to receive the split tokens | No |
merge
Parameter | Description | Required |
---|---|---|
tokenIn | Array of input token addresses | Yes |
tokenOut | Address of the output token | Yes |
amountIn | Array of amounts to merge (must be in the same denomination) | Yes |
receiver | Address to receive the merged tokens | No |
call
Parameter | Description | Required |
---|---|---|
address | Address of the contract to call | Yes |
method | Name of the method to call | Yes |
abi | ABI signature of the method | Yes |
args | Array of arguments to pass to the method | Yes |
fee
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
.
Parameter | Description | Required |
---|---|---|
token | Token address to apply the fee to | Yes |
amount | Amount to apply the fee to (with full decimals) or a return value from a previous action | Yes |
bps | Fee percentage in basis points (1 bps = 0.01%, 100 bps = 1%) | Yes |
receiver | Address to receive the fee | Yes |
aave-v2
, aave-v3
: Aave lending/borrowingbalancer-v2
: Balancer liquidity poolscurve
: Curve Finance stable swaps and gaugescurve-gauge
: Curve gauges for stakingerc20
: Standard token operationserc4626
: ERC4626 vaultsenso
: General Enso operations including route and arbitrary callspermit2
: Uniswap’s Permit2 operationsuniswap-v2
, uniswap-v3
: Uniswap pools and routersyearn
: Yearn Finance vaultscompound-v2
, compound-v3
: Compound lending/borrowingstargate
: Cross-chain bridging/standards
.
Updated