Setting Manual Gas Limits

AbstractJS assigns generous default gas limits to every instruction so you can prototype quickly without tweaking gasLimit values. Once you move to production, those defaults become sub-optimal—quotes may look expensive and confuse users.

Why you should care

Understanding the difference between development and production gas limit strategies is crucial for user experience.
StageDefault behaviourImpact
PoC / testingHigh gas limits keep dev friction near-zeroFaster iterations
ProductionHigh limits over-inflate the quoted priceUsers see a larger “max cost” and may drop off

Quote vs. Actual Cost

The price returned by meeClient.getQuote() is a maximum. If you overshoot, MEE refunds all unspent gas to the user on-chain.
Lowering gasLimit keeps the quote realistic and improves conversion, without risking “out of gas” as long as you size it sensibly.

How to set manual limits

Add a gasLimit field (in wei) to each instruction’s data object:
const instruction = await orchestrator.buildComposable({
  type: "default",
  data: {
    abi: erc20Abi,
    to: "0xUSDC_ADDRESS",
    chainId: optimism.id,
    functionName: "transfer",
    args: [
      "0xRecipient",
      parseUnits("10", 6),
    ],
    gasLimit: 35_000n, // manual limit
  },
});
1

Start high

Observe gas used in testnet with generous limits
2

Trim the limit

Set limit to ~20% above observed usage
3

Ship to production

Deploy with explicit limits so quotes stay tight

Key Takeaways

High defaults are fine for development, but tune gas limits before mainnet launch

Quotes show maximum cost; unused gas is always refunded

Clear, lower quotes reduce sticker shock and user drop-off