# DeFi Strategy Shortcuts

### Getting Started <a href="#nfpw5it9ujqw" id="nfpw5it9ujqw"></a>

Enso's battle-tested [routing engine](https://docs.enso.build/pages/build/get-started/overview) provides a standardized interface to interact with  different protocols, despite their differences.&#x20;

**Routing APIs**. Both routing APIs return a transaction object—the executable form of the route, which executes atomically, regardless of the number of steps:

* [**/route API**](https://docs.enso.build/pages/build/get-started/route): Specify input/output tokens and run optimized execution paths
* [**/bundle API**](https://docs.enso.build/pages/build/get-started/bundling-actions): Chain custom shortcut blueprints that interact with various protocols by chaining different actions

**Utility APIs.** Additional APIs bring information about:

* supported [tokens](https://docs.enso.build/pages/build/get-started/protocol-data#filter-supported-tokens) with TVL and APY values,
* [available actions](https://docs.enso.build/pages/build/reference/actions) - the unified interaction interfaces used to build routes declaratively,
* supported [projects](https://docs.enso.build/api-reference/integration/projects) and [protocols](https://docs.enso.build/pages/build/get-started/protocol-data#get-supported-protocols),
* wallet [balanaces and DeFi positions](https://docs.enso.build/pages/build/get-started/balances) for any address.

{% hint style="success" %}
You can explore supported tokens and protocols using [Enso Navigator](https://navigator.enso.build/projects?\&chainId=98866).
{% endhint %}

To explore what's possible with Enso, check out [Routing Examples](#id-2x6l0spkqgtx), and for further ideas check out the [Shortcuts Library](https://docs.enso.build/pages/build/examples/shortcuts).

#### Integration <a href="#ya8r7adbju3f" id="ya8r7adbju3f"></a>

You can integrate Enso in your UI or backends in following ways:

* [Crosschain Route Widget](https://happypath.enso.build/)—a React component and a standalone application for frictionless token transfers. Whereas You can  [integrate into your own application](https://docs.enso.build/pages/templates/cross-chain-route-widget).
* REST [API](https://docs.enso.build/pages/api-reference/overview) & [SDK](https://github.com/EnsoBuild/sdk-ts) for a more controlled setup.

### Routing Examples <a href="#id-2x6l0spkqgtx" id="id-2x6l0spkqgtx"></a>

The following examples demonstrate how to use Enso's [GET /route API](https://docs.enso.build/pages/build/get-started/route) with protocols such as Mystic, Solera, Nucleus, Tempest, Dinero, and Origin.&#x20;

#### Basic Token Swap <a href="#y5b6lxw2d9e9" id="y5b6lxw2d9e9"></a>

The simplest route you can construct with Enso is a token swap. In this example, we're creating a path from bridged USDC.e to PUSD. The result will contain:

* `route.route`: The route object with the exact path and parameters
* `route.tx`: The transaction object that can be executed on-chain

{% tabs %}
{% tab title="SDK" %}

```typescript
const client = new EnsoClient({
  apiKey: 'your-api-key'
});

const route = await client.getRouteData({
  fromAddress: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  receiver: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  chainId: 98866,
  amountIn: ['1000000000000000000'],
  slippage: '300',
  tokenIn: ['0x54FD4da2Fa19Cf0f63d8f93A6EA5BEd3F9C042C6'],
  tokenOut: ['0xdddD73F5Df1F0DC31373357beAC77545dC5A6f3F'],
  routingStrategy: 'router'
});

console.log("Route", route.route);
console.log("Transaction", route.tx);
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl -X POST 'https://api.enso.finance/api/v1/shortcuts/route' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "fromAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "chainId": 98866,
    "amountIn": ["1000000000000000000"],
    "slippage": "300",
    "tokenIn": ["0x54FD4da2Fa19Cf0f63d8f93A6EA5BEd3F9C042C6"],
    "tokenOut": ["0xdddD73F5Df1F0DC31373357beAC77545dC5A6f3F"],
    "routingStrategy": "router"
  }' | jq
```

{% endtab %}
{% endtabs %}

#### Mystic Vaults: Depositing PLUME for myUSDC <a href="#tvugfc7g55rw" id="tvugfc7g55rw"></a>

The following call will construct a route for depositing **PLUME** (`tokenIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE`) as a collateral to get **myUSDC** (`tokenOut=0x6c92efa3F77760619bb13d395836415ac18C86dc`), with receiver address getting all output tokens.

Under the hood, the route designs two operations:

* swap PLUME (input token) for USDC.e
* deposit USDC.e into the myUSDC pool, interacting with primary `0xCE192A6E105cD8dd97b8Dedc5B5b263B52bb6AE0`

{% hint style="success" %}
The exact route is determined at runtime, and optimized against current market conditions.
{% endhint %}

Explore [Mystic Positions](https://navigator.enso.build/tokens?chainId=98866\&project=mystic).

{% tabs %}
{% tab title="SDK" %}

```typescript
const routeData = await client.getRouteData({
  fromAddress: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  receiver: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  chainId: 98866,
  amountIn: ['1000000000000000000'],
  slippage: '300',
  tokenIn: ['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'],
  tokenOut: ['0x6c92efa3F77760619bb13d395836415ac18C86dc'],
  routingStrategy: 'router'
});

console.log("Route", route.route);
console.log("Transaction", route.tx);
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl -X POST 'https://api.enso.finance/api/v1/shortcuts/route' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "fromAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "chainId": 98866,
    "amountIn": ["1000000000000000000"],
    "slippage": "300",
    "tokenIn": ["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"],
    "tokenOut": ["0x6c92efa3F77760619bb13d395836415ac18C86dc"],
    "routingStrategy": "router"
  }' | jq
```

{% endtab %}
{% endtabs %}

#### Solera: Depositing PLUME for aPlunALPHA <a href="#id-7m7tfee9rjmk" id="id-7m7tfee9rjmk"></a>

The following call will generate a route for depositing **PLUME** `tokenIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` as a collateral to get **aPlunALPHA** `tokenOut=0x5d0EC9B10e6759719CeFE14b8c881634678b32f2`, with receiver address getting all output tokens.

In this multi-step process, Enso saves you 2 transactions by constructing a route with:

* swap **PLUME** for **PUSD** using enso.swap action
* deposit **PUSD** into **NALPHA** Nucleus pool, interacting with primary `0xc9f6a492fb1d623690dc065bbced6dfb4a324a35`
* deposit **NALPHA** into the **Solera** pool, interacting with primary `0x5d0ec9b10e6759719cefe14b8c881634678b32f2`

Check out supported [Solera Vaults](https://navigator.enso.build/tokens?chainId=98866\&project=solera).

{% tabs %}
{% tab title="SDK" %}

```typescript
const routeData = await client.getRouteData({
  fromAddress: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  receiver: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  chainId: 98866,
  amountIn: ['1000000000000000'],
  slippage: '300',
  tokenIn: ['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'],
  tokenOut: ['0x5d0EC9B10e6759719CeFE14b8c881634678b32f2'],
  routingStrategy: 'router'
});
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl -X POST 'https://api.enso.finance/api/v1/shortcuts/route' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "fromAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "chainId": 98866,
    "amountIn": ["1000000000000000"],
    "slippage": "300",
    "tokenIn": ["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"],
    "tokenOut": ["0x5d0EC9B10e6759719CeFE14b8c881634678b32f2"],
    "routingStrategy": "router"
  }' | jq
```

{% endtab %}
{% endtabs %}

#### Nucleus: Depositing USDC.e into an nYIELD Vault <a href="#id-6uxukvvwf9aj" id="id-6uxukvvwf9aj"></a>

The following call will design a route for depositing USDC `tokenIn=0x78adD880A697070c1e765Ac44D65323a0DcCE913` as a collateral to get **nYIELD** `tokenOut=0x892dFF5257B39F7AFb7803Dd7C81E8ecDB6af3E8`, with receiver address getting all output tokens.

The internal mechanics of this route include:

* swap **USDC** for **PUSD** using enso.swap action
* deposit **PUSD** into **nYIELD** Nucleus pool, interacting with primary `0x92a735f600175fe9ba350a915572a86f68ebbe66` to get **nUSDY**

Browse through [Nucleus positions](https://navigator.enso.build/tokens?chainId=98866\&project=nucleus).

{% tabs %}
{% tab title="SDK" %}

```typescript
const routeData = await client.getRouteData({
  fromAddress: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  receiver: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  chainId: 98866,
  amountIn: ['1000000000'],
  slippage: '300',
  tokenIn: ['0x78adD880A697070c1e765Ac44D65323a0DcCE913'],
  tokenOut: ['0x892DFf5257B39f7afB7803dd7C81E8ECDB6af3E8'],
  routingStrategy: 'delegate'
});
console.log("Route", route.route);
console.log("Transaction", route.tx);
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl -X POST 'https://api.enso.finance/api/v1/shortcuts/route' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "fromAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "chainId": 98866,
    "amountIn": ["1000000000"],
    "slippage": "300",
    "tokenIn": ["0x78adD880A697070c1e765Ac44D65323a0DcCE913"],
    "tokenOut": ["0x892DFf5257B39f7afB7803dd7C81E8ECDB6af3E8"],
    "routingStrategy": "delegate"
  }' | jq
```

{% endtab %}
{% endtabs %}

#### Tempest: Depositing USDC.e into a Tempest Vault <a href="#id-7l2n4ch4sdsi" id="id-7l2n4ch4sdsi"></a>

At the protocol level, the route maps:

* swap **USDC.e** for **PUSD** using enso.swap action
* deposit **PUSD** into Tempest pool, interacting with primary `0x3c4f9804ce0810821f61289eb4f92c8e5007c119`

Explore [Tempest Positions](https://navigator.enso.build/tokens?chainId=98866\&project=tempest).

{% tabs %}
{% tab title="SDK" %}

```typescript
const routeData = await client.getRouteData({
  fromAddress: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  receiver: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  chainId: 98866,
  amountIn: ['1000000000'],
  slippage: '300',
  tokenIn: ['0x78adD880A697070c1e765Ac44D65323a0DcCE913'],
  tokenOut: ['0x3C4F9804ce0810821F61289Eb4F92c8E5007c119'],
  routingStrategy: 'delegate'
});
console.log("Route", route.route);
console.log("Transaction", route.tx);
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl -X POST 'https://api.enso.finance/api/v1/shortcuts/route' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "fromAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "chainId": 98866,
    "amountIn": ["1000000000"],
    "slippage": "300",
    "tokenIn": ["0x78adD880A697070c1e765Ac44D65323a0DcCE913"],
    "tokenOut": ["0x3C4F9804ce0810821F61289Eb4F92c8E5007c119"],
    "routingStrategy": "delegate"
  }' | jq
```

{% endtab %}
{% endtabs %}

#### Dinero: Staking PLUME for pETH <a href="#s32bxl541tdb" id="s32bxl541tdb"></a>

This call will generate a route for staking Plume as a collateral to get **pETH**.

The route will swap **PLUME** for **PUSD** using `enso.swap` action, and deposit **PUSD** into the Dinero pool, interacting with primary `0x3c4f9804ce0810821f61289eb4f92c8e5007c119`.

Explore [Dinero Positions](https://navigator.enso.build/tokens?chainId=98866\&project=dinero).

{% tabs %}
{% tab title="SDK" %}

```typescript
const routeData = await client.getRouteData({
  fromAddress: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  receiver: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  chainId: 98866,
  amountIn: ['1000000000'],
  slippage: '300',
  tokenIn: ['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'],
  tokenOut: ['0x39d1F90eF89C52dDA276194E9a832b484ee45574'],
  routingStrategy: 'delegate'
});
console.log("Route", route.route);
console.log("Transaction", route.tx);
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl -X POST 'https://api.enso.finance/api/v1/shortcuts/route' \
  -H 'Content-Type: application/json' \
  -d '{
    "fromAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "chainId": 98866,
    "amountIn": ["100000000000"],
    "slippage": 300,
    "tokenIn": ["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"],
    "tokenOut": ["0x39d1F90eF89C52dDA276194E9a832b484ee45574"],
    "routingStrategy": "delegate"
  }'
```

{% endtab %}
{% endtabs %}

#### Origin: Depositing USDC.e into an Origin Vault <a href="#id-7xl515rf4jhe" id="id-7xl515rf4jhe"></a>

This call will generate a route for depositing USDC.e as a collateral to get SUPEROETH, encapsulating the following steps:

* swap USDC.e for WETH using enso.swap action
* deposit PUSD into the Origin pool, interacting with primary

{% tabs %}
{% tab title="SDK" %}

```typescript
const routeData = await client.getRouteData({
  fromAddress: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  receiver: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  chainId: 98866,
  amountIn: ['1000000000'],
  slippage: '300',
  tokenIn: ['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'],
  tokenOut: ['0x39d1F90eF89C52dDA276194E9a832b484ee45574'],
  routingStrategy: 'delegate'
});
console.log("Route", route.route);
console.log("Transaction", route.tx);
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl -X POST 'https://api.enso.finance/api/v1/shortcuts/route' \
  -H 'Content-Type: application/json' \
  -d '{
    "fromAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "chainId": 98866,
    "amountIn": ["100000000000"],
    "slippage": 300,
    "tokenIn": ["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"],
    "tokenOut": ["0x39d1F90eF89C52dDA276194E9a832b484ee45574"],
    "routingStrategy": "delegate"
  }'
```

{% endtab %}
{% endtabs %}

Explore [Origin Positions](https://navigator.enso.build/tokens?chainId=98866\&project=origin-protocol).

#### Rooster: Depositing PUSD into a Rooster pool <a href="#jkemfzxik2pv" id="jkemfzxik2pv"></a>

This example requests a route for depositing PUSD into a Rooster pool, with the following steps:

* split PUSD to NALPHA and PUSD using the enso.split action
* deposit NALPHA and PUSD into the Rooster pool, interacting with primary 0xfc3bd0e01b4e755aedd2a4087ccdb90c4d28f038

Explore [Rooster Pools](https://navigator.enso.build/tokens?chainId=98866\&project=rooster).

{% tabs %}
{% tab title="SDK" %}

```javascript
const routeData = await client.getRouteData({
  fromAddress: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  receiver: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  chainId: 98866,
  amountIn: ['1000000000'],
  slippage: '300',
  tokenIn: ['0xdddd73f5df1f0dc31373357beac77545dc5a6f3f'],
  tokenOut: ['0xfc3bd0e01b4e755aedd2a4087ccdb90c4d28f038'],
  routingStrategy: 'delegate'
});
console.log("Route", route.route);
console.log("Transaction", route.tx);
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl -X POST 'https://api.enso.finance/api/v1/shortcuts/route' \
  -H 'Content-Type: application/json' \
  -d '{
    "amountIn": "100000000000",
    "tokenIn": "0xdddd73f5df1f0dc31373357beac77545dc5a6f3f",
    "tokenOut": "0xfc3bd0e01b4e755aedd2a4087ccdb90c4d28f038",
    "slippage": 25,
    "fromAddress": "0x93621DCA56fE26Cdee86e4F6B18E116e9758Ff11",
    "receiver": "0x93621DCA56fE26Cdee86e4F6B18E116e9758Ff11",
    "spender": "0x93621DCA56fE26Cdee86e4F6B18E116e9758Ff11",
    "routingStrategy": "router",
    "chainId": 98866
  }' | jq
```

{% endtab %}
{% endtabs %}

#### Nest: Depositing PUSD into a Nest Alpha Vault for NALPHA <a href="#th4ix27c4c4r" id="th4ix27c4c4r"></a>

This example requests a route for depositing PUSD into a Rooster pool, with the following steps:

* swap **PUSD** for **WETH** using the `enso.swap` action
* deposit **WETH** into the Nest pool, interacting with primary `0xc9f6a492fb1d623690dc065bbced6dfb4a324a35`

{% tabs %}
{% tab title="SDK" %}

```javascript
const routeData = await client.getRouteData({
  fromAddress: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  receiver: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
  chainId: 98866,
  amountIn: ['1000000000'],
  slippage: '300',
  tokenIn: ['0xca59ca09e5602fae8b629dee83ffa819741f14be'],
  tokenOut: ['0x593ccca4c4bf58b7526a4c164ceef4003c6388db'],
  routingStrategy: 'delegate'
});
console.log("Route", route.route);
console.log("Transaction", route.tx);
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl -X POST 'https://api.enso.finance/api/v1/shortcuts/route' \
  -H 'Content-Type: application/json' \
  -d '{
    "amountIn": "100000000000",
    "tokenIn": "0xca59ca09e5602fae8b629dee83ffa819741f14be",
    "tokenOut": "0x593ccca4c4bf58b7526a4c164ceef4003c6388db",
    "slippage": 25,
    "fromAddress": "0x93621DCA56fE26Cdee86e4F6B18E116e9758Ff11",
    "receiver": "0x93621DCA56fE26Cdee86e4F6B18E116e9758Ff11",
    "spender": "0x93621DCA56fE26Cdee86e4F6B18E116e9758Ff11",
    "routingStrategy": "router",
    "chainId": 98866
  }' | jq
```

{% endtab %}
{% endtabs %}

### Resources <a href="#ekshrbdtzrk5" id="ekshrbdtzrk5"></a>

* [Enso Website](https://enso.build/)
* [Crosschain Route Widget](https://happypath.enso.build/)
* [Developer Docs](https://docs.enso.build/)
* [Shortcuts Library](https://docs.enso.build/pages/build/examples/shortcuts)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.plume.org/plume/developers/defi-strategy-shortcuts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
