Zap into a Pendle Yield Token pool with ETH on Arbitrum

This use case allows a user to enter a Pendle pool to speculate on or hedge against yield from a liquid restaking token. Try this route → Route mechanics This is a two-step bundle that:
  • Swap native ETH to weETH using odos protocol on Arbitrum
  • Deposit weETH into Pendle SY protocol to receive the Pendle Yield Token position
const ETHEREUM_CHAIN = 1;
const BERACHAIN_CHAIN = 80094;
const PLUME_CHAIN = 98866;
const ARBITRUM_CHAIN = 42161;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;

/**
 * Zaps ETH into a Pendle Yield Token pool for weETH on Arbitrum.
 * @returns The route and transaction objects.
 */
export async function earnEthToPendleYt() {
  const ETH: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
  const SY_weETH: Address = "0xa6C895EB332E91c5b3D00B7baeEAae478cc502DA";
  const amountIn = "1000000000000000000";
  const routeParams: RouteParams = {
    fromAddress: userAddress,
    receiver: userAddress,
    chainId: ARBITRUM_CHAIN,
    amountIn: [amountIn], // 1 ETH
    tokenIn: [ETH],
    tokenOut: [SY_weETH],
    routingStrategy: "router",
  };

  
  const route = await client.getRouteData(routeParams);
  await sendEoa(route.tx, route.gas);
  return route;
}