> ## 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.

# Position Migration

> Simplify position migration between vaults to keep capital within ecosystem.

## Migrate from Yearn yvDAI vault to yvUSDC vault

This use case enables 1-click migration between different vaults on the same platform to retain user capital.

[**Try this route →**](https://happypath.enso.build?chainId=1\&tokenIn=0xda816459f1ab5631232fe5e97a05bbbb94970c95\&tokenOut=0xa354f35829ae975e850e23e9615b11da1b3dc4de)

**Route Mechanics**:
The routing involves a three-step process.

* It first redeems the yvDAI from the yearn-v2 vault to get DAI.
* Then, it swaps the DAI for USDC using the odos protocol.
* Finally, it deposits the USDC into the yearn-v2 vault to get the final yvUSDC position.

```mermaid theme={null}
flowchart LR
    yvDAI((yvDAI)) --> A1
        A1[yearn-v2.redeem] --> DAI((DAI))
        A2[odos.swap] --> USDC((USDC))
        A3[yearn-v2.deposit] --> yvUSDC((yvUSDC))
        DAI --> A2
        USDC --> A3
```

```ts theme={null}
export async function migrateYearnDaiToUsdc(): Promise<{ route: any; tx: any }> {
  const yvDAI: Address = "0xda816459f1ab5631232fe5e97a05bbbb94970c95";
  const yvUSDC: Address = "0xa354f35829ae975e850e23e9615b11da1b3dc4de";

  const routeParams: RouteParams = {
    fromAddress: userAddress,
    receiver: userAddress,
    chainId: ETHEREUM_CHAIN,
    amountIn: ["1000000000000000000"], // 1 yvDAI
    tokenIn: [yvDAI],
    tokenOut: [yvUSDC],
    routingStrategy: 'router'
  };

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