v1

latestOpenAPI 3.0.02026-07-26278284.4 KB
DeFi Shortcuts

Bundle a list of actions

Returns a single transaction bundling the submitted actions. For available actions, see /actions endpoint.

post/api/v1/shortcuts/bundle

Query parameters

chainIdnumber

Chain ID of the network to execute the transaction on

fromAddressstring required
Example:0xd8da6bf26964af9d7eed9e03e53415d37aa96045

Ethereum address of the wallet to send the transaction from

routingStrategy'ensowallet' | 'router' | 'delegate' | 'router-legacy' | 'delegate-legacy' nullable

Routing strategy to use. Use delegate when:

  • You want to specify spender
  • You want to use the harvest or deposit action with /bundle endpoint
receiverstring
Example:0xd8da6bf26964af9d7eed9e03e53415d37aa96045

Ethereum address of the receiver of the tokenOut

spenderstring
Example:0xd8da6bf26964af9d7eed9e03e53415d37aa96045

Ethereum address of the spender of the tokenIn

ignoreAggregatorsstring[] nullable

A list of swap aggregators to be ignored from consideration. See /aggregators endpoint for available aggregators

referralCodestring
Example:0123456789ABCDEF

Referral code that will be included in an on-chain event after encoding to hex. At most 16 characters.

refundReceiverstring
Example:0xd8da6bf26964af9d7eed9e03e53415d37aa96045

Ethereum address of the receiver of any dust tokens that might be produced during the execution of actions

skipQuoteboolean

Flag to skip quoting (if true, amountOut and gas will not be returned)

Request body

protocolstring required

Protocol to interact with

action'approve' | 'borrow' | 'borrowwithpositionid' | 'bridge' | 'deposit' | 'singledeposit' | 'singledepositwithpositionid' | 'multideposit' | 'tokenizedsingledeposit' | 'tokenizedmultideposit' | 'multioutsingledeposit' | 'depositclmm' | 'harvest' | 'permittransferfrom' | 'redeem' | 'singleredeem' | 'singleredeemwithpositionid' | 'multiredeem' | 'tokenizedsingleredeem' | 'tokenizedmultiredeem' | 'redeemclmm' | 'repay' | 'repaywithpositionid' | 'swap' | 'transfer' | 'transferfrom' | 'route' | 'call' | 'split' | 'merge' | 'balance' | 'minamountout' | 'slippage' | 'fee' | 'ensofee' | 'paymasterfee' required

Example request

[
  {
    "protocol": "enso",
    "action": "route",
    "args": {
      "primaryAddress": "0x38EA452219524Bb87e18dE1C24D3bB59510BD783",
      "destinationChainId": 42161,
      "tokenIn": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "amountIn": "1000000000",
      "receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
      "protocolArgs": {
        "transferType": "fast",
        "forwardFee": "high",
        "isHyperCoreTransfer": true
      }
    }
  }
]

Response

gasstring

Gas estimate for the transaction

amountsOutobject

Expected output amounts by token address

createdAtnumber required

Block number the transaction was created on

priceImpactnumber nullable required

Price impact in basis points, null if USD price not found

feeAmountobject required

Example response

{
  "bundle": [
    {
      "protocol": "enso",
      "action": "route",
      "args": {
        "primaryAddress": "0x38EA452219524Bb87e18dE1C24D3bB59510BD783",
        "destinationChainId": 42161,
        "tokenIn": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "amountIn": "1000000000",
        "receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
        "protocolArgs": {
          "transferType": "fast",
          "forwardFee": "high",
          "isHyperCoreTransfer": true
        }
      }
    }
  ]
}