Multichain API
Introduction
💡

This is an experimental endpoint

What is the Multichain API?

The Multichain API is an experimental, cutting-edge DeFi aggregation and smart order routing REST API that extends its functionalities across multiple blockchain networks. Utilizing socket.it (opens in a new tab) technology, this API enables developers to seamlessly execute multi-token swaps and establish DeFi positions not just within a single blockchain, but across various chains.

With a single API integration, unlock a host of DeFi strategies in your application. The Route API finds the optimal execution path across a multitude of DeFi protocols such as liquidity pools, lending platforms, automated market makers, yield optimizers, and more.

💡

Try it out:

👉 Run this curl request to see a live route response for entering a Curve position on mainnet from arbitrum.

curl -X 'POST' \
  'https://api.enso.finance/api/experimental/multichain/shortcut/route' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "amountIn": "1000000000000000000",
  "slippage": "300",
  "in": {
    "sourceChainId": 42161,
    "token": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
  },
  "out": {
    "destinationChainId": 1,
    "token": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84"
  },
  "fromAddress": "0x93621DCA56fE26Cdee86e4F6B18E116e9758Ff11"
}'

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

Will return a response like this:

{
  "createdAt": 127341044,
  "tx": {
    "from": "0x93621DCA56fE26Cdee86e4F6B18E116e9758Ff11",
    "chainId": 42161,
    "value": "0x0e1f9a8516226949",
    "to": "0x3a23F943181408EAC424116Af7b7790c94Cb97a5",
    "data": "0x0000018ab1f98a6500000000000000000000000093621dca56fe26cdee86e4f6b18e116e9758ff11000000000000000000000000362c116779d2d27f822a497e4650b6e2616d38590000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000000000000000000000000000000000000000000d00000000000000000000000000000000000000000000000000000000000c18720000000000000000000000000000000000000000000000000dc4fdec76c2119f000000000000000000000000000000000000000000000000003ee3d16ebe69490000000000000000000000000000000000000000000000000000000000000065000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008c90000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b60000000000000000000000000c6457fb90677430e1b62ade8756c72cd0915135200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000ae4fdb09f3c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000970a082310100ffffffffff06ae7ab96520de3a18e5e111b5eaab095312d7fe8419198595a30182ffffffff82def1c0ded9bec7f1a1670819833240f027b25eff9bd3b227018203ffffffff026675a323dedb77822fcf39eaa9d682f6abe72555ddcd52200102ffffffffff027e7d64d987cab6eed08a191c4c2459daf2f8ed0b6e7a43a3010204ffffffff027e7d64d987cab6eed08a191c4c2459daf2f8ed0b241c59120102ffffffffffff7e7d64d987cab6eed08a191c4c2459daf2f8ed0b70a082310100ffffffffff00ae7ab96520de3a18e5e111b5eaab095312d7fe84b67d77c5010006ffffffff00ca99eaa38e8f37a168214a3a57c9a45a58563ed5a9059cbb010500ffffffffffae7ab96520de3a18e5e111b5eaab095312d7fe84000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000086000000000000000000000000000000000000000000000000000000000000008a000000000000000000000000000000000000000000000000000000000000008e000000000000000000000000000000000000000000000000000000000000009200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c6457fb90677430e1b62ade8756c72cd0915135200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000006c8415565b0000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe840000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000d76e1f9576d3eb300000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000210000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000001437572766500000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000d76e1f9576d3eb300000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dc24316b9ae028f1497c275eb9192a3ea0f670223df021240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000000000000000000869584cd0000000000000000000000001000000000000000000000000000000000000011000000000000000000000000000000004ee3b9b7a6c4c9a803401f89d21a08130000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000d76e1f9576d3ed3000000000000000000000000000000000000000000000000000000000000002000000000000000000000000093621dca56fe26cdee86e4f6b18e116e9758ff11000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  }
}

The response will contain a valid transaction that you can broadcast to the network and a simulation of the transaction itself.