# Sequencer

The Sequencer plays a crucial role in:

* **Receiving Proofs:** Securely receives proofs from CPs.
* **Validating Proofs:** Checks the integrity, authenticity, and timeliness of proofs, including CP signatures.
* **Batching Proofs:** Aggregates proofs into blobs for efficient storage and processing.
* **Submitting Data:** Submits aggregated task data to the Swan Chain, creating AggregateTask contracts with blob CIDs.
* **Gas Fee Management:** Manages gas fees for CPs, maintaining separate accounts for gas costs and charging a small fee per task.

**Dynamic Pricing Strategy**

Due to significant increases in ETH mainnet gas prices, the Sequencer has implemented a dynamic pricing strategy to maintain stable L3 operations. The price per proof is calculated using the following formula:

$$
Gas = \frac{ \frac{Gas\_{base}}{GasPrice\_{base}}\*GasPrice\_{real}}{Count\_{proof}}
$$

$$
Gas\_{L3} =  \min(Gas, Gas\_{max})
$$

Where:

* $$Gas\_{base}$$ = 0.01 ETH
* $$GasPrice\_{base}$$ = 20 Gwei
* $$GasPrice\_{real}$$ = Current ETH mainnet gas price at the time of L3 chain interaction
* $$Gas\_{max}$$ = 0.00001 ETH

For example, based on recent network conditions (as of November 12):

* Daily network-wide proof submissions ($$Count\_{proof}$$) = 8,500
* Average gas price ($$GasPrice\_{real}$$) = 25 Gwei

$$
Gas\_{L3} = \min( \frac{ \frac{0.01}{20}\*25 }{8500}, 0.00001)=0.000001470588235 ETH
$$

This results in an adjusted gas fee that ensures efficient operation while maintaining cost-effectiveness for all participants.


---

# 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.swanchain.io/bulders/market-provider/web3-zk-computing-market/sequencer.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.
