# Gas Requirement

### Overview

The gas requirement (`gasreq`) defines how much gas an offer's logic may consume when executed by Mangrove. It plays a critical role in the [provision](/dev/protocol/technical-references/makers/offer-provisions.md) calculation, which determines the amount of native tokens locked to compensate the taker if the offer fails.

`gasreq` represents the total gas needed for the offer logic to run successfully, including both execution callbacks:

* `makerExecute` — the main trade execution logic
* `makerPostHook` — optional logic that runs after successful execution

The `gasreq` value directly affects:

* The provision locked with the offer (higher `gasreq` -> higher provision).
* The bounty amount paid to takers when an offer fails.
* The density constraint, since higher `gasreq` increases the minimal required offer size.  &#x20;

The gas requirement should be estimated to cover the worst-case successful execution path in your maker contract.

#### Underestimating `gasreq`

If your estimate is too low:

* The offer may run out of gas during `makerExecute`.
* The trade fails, and the maker is penalized (their provision pays the taker's bounty).
* If `makerPostHook` runs out of gas, it does not execute, and any expected bookkeeping or offer updates will be lost.

#### Overestimating `gasreq`

If your estimate is too high:&#x20;

* The offer becomes less attractive to takers because of the higher apparent provision cost.
* The required locked funds (provision) increase unnecessarily.
* The minimum offer size (due to density requirements) also increases.

To get an idea of the `gasreq` for your contract, see [Determining gas requirements](/dev/strat-lib/guides/determining-gas-requirements.md) which also covers extra details when using the [StratLibrary](/dev/strat-lib/what-is-the-strat-library.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mangrove.exchange/dev/protocol/technical-references/makers/gas-requirement.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
