This use case demonstrates a basic swap of the native gas token for the native stablecoin on Berachain.Try this route →Route mechanics
A simple swap from BERA to HONEY using the openocean protocol on Berachain.
Copy
Ask AI
const ETHEREUM_CHAIN = 1;const BERACHAIN_CHAIN = 80094;const PLUME_CHAIN = 98866;const ARBITRUM_CHAIN = 42161;const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;/** * Swaps the native gas token BERA for the native stablecoin HONEY on Berachain. * @returns The route and transaction objects. */export async function swapBeraToHoney() { const BERA: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"; const HONEY: Address = "0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590"; const amountIn = "1000000000000000000"; const routeParams: RouteParams = { fromAddress: userAddress, receiver: userAddress, chainId: BERACHAIN_CHAIN, amountIn: [amountIn], // 1 BERA tokenIn: [BERA], tokenOut: [HONEY], routingStrategy: "router", }; const approval = await client.getApprovalData({ amount: "1000000000000000000", tokenAddress: BERA, chainId: BERACHAIN_CHAIN, fromAddress: userAddress, }); const route = await client.getRouteData(routeParams); await sendEoa(approval.tx, approval.gas); await sendEoa(route.tx, route.gas); return route;}
This use case swaps bridged USDC.e and converts it into a superOETH position on Origin.Try this route →Route mechanics A direct swap from USDC.e to superOETH using the rooster protocol on Plume.