Make it easy for users to migrate positions between different protocols and assets.
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; }
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);
yHONEY
HONEY
WBERA
HONEY/WBERA
Was this page helpful?