Setting Manual Gas Limits
AbstractJS assigns generous default gas limits to every instruction so you can prototype quickly without tweakinggasLimit
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.
Stage | Default behaviour | Impact |
---|---|---|
PoC / testing | High gas limits keep dev friction near-zero | Faster iterations |
Production | High limits over-inflate the quoted price | Users 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.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 agasLimit
field (in wei) to each instruction’s data
object:
Recommended workflow
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