bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 35쪽 중 28쪽
t: { useOutputOfCallAt: 4 },
bps: 200, // 2% slippage
},
},
],
},
},
]
);
```
<div>
<p>Updated </p>
</div>
# Overview
Source: https://docs.enso.build/pages/use-cases/dexes-aggregators/index
Crosschain DeFi automation for LP provisioning, yield optimization, and multi-protocol position management
## Liquidity Provision
<div>
<Card href="/pages/use-cases/dexes-aggregators/zap-to-liquidity" title="Zap to Add Liquidity">
Simplify liquidity provision to DeFi pools with a single transaction across multiple DEXs and chains.
</Card>
<Card href="/pages/use-cases/dexes-aggregators/provision-lp" title="Uniswap V3 Concentrated Liquidity">
Provide concentrated liquidity to Uniswap V3 pools with automated token splitting and position management.
</Card>
</div>
## Position Management
<div>
<Card href="/pages/use-cases/dexes-aggregators/position-migration" title="Position Migration">
Make it easy for users to migrate positions between different protocols and assets.
</Card>
<Card href="/pages/use-cases/dexes-aggregators/convex-yield-farming" title="Curve Convex Yield Farming">
Deposit into Curve pools and stake LP tokens in Convex for boosted CRV rewards.
</Card>
</div>
## Crosschain Operations
<div>
<Card href="/pages/use-cases/dexes-aggregators/crosschain-lp" title="Crosschain Liquidity Provision">
Provision liquidity across chains using Enso bridge action with seamless cross-chain operations.
</Card>
</div>
# Position Migration
Source: https://docs.enso.build/pages/use-cases/dexes-aggregators/position-migration
Make it easy for users to migrate positions between different protocols and assets.
## Rebalance Nest Alpha Vault into Rooster LP on Plume
This use case rebalances a Nest Alpha Vault position into a Rooster Finance YAP (nALPHA/pUSD) liquidity pool.
[**Try this route →**](https://happypath.enso.build?chainId=98866\&tokenIn=0x593ccca4c4bf58b7526a4c164ceef4003c6388db\&tokenOut=0xfc3bd0e01b4e755aedd2a4087ccdb90c4d28f038)
**Route Mechanics**:
* The bundle first splits the input NestAlphaVault token
* A portion of the original token is paired with an equal value of pUSD obtained through a swap using the rooster protocol
* Both assets are then deposited into a rooster-yap liquidity pool to form the final LP position
```mermaid theme={null}
flowchart LR
NEST((NEST)) --> SPLIT{enso.split}
SPLIT -->|rooster<br/>swap| PUSD((PUSD))
SPLIT -->|keep as<br/>NALPHA| NALPHA((NALPHA))
PUSD -->|rooster-yap<br/>deposit| ROOSTER_LP((ROOSTER_LP))
NALPHA -->|rooster-yap<br/>deposit| ROOSTER_LP
```
```ts theme={null}
const BERACHAIN_CHAIN = 80094;
const OPTIMISM_CHAIN = 10;
const ARBITRUM_CHAIN = 42161;
const ETHEREUM_CHAIN = 1;
const PLUME_CHAIN = 98866;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;
/**
* Rebalances a Nest Alpha Vault position into a Rooster Finance YAP (nALPHA/pUSD) liquidity pool on Plume.
* @returns The route and transaction objects.
*/
export async function rebalanceNestToRoosterLp(): {
const NestAlphaVault: Address = "0x593ccca4c4bf58b7526a4c164ceef4003c6388db";
const RoosterYAPLP: Address = "0xfc3bd0e01b4e755aedd2a4087ccdb90c4d28f038";
const routeParams: RouteParams = {
fromAddress: userAddress,
receiver: userAddress,
chainId: PLUME_CHAIN,
amountIn: ["1000000000"], // 1000 NALPHA tokens
tokenIn: [NestAlphaVault],
tokenOut: [RoosterYAPLP],
routingStrategy: 'router'
};
const route = await client.getRouteData(routeParams);
await sendEoa(route.tx, route.gas);
return route;
}
```
***
## Rebalance yHONEY Vault into Kodiak HONEY/WBERA LP
Redeem yHONEY vault shares and use the underlying assets to create a Kodiak BERA/HONEY LP position.
[**Try this route →**](https://happypath.enso.build?chainId=80094\&tokenIn=0xC82971BcFF09171e16Ac08AEE9f4EA3fB16C3BDC\&tokenOut=0x9659dc8c1565E0bd82627267e3b4eEd1a377ebE6)
```mermaid theme={null}
flowchart LR
yHONEY((yHONEY)) -->|bearn<br/>redeem| HONEY((HONEY))
HONEY --> SPLIT{enso.split}
SPLIT -->|enso<br/>route| WBERA((WBERA))
SPLIT -->|keep as<br/>HONEY| HONEY_KEPT((HONEY))
WBERA -->|kodiak-islands<br/>deposit| LP((HONEY/WBERA LP))
HONEY_KEPT -->|kodiak-islands<br/>deposit| LP
```
```javascript theme={null}
import { Address, EnsoClient, RouteParams } from "@ensofinance/sdk";
const BERACHAIN_MAINNET = 80094;
const userAddress = "your-wallet-address" as Address;
const yHONEY = "0xC82971BcFF09171e16Ac08AEE9f4EA3fB16C3BDC" as Address;
const HONEY_WBERA_POOL = "0x9659dc8c1565E0bd82627267e3b4eEd1a377ebE6" as Address; // HONEY/WBERA LP
const routeParams: RouteParams = {
fromAddress: userAddress,
receiver: userAddress,
chainId: BERACHAIN_MAINNET,
amountIn: ["1500000000000000000"], // 1.5 yHONEY
tokenIn: [yHONEY],
tokenOut: [HONEY_WBERA_POOL],
routingStrategy: "delegate",
slippage: "200", // 2% slippage for yield token pairing
referralCode: "yhoney-island",
};
const route = await client.getRouteData(routeParams);
await sendSmartWallet(route.tx, route.gas);
```
**Route Mechanics:**
* Redeem `yHONEY` vault shares to receive `HONEY`.
* Split `HONEY` into `HONEY` and `WBERA` through internal routing.
* Deposit balanced tokens into Kodiak Islands `HONEY/WBERA` pool.
***
<div>
<p>Updated </p>
</div>
# Uniswap V3 Concentrated Liquidity
Source: https://docs.enso.build/pages/use-cases/dexes-aggregators/provision-lp
Provide concentrated liquidity to Uniswap V3 pools with automated token splitting and position management
This use case demonstrates providing concentrated liquidity to a Uniswap V3 pool by automatically splitting a single token input.
**Route Mechanics:**
* Split the input AAVE token into two equal parts using Enso's internal routing
* Convert the first half to WETH to match the pool's token pair requirements
* Deposit both tokens into the Uniswap V3 AAVE/WETH pool with specified tick ranges
* Receive NFT position representing the concentrated liquidity position
```mermaid theme={null}
flowchart LR
AAVE((AAVE)) --> SPLIT{enso.split}
SPLIT -->|uniswap-v3<br/>swap| WETH((WETH))
SPLIT -->|keep as<br/>AAVE| AAVE_KEPT((AAVE))
WETH -->|uniswap-v3<br/>depositclmm| LP_POSITION((LP Position))
AAVE_KEPT -->|uniswap-v3<br/>depositclmm| LP_POSITION
```
```typescript theme={null}
const chainId = 42161; // Arbitrum
const fromAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045";
// Token and Protocol Addresses
const tokenIn_AAVE = "0xba5ddd1f9d7f570dc94a51479a000e3bce967196";
const tokenOut_WETH = "0x82af49447d8a07e3bd95bd0d56f35241523fbab1";
const uniswapManager = "0xc36442b4a4522e871399cd717abdd847ab11fe88";
// Define amount
const amountIn = parseUnits("10", 18); // 10 AAVE
const bundle = await client.getBundleData(
{
chainId,
fromAddress,
routingStrategy: "router",
},
[
{
// Split AAVE into 2 equal parts
// Converts the first half into WETH
// needed for AAVE/WETH pool
protocol: "enso",
action: "split",
args: {
tokenIn: tokenIn_AAVE,
tokenOut: [tokenOut_WETH, tokenIn_AAVE],
amountIn: amountIn.toString(),
},
},
{
protocol: "uniswap-v3",
action: "depositclmm",
args: {
tokenOut: uniswapManager,
ticks: [25320, 25980],
tokenIn: [tokenOut_WETH, tokenIn_AAVE],
poolFee: "3000",
amountIn: [
// use output from the split call
{ useOutputOfCallAt: 0, index: 0 },
{ useOutputOfCallAt: 0, index: 1 },
],
},
},
]
);
const approvalData = await client.getApprovalData({
amount: amountIn.toString(),
chainId,
fromAddress,
tokenAddress: tokenIn_AAVE,
});
```
**Important Considerations:**
* Tick ranges determine the price range for concentrated liquidity
* Pool fee tier affects trading volume and potential returns
* Position requires active management as price moves outside the range
<div>
<p>Updated </p>
</div>
# Zap to Add Liquidity
Source: https://docs.enso.build/pages/use-cases/dexes-aggregators/zap-to-liquidity
Simplify liquidity provision to DeFi pools with a single transaction.
## Zap BERA to BEX WBERA/HONEY LP on Berachain
This use case adds liquidity to the primary stable-native pair on the Berachain BEX.
[**Try this route →**](https://happypath.enso.build?chainId=80094\&tokenIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE\&tokenOut=0x0277d40b08ac168518c524418f1b3c16adae0f0d)
**Route Mechanics:**
* splits the input BERA token using an internal enso router.
* creates two components: a portion is swapped for HONEY on a DEX, and the other portion is used to provide liquidity directly with WBERA.
* both assets are then deposited into the BEX protocol to form the LP position
```mermaid theme={null}
flowchart LR
BERA((BERA)) --> SPLIT{enso.split}
SPLIT -->|ooga-booga<br/>swap| HONEY((HONEY))
SPLIT -->|infrared-ibera<br/>deposit| iBERA((iBERA))
SPLIT -->|openocean<br/>swap| USDC((USDC))
HONEY -->|bex<br/>deposit| BEX_LP((BEX_LP))
iBERA -->|bex<br/>deposit| BEX_LP
USDC -->|bex<br/>deposit| BEX_LP
```
```ts theme={null}
const BERACHAIN_CHAIN = 80094;
const OPTIMISM_CHAIN = 10;
const ARBITRUM_CHAIN = 42161;
const ETHEREUM_CHAIN = 1;
const PLUME_CHAIN = 98866;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;
/**
* Zaps native BERA into the BEX WBERA/HONEY liquidity pool on Berachain.
* @returns The route and transaction objects.
*/
export async function zapBeraToBexLp(): {
const BERA: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
const BEX_WBERA_HONEY_LP: Address = "0x0277d40b08ac168518c524418f1b3c16adae0f0d";
const routeParams: RouteParams = {
fromAddress: userAddress,
receiver: userAddress,
chainId: BERACHAIN_CHAIN,
amountIn: ["1000000000000000000"], // 1 BERA
tokenIn: [BERA],
tokenOut: [BEX_WBERA_HONEY_LP],
routingStrategy: 'router'
};
const route = await client.getRouteData(routeParams);
await sendEoa(route.tx, route.gas);
return route;
}
```
***
## Zap ETH into a Velodrome LP on Optimism
This use case demonstrates a single transaction to provide liquidity to a Velodrome v2 pool.
[**Try this route →**](https://happypath.enso.build?chainId=10\&tokenIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE\&tokenOut=0xa3031D9FD5010496a2bAF8AFCE27Ef6f3849FB10)
**Route Mechanics:**
* splits the input ETH token. One portion is wrapped into WETH using wrapped-native, while the other is swapped for wstETH using the openocean protocol.
* both assets are deposited into a velodrome-v2 liquidity pool
```mermaid theme={null}
flowchart LR
ETH((ETH)) --> SPLIT{enso.split}
SPLIT -->|wrapped-native<br/>deposit| WETH((WETH))
SPLIT -->|openocean<br/>swap| OP((OP))
WETH -->|velodrome-v2<br/>deposit| VELO_LP((VELO_LP))
OP -->|velodrome-v2<br/>deposit| VELO_LP
```
```ts theme={null}
const BERACHAIN_CHAIN = 80094;
const OPTIMISM_CHAIN = 10;
const ARBITRUM_CHAIN = 42161;
const ETHEREUM_CHAIN = 1;
const PLUME_CHAIN = 98866;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;
/**
* Zaps ETH into a Velodrome wstETH/WETH liquidity pool on Optimism.
* @returns The route and transaction objects.
*/
export async function zapEthToVelodromeLp(): {
const ETH: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
const veloWstethWethLp: Address = "0xa3031D9FD5010496a2bAF8AFCE27Ef6f3849FB10";
const routeParams: RouteParams = {
fromAddress: userAddress,
receiver: userAddress,
chainId: OPTIMISM_CHAIN,
amountIn: ["1000000000000000000"], // 1 ETH
tokenIn: [ETH],
tokenOut: [veloWstethWethLp],
routingStrategy: 'router'
};
const route = await client.getRouteData(routeParams);
await sendEoa(route.tx, route.gas);
return route;
}
```
***
## Zap ETH to SushiSwap ARB/WETH LP on Arbitrum
This use case provides liquidity to a popular v3 pool on Sushiswap.
[**Try this route →**](https://happypath.enso.build?chainId=42161\&tokenIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE\&tokenOut=0x905dfcd5649217c42684f23958568e533c711aa3)
**Route Mechanics:**
* Split ETH into two portions using enso internal routing:
* First portion: swap ETH to USDC.e using 1inch protocol
* Second portion: deposit ETH into wrapped native to get WETH
* Deposit both USDC.e and WETH into SushiSwap v2 to create the LP position
```mermaid theme={null}
flowchart LR
ETH((ETH)) --> SPLIT{enso.split}
SPLIT -->|1inch<br/>swap| USDC_e((USDC.e))
SPLIT -->|wrapped-native<br/>deposit| WETH((WETH))
USDC_e -->|sushiswap-v2<br/>deposit| SUSHI_LP((SUSHI_LP))
WETH -->|sushiswap-v2<br/>deposit| SUSHI_LP
```
```ts theme={null}
const BERACHAIN_CHAIN = 80094;
const OPTIMISM_CHAIN = 10;
const ARBITRUM_CHAIN = 42161;
const ETHEREUM_CHAIN = 1;
const PLUME_CHAIN = 98866;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;
/**
* Zaps ETH to a SushiSwap ARB/WETH liquidity pool on Arbitrum.
* @returns The route and transaction objects.
*/
export async function zapEthToSushiswapLp(): {
const ETH: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
const SLP_ARB_WETH: Address = "0x905dfcd5649217c42684f23958568e533c711aa3";
const routeParams: RouteParams = {
fromAddress: userAddress,
receiver: userAddress,
chainId: ARBITRUM_CHAIN,
amountIn: ["1000000000000000000"], // 1 ETH
tokenIn: [ETH],
tokenOut: [SLP_ARB_WETH],
routingStrategy: 'router'
};
const route = await client.getRouteData(routeParams);
await sendEoa(route.tx, route.gas);
return route;
}
```
***
## Zap ETH to Balancer WETH/BAL LP on Mainnet
This use case provides liquidity to a classic Balancer weighted pool.
[**Try this route →**](https://happypath.enso.build?chainId=1\&tokenIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE\&tokenOut=0x5c6Ee304399DBdB9C8Ef030aB642B10820DB8F56)
**Route Mechanics:**
* Deposit ETH into wrapped native protocol to get WETH
* Deposit WETH into Balancer v2 pool to create the WETH/BAL LP position
```mermaid theme={null}
flowchart LR
ETH((ETH)) --> SPLIT{enso.split}
SPLIT -->|1inch<br/>swap| USDC_e((USDC.e))
SPLIT -->|wrapped-native<br/>deposit| WETH((WETH))
USDC_e -->|sushiswap-v2<br/>deposit| SUSHI_LP((SUSHI_LP))
WETH -->|sushiswap-v2<br/>deposit| SUSHI_LP
```
```ts theme={null}
const BERACHAIN_CHAIN = 80094;
const OPTIMISM_CHAIN = 10;
const ARBITRUM_CHAIN = 42161;
const ETHEREUM_CHAIN = 1;
const PLUME_CHAIN = 98866;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;
/**
* Zaps ETH to a Balancer WETH/BAL weighted pool on Ethereum Mainnet.
* @returns The route and transaction objects.
*/
export async function zapEthToBalancerLp(): {
const ETH: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
const BPT_WETH_BAL: Address = "0x5c6Ee304399DBdB9C8Ef030aB642B10820DB8F56";
const routeParams: RouteParams = {
fromAddress: userAddress,
receiver: userAddress,
chainId: ETHEREUM_CHAIN,
amountIn: ["1000000000000000000"], // 1 ETH
tokenIn: [ETH],
tokenOut: [BPT_WETH_BAL],
routingStrategy: 'router'
};
const route = await client.getRouteData(routeParams);
await sendEoa(route.tx, route.gas);
return route;
}
```
***
## Zap ETH to Camelot GRAIL/WETH LP on Arbitrum
This use case provides liquidity to a core pool on Camelot DEX.
[**Try this route →**](https://happypath.enso.build?chainId=42161\&tokenIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE\&tokenOut=0xbfca4230115de8341f3a3d5e8845ffb3337b2be3)
Route Mechanics:
* the bundle first splits the input ETH token.
* tne portion is swapped for GRAIL
* the other is wrapped into WETH using the wrapped-native protocol.
* the two assets are then deposited into the camelot-v2 protocol to form the LP position
```mermaid theme={null}
flowchart LR
ETH((ETH)) --> SPLIT{enso.split}
SPLIT -->|swap| PENDLE((PENDLE))
SPLIT -->|wrapped-native<br/>deposit| WETH((WETH))
PENDLE -->|camelot-v2<br/>deposit| CAMELOT_LP((CAMELOT_LP))
WETH -->|camelot-v2<br/>deposit| CAMELOT_LP
```
```ts theme={null}
import { EnsoClient, RouteParams, Address } from "@ensofinance/sdk";
import * as dotenv from "dotenv";
import { happyPathLog } from "../../tools";
import { sendEoa } from "../utils";
dotenv.config();
// Initialize EnsoClient with your API key
const client = new EnsoClient({
apiKey: process.env.ENSO_API_KEY!,
});
// Define common constants
const BERACHAIN_CHAIN = 80094;
const OPTIMISM_CHAIN = 10;
const ARBITRUM_CHAIN = 42161;
const ETHEREUM_CHAIN = 1;
const PLUME_CHAIN = 98866;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;
/**
* Zaps ETH to a Camelot GRAIL/WETH liquidity pool on Arbitrum.
* @returns The route and transaction objects.
*/
export async function zapEthToCamelotLp(): {
const ETH: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
const spLP_GRAIL_WETH: Address = "0xbfca4230115de8341f3a3d5e8845ffb3337b2be3";
const routeParams: RouteParams = {
fromAddress: userAddress,
receiver: userAddress,
chainId: ARBITRUM_CHAIN,
amountIn: ["1000000000000000000"], // 1 ETH
tokenIn: [ETH],
tokenOut: [spLP_GRAIL_WETH],
routingStrategy: 'router'
};
const route = await client.getRouteData(routeParams);
await sendEoa(route.tx, route.gas);
return route;
}
```
***
<div>
<p>Updated </p>
</div>
# Overview
Source: https://docs.enso.build/pages/use-cases/index
Find Enso routes and bundles for your use case and the strategies you need
<div>
<p>Find Enso routes and bundles for different DeFi use cases and the run strategies you need.</p>
<div>
<Card title="Lending Markets" icon="landmark" href="/pages/use-cases/lending-markets">
Simplify deposits, repayments, and collateral management. Enable complex vault strategies and ensure protocol solvency with efficient liquidations.
</Card>
<Card title="Wallets" icon="wallet" href="/pages/use-cases/wallets">
Offer seamless swaps, cross-chain bridging, and direct-to-DeFi earning opportunities to keep your users' assets active
</Card>
<Card title="DEXes & Aggregators" icon="arrow-right-arrow-left" href="/pages/use-cases/dexes-aggregators">
Remove friction from liquidity provision with simple zaps. Make it easy for users to migrate positions and optimize backend operations.
</Card>
<Card title="Stablecoins" icon="coins" href="/pages/use-cases/stablecoins">
Use single-origin minting with secure cross-chain bridging.
Launch yield tokens across multiple chains without deploying contracts everywhere.
</Card>
<Card title="Market Makers" icon="circle-plus" href="/pages/use-cases/market-makers">
Automate DEX market making, CEX-DEX arbitrage, and liquidity pool rebalancing. Respond to market conditions programmatically to improve capital efficiency.
</Card>
<Card title="Deposits (Staking & Vaults)" icon="piggy-bank" href="/pages/use-cases/deposits">
Maximize user deposits by accepting any token. Simplify position migration between vaults to keep capital within your ecosystem.
</Card>
<Card title="Nontokenized positions" icon="box-archived" href="/pages/use-cases/nontokenized-deposits">
Deposit into protocols with nontokenized positions like Orderly vaults, managing stateful positions directly in smart wallets.
</Card>
<Card href="/pages/use-cases/strategies/leverage-loops" icon="repeat" title="Leverage Loops">
Execute complex leveraged yield strategies with Enso's automated routing
</Card>
<Card icon="hand-holding-droplet" href="/pages/use-cases/strategies/auto-compounding" title="Auto-compounding">
Build single-transaction multi-step yield strategies, including auto-compounding
</Card>
<Card icon="bridge" href="/pages/use-cases/bridges" title="Crosschain Bridges">
Execute complex crosschain operations using CCIP, Relay, or Stargate with post-bridge callbacks
</Card>
</div>
</div>
# Borrow from Lending Protocols
Source: https://docs.enso.build/pages/use-cases/lending-markets/borrowing
Borrow on lending protocols and combine with Enso's routing
## Provide collateral and borrow in a single transaction
**Route mechanics**
* Provide USDC collateral either using [`deposit`](/pages/build/reference/actions#deposit) or simpler with Enso's [`route` action](/pages/build/reference/actions#route)
* Borrow WETH using the deposited USDC
```mermaid theme={null}
flowchart LR
USDC((USDC)) -프로젝트로 돌아가기