Gas requirement
Last updated
Last updated
Gas requirement (gasreq) is the total amount of gas that the requires to execute an offer. This is an important measure as it goes into calculating the which is used to compensate the taker's wasted gas on offer failure.
The required gas depends on the actual code path taken in the contract, so it should cover the worst case where you want the offer to succeed. Recall that offer logic is both and , then the estimation has the following consequences:
Underestimating gasreq: if offer logic runs out of gas during makerExecute
, the maker is penalized and the taker gets a bounty. If makerPosthook
runs out of gas, it is not executed (and offer bookkeeping that should have occurred in posthook is lost).
Overestimating gasreq: offer is seen as less attractive for a taker (see ) and requires more provision, it also requires more outbound token volume (to match ).
To get an idea of the gasreq for your contract, see which also covers extra details when using the strat library.