# Gas & Fuse Limits

The TEA Project uses a **fuse** design to ensure that developer's code doesn't use more gas than expected (e.g. infinite loops, recursion).

In the TEA Project design, there's a soft limit known as the **gas limit** in addition to a hard limit where the **fuse** kicks in.&#x20;

* The end-user has a gas limit which they acknowledge they're responsible for when using the TApp.
* The developer has a security deposit that's charged whenever an actor uses more than the gas limit up until the fuse point where their entire security deposit is slashed.

Each actor has its own security deposit that the developer must fund. These security deposits correlate to the memory quota of the actor which is the max amount of memory that actor can use. This memory quota is set by the TEA Project and is the same for each actor. The larger the memory quota, the higher the security deposit.

The fuse limit sits above the gas limit and is also set by the TEA Project.

The following table summarizes what happens when these two levels, gas limit and fuse, are breached.

| Exit Stage                                                     | Exit Status                                                                         | Payment Responsibility                                                                     |
| -------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| Up to & including the **gas limit**.                           | Actor exits normally, memory is released.                                           | End-user pays for any gas amount up to the gas limit.                                      |
| Exceeded **gas limit** but not yet reached the **fuse** level. | Actor exits normally, memory is released.                                           | Developer pays for any gas amount above the gas limit, which is paid to the hosting miner. |
| **Fuse** is tripped.                                           | Actor is terminated by the mini runtime, and memory is set to be garbage collected. | Dev deposit is slashed completely when fuse is tripped and is paid to the hosting miner.   |

The developer can run their code in a [test environment](https://github.com/tearust/t-rust/blob/master/docs/_gitbook-dev-docs/030_billing/t-rust/obsidian/_gitbook-dev-docs/030_billing/local-debug-environment.md) to get an idea of each actor’s memory usage as well as test for edge cases which cause high utilization.


---

# 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://dev.teaproject.org/030_billing/gas-fuse-limits.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.
