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

# Katana: Mint rUSD and deposit to Morpho

> Crosschain wsrUSD minting and automated routing to Morpho lending positions on Katana

export const date_0 = "2025-09-25"

This sample demonstrates minting wsrUSD on Ethereum and routing to target chain lending markets through automated bridging and position creation workflows.

The approach shows direct integration between centralized token issuance and distributed DeFi protocols.

```mermaid theme={null}
flowchart LR
    subgraph ethereum ["🌐 Ethereum"]
        USDC_ETH((USDC))
        USDC_ETH -->|enso<br/>route| wsrUSD_ETH((wsrUSD))
    end
    
    wsrUSD_ETH -.->|stargate<br/>bridge| wsrUSD_KATANA((wsrUSD))
    
    subgraph katana ["⚔️ Katana"]
        wsrUSD_KATANA -->|morpho-markets-v1<br/>deposit| MORPHO_SHARES((Morpho<br/>wsrUSD/vbUSD))
    end
  style MORPHO_SHARES stroke-dasharray: 5 5
```

\*\*Route Mechanics:
\*\*This bundle facilitates stablecoin diversification across chains through a the following process:

* Convert USDC to wsrUSD\_ETH on Ethereum using Enso's routing
* Bridge the newly minted rUSD from Ethereum to Katana chain via Stargate
* Check wsrUSD balance on Katana after bridge completion
* Deposit wsrUSD to [wsrUSD/vbUSD Morpho position](https://app.morpho.org/katana/market/0xd8a93a4cd16f843c385391e208a9a9f2fd75aedfcca05e4810e5fbfcaa6baec6/wsrusd-vbusdc)

The strategy enables users to access Katana's DeFi ecosystem while starting with familiar USDC on Ethereum and relying on Reservoir Stablecoin.

```typescript lines highlight={} theme={null}
const KATANA_ID = 747474;
const ETHEREUM_ID = 1;

// Common addresses
const WALLET_ADDRESS = "0x93621DCA56fE26Cdee86e4F6B18E116e9758Ff11"; // User wallet

// Token addresses
const MORPHO = "0xD50F2DffFd62f94Ee4AEd9ca05C61d0753268aBc";
const USDC_ETHEREUM = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
const wsrUSD_KATANA = "0x4809010926aec940b550D34a46A52739f996D75D";
const wsrUSD_ETHEREUM = "0xd3fd63209fa2d55b07a0f6db36c2f43900be3094";

const wsrUSD_MORPHO_POSITION_ID =
  "0xd8a93a4cd16f843c385391e208a9a9f2fd75aedfcca05e4810e5fbfcaa6baec6";

const client = new EnsoClient({
  apiKey: process.env.ENSO_API_KEY!,
});

// LayerZero pool addresses
const wsrEthToKatanaPools = await client.getLayerZeroPool({
  chainId: ETHEREUM_ID,
  token: wsrUSD_ETHEREUM,
  destinationChainId: KATANA_ID,
  destinationToken: wsrUSD_KATANA,
});

console.log(JSON.stringify(wsrEthToKatanaPools), !wsrEthToKatanaPools.length);

if (!wsrEthToKatanaPools.length) {
  throw new Error("Required pools not available");
}

const bundle = await client.getBundleData(
  {
    chainId: ETHEREUM_ID,
    fromAddress: WALLET_ADDRESS,
    spender: WALLET_ADDRESS,
    routingStrategy: "router",
  },
  [
    // mint wsrUSD on Ethereum
    {
      protocol: "enso",
      action: "route",
      args: {
        amountIn: parseUnits("1000", 6).toString(), // 1000 USDC
        tokenIn: USDC_ETHEREUM,
        receiver: WALLET_ADDRESS,
        tokenOut: wsrUSD_ETHEREUM,
      },
    },
    {
      protocol: "stargate",
      action: "bridge",
      args: {
        primaryAddress: wsrEthToKatanaPools[0].pool as Address,
        destinationChainId: KATANA_ID,
        tokenIn: wsrUSD_ETHEREUM,
        amountIn: { useOutputOfCallAt: 0 },
        receiver: WALLET_ADDRESS,
        callback: [
          // Step 1: Check wsrUSD balance on Katana after bridge  
          {
            protocol: "enso",
            action: "balance",
            args: {
              token: wsrUSD_KATANA,
            },
          },
          {
            protocol: "morpho-markets-v1",
            action: "deposit",
            args: {
              amountIn: { useOutputOfCallAt: 0 },
              tokenIn: wsrUSD_KATANA,
              receiver: WALLET_ADDRESS,
              primaryAddress: MORPHO,
              positionId: wsrUSD_MORPHO_POSITION_ID,
            },
          },
        ],
      },
    },
  ]
);
```

**Important Considerations**

* Bridge operations execute sequentially - Katana operations only proceed after successful Ethereum minting
* LayerZero bridge fees apply for transfers between Ethereum and Katana
* Gas costs for both chains are paid from the originating Ethereum transaction

## Resources:

* [Bridge Action Reference](/pages/build/reference/actions#bridge) - Technical details on crosschain bridging
* [Route Action Reference](/pages/build/reference/actions#route) - Using Enso's routing aggregation
* [Deposit Action Reference](/pages/build/reference/actions#deposit) - Using Enso's deposit action
* [getLayerZeroPool SDK Method](https://github.com/EnsoBuild/sdk-ts?tab=readme-ov-file#bridging-pool-address) - Finding available bridge pools programmatically
* [Crosschain Bridging Guide](/pages/build/examples/bridging) - Getting started with multi-chain workflows

<div className="text-right text-xs gray-200 font-semibold w-full" style={{marginTop: '0'}}>
  <p style={{
        color: "#b2b2b2"  
    }}>Updated {date_0}</p>
</div>
