const chainId = 1; // Ethereum mainnet
const fromAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045";
// Token addresses
const tokenInEth = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
const lpTokenStethEth = "0x06325440d014e39736583c165c2963ba99faf14e"; // stETH/ETH Curve LP token
const stEthEthPool = "0xDC24316b9AE028F1497c275EB9192a3Ea0f67022"; // stETH/ETH Curve Pool
const convexBooster = "0xF403C135812408BFbE8713b5A23a04b3D48AAE31"; // Convex Booster
const cvxsteCRV = "0x9518c9063eB0262D791f38d8d6Eb0aca33c63ed0"; // Convex stETH/ETH deposit token
const amountIn = parseUnits("1", 18); // 1 ETH
const bundle = await client.getBundleData(
{
chainId,
fromAddress,
routingStrategy: "router",
},
[
{
// Step 1: Deposit into Curve stETH/ETH pool using standard "deposit" action
protocol: "curve-stableswap-legacy",
action: "deposit",
args: {
tokenIn: [tokenInEth],
tokenOut: lpTokenStethEth, // stETH/ETH LP token
amountIn: [amountIn.toString()],
primaryAddress: stEthEthPool, // Curve stETH pool address
},
},
{
// Step 2: Deposit LP tokens into Convex for boosted rewards
protocol: "convex-lp",
action: "deposit",
args: {
tokenIn: lpTokenStethEth, // stETH/ETH LP token
tokenOut: cvxsteCRV, // Convex deposit token
amountIn: {
useOutputOfCallAt: 0, // Use LP tokens from Curve deposit
},
primaryAddress: convexBooster, // Convex Booster
},
},
{
// Step 3: Check the received cvxsteCRV against 0.5% slippage
protocol: "enso",
action: "slippage",
args: {
amountOut: { useOutputOfCallAt: 1 },
bps: "50",
},
},
],
);
await sendEoa(bundle.tx, bundle.gas);