Zap BERA to BEX WBERA/HONEY LP on Berachain

This use case adds liquidity to the primary stable-native pair on the Berachain BEX. Try this route → Route Mechanics:
  • splits the input BERA token using an internal enso router.
  • creates two components: a portion is swapped for HONEY on a DEX, and the other portion is used to provide liquidity directly with WBERA.
  • both assets are then deposited into the BEX protocol to form the LP position
const BERACHAIN_CHAIN = 80094;
const OPTIMISM_CHAIN = 10;
const ARBITRUM_CHAIN = 42161;
const ETHEREUM_CHAIN = 1;
const PLUME_CHAIN = 98866;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;

/**
 * Zaps native BERA into the BEX WBERA/HONEY liquidity pool on Berachain.
 * @returns The route and transaction objects.
 */
export async function zapBeraToBexLp(): {
  const BERA: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
  const BEX_WBERA_HONEY_LP: Address = "0x0277d40b08ac168518c524418f1b3c16adae0f0d";

  const routeParams: RouteParams = {
    fromAddress: userAddress,
    receiver: userAddress,
    chainId: BERACHAIN_CHAIN,
    amountIn: ["1000000000000000000"], // 1 BERA
    tokenIn: [BERA],
    tokenOut: [BEX_WBERA_HONEY_LP],
    routingStrategy: 'router'
  };

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

Zap ETH into a Velodrome LP on Optimism

This use case demonstrates a single transaction to provide liquidity to a Velodrome v2 pool. Try this route → Route Mechanics:
  • splits the input ETH token. One portion is wrapped into WETH using wrapped-native, while the other is swapped for wstETH using the openocean protocol.
  • both assets are deposited into a velodrome-v2 liquidity pool
const BERACHAIN_CHAIN = 80094;
const OPTIMISM_CHAIN = 10;
const ARBITRUM_CHAIN = 42161;
const ETHEREUM_CHAIN = 1;
const PLUME_CHAIN = 98866;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;

/**
 * Zaps ETH into a Velodrome wstETH/WETH liquidity pool on Optimism.
 * @returns The route and transaction objects.
 */
export async function zapEthToVelodromeLp(): {
  const ETH: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
  const veloWstethWethLp: Address = "0xa3031D9FD5010496a2bAF8AFCE27Ef6f3849FB10";

  const routeParams: RouteParams = {
    fromAddress: userAddress,
    receiver: userAddress,
    chainId: OPTIMISM_CHAIN,
    amountIn: ["1000000000000000000"], // 1 ETH
    tokenIn: [ETH],
    tokenOut: [veloWstethWethLp],
    routingStrategy: 'router'
  };

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

Zap ETH to SushiSwap ARB/WETH LP on Arbitrum

This use case provides liquidity to a popular v3 pool on Sushiswap. Try this route → Route Mechanics:
  • Split ETH into two portions using enso internal routing:
    • First portion: swap ETH to USDC.e using 1inch protocol
    • Second portion: deposit ETH into wrapped native to get WETH
  • Deposit both USDC.e and WETH into SushiSwap v2 to create the LP position
const BERACHAIN_CHAIN = 80094;
const OPTIMISM_CHAIN = 10;
const ARBITRUM_CHAIN = 42161;
const ETHEREUM_CHAIN = 1;
const PLUME_CHAIN = 98866;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;

/**
 * Zaps ETH to a SushiSwap ARB/WETH liquidity pool on Arbitrum.
 * @returns The route and transaction objects.
 */
export async function zapEthToSushiswapLp(): {
  const ETH: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
  const SLP_ARB_WETH: Address = "0x905dfcd5649217c42684f23958568e533c711aa3";

  const routeParams: RouteParams = {
    fromAddress: userAddress,
    receiver: userAddress,
    chainId: ARBITRUM_CHAIN,
    amountIn: ["1000000000000000000"], // 1 ETH
    tokenIn: [ETH],
    tokenOut: [SLP_ARB_WETH],
    routingStrategy: 'router'
  };

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

Zap ETH to Balancer WETH/BAL LP on Mainnet

This use case provides liquidity to a classic Balancer weighted pool. Try this route → Route Mechanics:
  • Deposit ETH into wrapped native protocol to get WETH
  • Deposit WETH into Balancer v2 pool to create the WETH/BAL LP position
const BERACHAIN_CHAIN = 80094;
const OPTIMISM_CHAIN = 10;
const ARBITRUM_CHAIN = 42161;
const ETHEREUM_CHAIN = 1;
const PLUME_CHAIN = 98866;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;

/**
 * Zaps ETH to a Balancer WETH/BAL weighted pool on Ethereum Mainnet.
 * @returns The route and transaction objects.
 */
export async function zapEthToBalancerLp(): {
  const ETH: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
  const BPT_WETH_BAL: Address = "0x5c6Ee304399DBdB9C8Ef030aB642B10820DB8F56";

  const routeParams: RouteParams = {
    fromAddress: userAddress,
    receiver: userAddress,
    chainId: ETHEREUM_CHAIN,
    amountIn: ["1000000000000000000"], // 1 ETH
    tokenIn: [ETH],
    tokenOut: [BPT_WETH_BAL],
    routingStrategy: 'router'
  };

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

Zap ETH to Camelot GRAIL/WETH LP on Arbitrum

This use case provides liquidity to a core pool on Camelot DEX. Try this route → Route Mechanics:
  • the bundle first splits the input ETH token.
  • tne portion is swapped for GRAIL using the odos protocol
  • the other is wrapped into WETH using the wrapped-native protocol.
  • the two assets are then deposited into the camelot-v2 protocol to form the LP position
import { EnsoClient, RouteParams, Address } from "@ensofinance/sdk";
import * as dotenv from "dotenv";
import { happyPathLog } from "../../tools";
import { sendEoa } from "../utils";

dotenv.config();

// Initialize EnsoClient with your API key
const client = new EnsoClient({
  apiKey: process.env.ENSO_API_KEY!,
});

// Define common constants
const BERACHAIN_CHAIN = 80094;
const OPTIMISM_CHAIN = 10;
const ARBITRUM_CHAIN = 42161;
const ETHEREUM_CHAIN = 1;
const PLUME_CHAIN = 98866;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;

/**
 * Zaps ETH to a Camelot GRAIL/WETH liquidity pool on Arbitrum.
 * @returns The route and transaction objects.
 */
export async function zapEthToCamelotLp(): {
  const ETH: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
  const spLP_GRAIL_WETH: Address = "0xbfca4230115de8341f3a3d5e8845ffb3337b2be3";

  const routeParams: RouteParams = {
    fromAddress: userAddress,
    receiver: userAddress,
    chainId: ARBITRUM_CHAIN,
    amountIn: ["1000000000000000000"], // 1 ETH
    tokenIn: [ETH],
    tokenOut: [spLP_GRAIL_WETH],
    routingStrategy: 'router'
  };

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