Documentation Index
Fetch the complete documentation index at: https://docs.enso.build/llms.txt
Use this file to discover all available pages before exploring further.
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 →
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
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 →
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.