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.
Bridge ETH to BERA Cross-Chain Swap
This use case bridges ETH from Ethereum to its native gas token equivalent, BERA, on Berachain.
Try this route →
Route mechanics:
- Swap native ETH to USDC using 0x protocol on Ethereum mainnet
- Bridge USDC from Ethereum (chain 1) to FIXME (0x549943e04f40284185054145c6e4e9568c1d3241) on Berachain (chain 80094) using Stargate protocol
- Swap the bridged token to native BERA using ooga-booga protocol on Berachain
const ETHEREUM_CHAIN = 1;
const BERACHAIN_CHAIN = 80094;
const PLUME_CHAIN = 98866;
const ARBITRUM_CHAIN = 42161;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;
export async function bridgeEthToBera() {
const ETH: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
const BERA: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
const amountIn = "1000000000000000000";
const routeParams: RouteParams = {
fromAddress: userAddress,
receiver: userAddress,
chainId: ETHEREUM_CHAIN,
destinationChainId: BERACHAIN_CHAIN,
amountIn: [amountIn],
tokenIn: [ETH],
tokenOut: [BERA],
routingStrategy: "router",
};
const route = await client.getRouteData(routeParams);
await sendEoa(route.tx, route.gas);
return route;
}
Zap ETH from Ethereum to get sUSDe on Ethena
This use case gets exposure to delta-neutral yield from Ethena in a single transaction.
Try this route →
Route mechanics
- Swap native ETH to sUSDe using KyberSwap protocol in a single transaction
const ETHEREUM_CHAIN = 1;
const BERACHAIN_CHAIN = 80094;
const PLUME_CHAIN = 98866;
const ARBITRUM_CHAIN = 42161;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;
/**
* Zaps ETH into Ethena's sUSDe to get exposure to delta-neutral yield.
* @returns The route and transaction objects.
*/
export async function earnEthToSusde() {
const ETH: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
const sUSDe: Address = "0x9D39A5DE30e57443BfF2A8307A4256c8797A3497";
const amountIn = "1000000000000000000";
const routeParams: RouteParams = {
fromAddress: userAddress,
receiver: userAddress,
chainId: ETHEREUM_CHAIN,
amountIn: [amountIn], // 1 ETH
tokenIn: [ETH],
tokenOut: [sUSDe],
routingStrategy: "router",
};
const route = await client.getRouteData(routeParams);
await sendEoa(route.tx, route.gas);
return route;
}
Bridge ETH for styHoney
Convert ETH on Ethereum into a staked yield position (styHONEY) on Berachain.
Try this route →
import { Address, EnsoClient, RouteParams } from "@ensofinance/sdk";
const ETHEREUM_MAINNET = 1; // Ethereum Mainnet
const BERACHAIN_MAINNET = 80094;
const userAddress = "your-wallet-address" as Address;
const ETH_Ethereum = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" as Address; // ETH on Ethereum
const styHONEY = "0x99d6A0FB9420F3995fD07dCc36AC827a8E146cf9" as Address;
const routeParams: RouteParams = {
fromAddress: userAddress,
receiver: userAddress,
chainId: ETHEREUM_MAINNET, // Start from Ethereum
destinationChainId: BERACHAIN_MAINNET,
amountIn: ["200000000000000000"], // 0.2 ETH
tokenIn: [ETH_Ethereum],
tokenOut: [styHONEY],
routingStrategy: "delegate",
slippage: "400", // 4% slippage for complex cross-chain
referralCode: "eth-styhoney",
};
const route = await client.getRouteData(routeParams);
await sendSmartWallet(route.tx, route.gas);
Route Mechanics:
- Swap
ETH to USDC on Ethereum Mainnet.
- Bridge
USDC to USDCe on Berachain via Stargate.
- Swap
USDCe to HONEY on Berachain.
- Deposit
HONEY into Bearn yHONEY vault.
- Stake
yHONEY to receive styHONEY.