Rebalance from a Yearn vault to a Morpho Blue vault on Katana

This use case dynamically shifts capital from a Yearn vault to a Morpho Blue vault to optimize yield. Try this route → Route Mechanics:
  • Redeem the Yearn v3 vault position to get FIXME (0x203a662b0bd271a6ed5a60edfbd04bfce608fd36)
  • Redeem the intermediate token using vault bridge protocol to get FIXME (0xfd415d011ffaa8e6f17fa753cdb080d1de266784)
  • Deposit the underlying asset back using vault bridge protocol to get FIXME (0x203a662b0bd271a6ed5a60edfbd04bfce608fd36)
  • Deposit the prepared asset into Morpho Blue vault to receive the target vault token
export async function rebalanceYearnToMorphoKatana(): Promise<{ route: any; tx: any }> {
  
  const yvvbUSDC: Address = "0x80c34bd3a3569e126e7055831036aa7b212cb159";
  const steakUSDC: Address = "0x61d4f9d3797ba4da152238c53a6f93fb665c3c1d";

  const routeParams: RouteParams = {
    fromAddress: userAddress,
    receiver: userAddress,
    chainId: KATANA_CHAIN,
    amountIn: ["100000000"], // 100 yvvbUSDC
    tokenIn: [yvvbUSDC],
    tokenOut: [steakUSDC],
    routingStrategy: 'router'
  };

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