Swap BERA to HONEY on Berachain

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.
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;
}


Swap USDC.e to get superOETH on Origin

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.
const ETHEREUM_CHAIN = 1;
const BERACHAIN_CHAIN = 80094;
const PLUME_CHAIN = 98866;
const ARBITRUM_CHAIN = 42161;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;

/**
 * Swaps bridged USDC.e for superOETH on the Origin protocol on Plume.
 * @returns The route and transaction objects.
 */
export async function swapUsdceToSuperOeth() {
  const USDCe: Address = "0x78adD880A697070c1e765Ac44D65323a0DcCE913";
  const superOETH: Address = "0xFCbe50DbE43bF7E5C88C6F6Fb9ef432D4165406E";
  const amountIn = "100000000";
  const routeParams: RouteParams = {
    fromAddress: userAddress,
    receiver: userAddress,
    chainId: PLUME_CHAIN,
    amountIn: [amountIn], // 100 USDC.e
    tokenIn: [USDCe],
    tokenOut: [superOETH],
    routingStrategy: "router",
  };

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

Convert HYPE to Staked HYPE (kHYPE)

Stake the native HYPE token to receive its yield-bearing equivalent, kHYPE. Try this route →
const HYPE = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" as Address;
const KHYPE = "0xfd739d4e423301ce9385c1fb8850539d657c296d" as Address;

const routeParams: RouteParams = {
 fromAddress: userAddress,
 receiver: userAddress,
 chainId: HYPEREVM_CHAIN,
 amountIn: ["1000000000000000000"], // 1 HYPE
 tokenIn: [HYPE],
 tokenOut: [KHYPE],
 routingStrategy: "router",
 slippage: "50", // 0.5% slippage
 referralCode: "kinetiq-native",
};

const route = await client.getRouteData(routeParams);
// If using 'router' strategy, approval is often required for the input token.
await sendSmartWallet(client.getApprovalData(route.route.tokenIn[0]));

// sign with an EOA with `router` routing strategy
await sendSmartWallet(route.tx, route.gas);
Route Mechanics:
  • Swap native HYPE to kHYPE.

Swap USDC.e to PUSD on Plume

Swap bridged USDC.e for the PUSD stablecoin on Plume. Try this route →
// SDK Example
const client = new EnsoClient({
apiKey: 'your-api-key'
});

const routeData = await client.getRouteData({
 fromAddress: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
 receiver: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
 chainId: 98866,
 amountIn: ['1000000000000000000'],
 slippage: '300',
 tokenIn: ['0x54FD4da2Fa19Cf0f63d8f93A6EA5BEd3F9C042C6'],
 tokenOut: ['0xdddD73F5Df1F0DC31373357beAC77545dC5A6f3F'],
 routingStrategy: 'router'
});

// If using 'router' strategy, approval is often required for the input token.
await sendSmartWallet(client.getApprovalData(routeData.route.tokenIn[0]));
await sendSmartWallet(routeData.tx, routeData.gas);
Route Mechanics:
  • Swap bridged USDC.e to PUSD.