Enso 백서

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 35쪽 중 31쪽

cute atomically - if any step fails, the entire transaction reverts and funds are safely returned * Gas costs for all destination chains are calculated and paid upfront using LayerZero's native drop feature * Bridge fees and slippage may cause slight variations in final amounts received ## Related Documentation * [Bridge Action Reference](/pages/build/reference/actions#bridge) - Technical details on crosschain bridging * [Crosschain Bridging Guide](/pages/build/examples/bridging) - Getting started with multi-chain workflows * [getLayerZeroPool SDK Method](https://github.com/EnsoBuild/sdk-ts?tab=readme-ov-file#bridging-pool-address) - Finding available bridge pools programmatically <div> <p>Updated </p> </div> # Katana: Mint rUSD and deposit to Morpho Source: https://docs.enso.build/pages/use-cases/stablecoins/crosschain-deposit-rusd-katana-morpho Crosschain wsrUSD minting and automated routing to Morpho lending positions on Katana 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> <p>Updated </p> </div> # Katana: Crosschain Yield Generation Source: https://docs.enso.build/pages/use-cases/stablecoins/crosschain-deposit-rusd-katana-yearn Mint wsrUSD on Ethereum and automatically bridge to Katana for Yearn vault deposits This example shows minting wsrUSD on Ethereum's canonical contract and routing to external yield infrastructure through automated bridging and vault deposit sequences. ```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_KAT((wsrUSD)) subgraph katana ["⚔️ Katana"] wsrUSD_KAT -->|enso<br/>route| vbUSDC_KAT((vbUSDC)) vbUSDC_KAT -->|yearn-v3<br/>deposit| yvvbUSDC((yvvbUSDC)) end ``` **Route Mechanics:** This yield strategy orchestrates multiple protocols across Ethereum Mainnet and Katana: * Convert USDC to wsrUSD on Ethereum using Enso's swap routing * Bridge wsrUSD from Ethereum to Katana chain via Stargate protocol * Check wsrUSD balance on Katana after bridge completion * Swap wsrUSD for vault-bridged USDC (vbUSDC) using Enso routing * Deposit vbUSDC into Yearn V3 vault for automated yield optimization strategies ```typescript lines highlight={} theme={null} const KATANA_ID = 747474; const ETHEREUM_ID = 1; // Common addresses const WALLET_ADDRESS = "0x93621DCA56fE26Cdee86e4F6B18E116e9758Ff11"; // User wallet // Token addresses const yvvbUSDC_KATANA = "0x80c34BD3A3569E126e7055831036aa7b212cB159"; const vbUSDC_KATANA = "0x203A662b0BD271A6ed5a60EdFbd04bFce608FD36"; const USDC_ETHEREUM = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"; const wsrUSD_KATANA = "0x4809010926aec940b550D34a46A52739f996D75D"; const wsrUSD_ETHEREUM = "0xd3fd63209fa2d55b07a0f6db36c2f43900be3094"; 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, }, }, // Step 2: Swap wsrUSD to vbUSDC for Yearn compatibility { protocol: "enso", action: "route", args: { amountIn: { useOutputOfCallAt: 0 }, tokenIn: wsrUSD_KATANA, tokenOut: vbUSDC_KATANA, receiver: WALLET_ADDRESS, }, }, // Step 3: Deposit vbUSDC into Yearn V3 vault { protocol: "yearn-v3", action: "deposit", args: { amountIn: { useOutputOfCallAt: 1 }, tokenIn: vbUSDC_KATANA, receiver: WALLET_ADDRESS, primaryAddress: yvvbUSDC_KATANA, }, }, ], }, }, ] ); ``` **Important Considerations** * Yearn vault strategies automatically optimize yield through multiple DeFi protocols on Katana * Bridge operations execute sequentially - Katana operations only proceed after successful Ethereum minting * LayerZero bridge fees apply for transfers between Ethereum and Katana * Vault deposit generates yvvbUSDC tokens representing your share of the yield-bearing position * Gas costs for both chains are paid from the originating Ethereum transaction ## Related Documentation * [Crosschain Bridging Guide](/pages/build/examples/bridging) - Getting started with multi-chain workflows * [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) - Vault deposit mechanics * [getLayerZeroPool SDK Method](https://github.com/EnsoBuild/sdk-ts?tab=readme-ov-file#bridging-pool-address) - Finding available bridge pools programmatically <div> <p>Updated </p> </div> # Crosschain Minting: Round-Trip to Berachain Source: https://docs.enso.build/pages/use-cases/stablecoins/crosschain-mint-rusd-bera Crosschain stablecoin minting workflow: bridge USDCefrom Berachain to Ethereum, mint rUSD, and return minted tokens to origin chain The workflow shows how to access Reservoir minting infrastructure from remote chains through automated bridging sequences. ```mermaid theme={null} flowchart LR subgraph berachain ["🐻 Berachain"] USDCE_BERA((USDCE)) --> A1(( )) end A1 -.->|stargate<br/>bridge| B1 subgraph ethereum ["🌐 Ethereum"] B1(( )) -->|balance<br/>check| USDC_ETH((USDC)) USDC_ETH -->|reservoir<br/>deposit| A2(( )) --> rUSD_ETH((rUSD)) rUSD_ETH -.->|stargate<br/>bridge| C1 end subgraph berachain ["🐻 Berachain"] C1(( )) -->|balance<br/>check| rUSD_BERA((rUSD)) end ``` **Route Mechanics:** This bundle orchestrates a complete crosschain yield strategy through multiple atomic operations: * Bridge USDCe from Berachain to Ethereum using Stargate protocol * Check USDCebalance on Ethereum after successful bridge completion * Mint rUSD using the bridged USDCethrough Reservoir's minting contract * Bridge newly minted rUSD back to Berachain via Stargate bridge * Check rUSD balance on Berachain after the bridge returns ```typescript mintOnBeraFromMainnet.ts highlight={21, 27, 47, 54, 63, 75} lines theme={null} // Chain IDs const BERACHAIN_ID = 80094; const ETHEREUM_ID = 1; // Common addresses const WALLET_ADDRESS = "0x93621DCA56fE26Cdee86e4F6B18E116e9758Ff11"; // User wallet // Token addresses const USDCE_BERACHAIN = "0x549943e04f40284185054145c6E4e9568C1D3241"; const USDC_ETHEREUM = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"; const RUSD_ETHEREUM = "0x09D4214C03D01F49544C0448DBE3A27f768F2b34"; // Protocol addresses const RESERVOIR_MINTING_CONTRACT = "0x4809010926aec940b550D34a46A52739f996D75D"; const client = new EnsoClient({ apiKey: process.env.ENSO_API_KEY || "your-api-key-here", }); const usdcBeraToEthPools = await client.getLayerZeroPool({ chainId: BERACHAIN_ID, token: USDCE_BERACHAIN, destinationChainId: ETHEREUM_ID + "", }); const rusdEthToBeraPools = await client.getLayerZeroPool({ chainId: ETHEREUM_ID, token: RUSD_ETHEREUM, destinationChainId: BERACHAIN_ID + "", }); if (!(usdcBeraToEthPools.length && usdcBeraToEthPools.length)) { throw new Error("Required pools not available"); } const bundle = await client.getBundleData( { chainId: BERACHAIN_ID, fromAddress: WALLET_ADDRESS, spender: WALLET_ADDRESS, routingStrategy: "router", }, [ { protocol: "stargate", action: "bridge", args: { primaryAddress: usdcBeraToEthPools[0].pool, destinationChainId: ETHEREUM_ID, tokenIn: USDCE_BERACHAIN, amountIn: parseUnits("1000", 6).toString(), // 1000 USDC receiver: WALLET_ADDRESS, callback: [ // Step 1: Check USDCebalance on Ethereum after bridge { protocol: "enso", action: "balance", args: { token: USDC_ETHEREUM, }, }, // Step 2: Mint rUSD using bridged USDC { protocol: "reservoir", action: "deposit", args: { primaryAddress: RESERVOIR_MINTING_CONTRACT, tokenIn: USDC_ETHEREUM, tokenOut: RUSD_ETHEREUM, amountIn: { useOutputOfCallAt: 0 }, // Use USDCefrom balance check receiver: WALLET_ADDRESS, }, }, // Step 3: Bridge newly minted rUSD back to Berachain { protocol: "stargate", action: "bridge", args: { primaryAddress: rusdEthToBeraPools[0].pool, destinationChainId: BERACHAIN_ID, tokenIn: RUSD_ETHEREUM, amountIn: { useOutputOfCallAt: 1 }, // Use e-rUSD from minting receiver: WALLET_ADDRESS, }, }, ], }, }, ] ); return bundle; ``` **Important considerations** * This bundle executes multiple crosschain operations atomically - if any step fails, the entire transaction reverts * LayerZero bridge fees apply for both USDCe and rUSD transfers between chains * Gas costs for Ethereum minting and Berachain vault deposit are calculated upfront * Bridge timing may vary based on network congestion on both chains ## Resources: * [Bridge Action Reference](/pages/build/reference/actions#bridge) - Technical details on crosschain bridging * [Crosschain Routing Guide](/pages/build/get-started/crosschain-routing) - Getting started with multi-chain workflows * [getLayerZeroPool SDK Method](https://github.com/EnsoBuild/sdk-ts?tab=readme-ov-file#bridging-pool-address) - Finding available bridge pools programmatically * [Bundle Actions Guide](/pages/build/get-started/bundling-actions) - Creating complex multi-step transactions <div> <p>Updated </p> </div> # Crosschain Minting: Round-Trip to Katana Source: https://docs.enso.build/pages/use-cases/stablecoins/crosschain-mint-rusd-katana Mint rUSD stablecoin on Ethereum mainnet and bridge to Katana chain for DeFi yield and stablecoin diversification This example shows single-contract minting on Ethereum followed by automated token distribution to Katana through bridging. The pattern shows multi-chain token access without requiring separate minting deployments on each destination chain. ```mermaid theme={null} flowchart LR subgraph ethereum ["🌐 Ethereum"] USDC_ETH((USDC)) USDC_ETH -->|enso<br/>route| rUSD_ETH((rUSD)) end rUSD_ETH -.->|stargate<br/>bridge| rUSD_KAT((rUSD)) subgraph katana ["⚔️ Katana"] rUSD_KAT -->|enso<br/>route| VBUSDC((vbUSDC)) end ``` \*\*Route Mechanics: \*\* This bundle facilitates stablecoin diversification across chains through a the following process: * Convert USDC to rUSD on Ethereum using Enso's routing aggregation * Bridge the newly minted rUSD from Ethereum to Katana chain via Stargate * Check rUSD balance on Katana after bridge completion * Swap rUSD for vault-bridged USDC (vbUSDC) on Katana 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 rUSD_ETHEREUM = "0x09D4214C03D01F49544C0448DBE3A27f768F2b34"; const rUSD_KATANA = "0x09D4214C03D01F49544C0448DBE3A27f768F2b34"; const USDC_ETHEREUM = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"; const VBUSDC_KATANA = "0x203A662b0BD271A6ed5a60EdFbd04bFce608FD36"; const client = new EnsoClient({ apiKey: process.env.ENSO_API_KEY!, }); // LayerZero pool addresses const wsrEthToKatanaPools = await client.getLayerZeroPool({ chainId: ETHEREUM_ID, token: rUSD_ETHEREUM, destinationChainId: KATANA_ID, destinationToken: rUSD_KATANA, }); // LayerZero pool addresses const rUsdKatanaToEthRUsd = await client.getLayerZeroPool({ chainId: ETHEREUM_ID, token: rUSD_ETHEREUM, destinationChainId: KATANA_ID, destinationToken: rUSD_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: rUSD_ETHEREUM, }, }, { protocol: "stargate", action: "bridge", args: { primaryAddress: wsrEthToKatanaPools[0].pool as Address, destinationChainId: KATANA_ID, tokenIn: rUSD_ETHEREUM, amountIn: { useOutputOfCallAt: 0 }, receiver: WALLET_ADDRESS, callback: [ // Step 1: Check wsrUSD balance on Katana after bridge { protocol: "enso", action: "balance", args: { token: rUSD_KATANA, }, }, // Step 2: Swap wsrUSD to vbUSDC { protocol: "enso", action: "route", args: { tokenIn: rUSD_KATANA, tokenOut: VBUSDC_KATANA, amountIn: { useOutputOfCallAt: 0 }, // Use wsrUSD_KATANA from balance check receiver: WALLET_ADDRESS, }, }, ], }, }, ] ); ``` **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 * [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> <p>Updated </p> </div> # Overview Source: https://docs.enso.build/pages/use-cases/stablecoins/index Streamlined crosschain stablecoin workflows for minting, yield farming, and liquidity provision from a single origin chain ## Crosschain Stablecoin Minting Use Enso's crosschain routing to mint stablecoins on their origin chain and access assets on the target chain. <div> <Card href="/pages/use-cases/stablecoins/crosschain-mint-rusd-bera" title="Crosschain Minting & Vault Deposit"> Bridge assets across chains to mint stablecoins where protocols exist, then return with newly minted tokens for yield farming </Card> <Card href="/pages/use-cases/stablecoins/crosschain-mint-rusd-katana" title="Crosschain Minting to Katana"> Mint rUSD stablecoin on Ethereum and bridge to Katana for yield and diversification </Card> </div> ## Crosschain Stablecoin Yield Roundtrip Build crosschain workflows to enter yield bearing positions with single-chain stablecoins. <div> <Card href="/pages/use-cases/stablecoins/crosschain-deposit-rusd-bera-dolomite" title="Berachain: Mint rUSD to enter Dolomite"> Crosschain minting strategy with USDCe bridging, rUSD minting, and Dolomite vault deposits for yield generation on Berachain </Card> <Card href="/pages/use-cases/stablecoins/crosschain-deposit-rusd-bera-euler" title="Berachain: Mint rUSD to enter Dolomite"> Crosschain minting roundtrip with USDCe bridging, rUSD creation, and Euler v
프로젝트로 돌아가기