# zkSync Gas Fee Guide

While ZK provides better user privacy and lower gas fees compared to Ethereum mainnet, the fees calculation mechanism in zkSync is different from Ethereum, Arbitrum or Optimism.&#x20;

Users usually only spend a portion of the estimated transaction cost and they receive unused portions in the form of a refund.

At times, you may receive up to 70% of the fee cost with a refund. It is an automatic process and it is not controlled by users nor DerpDEX.&#x20;

<figure><img src="https://lh3.googleusercontent.com/oT8pyIp8rHhAmXCkF4pTwwFT5kXT_WzOoCStXP0EtOoWuzFzpNSRcmPSs4Xikc7zJN3xY0x_aedywvmdFqMKBXMWLpbrJxkeS1raABtCwjfcQUIHPO4m6oUdW4o2mTyzVmuWh4tkwJwc4_jGve-V_Fk" alt=""><figcaption></figcaption></figure>

**Parameter to reduce Gas Limit**&#x20;

This parameter is set automatically in the wallet when a transaction is called. For a more customized parameter, potentially, the user can set a 50% reduction to the gas limit (please experiment at your own risk).

**Default Setting**&#x20;

<figure><img src="https://lh6.googleusercontent.com/c5Rmzz7Q75ZrmC3xljiHZQVKq9XnJr38dPoVAB5AUhrrCDxvLeUT55Btf7XyPOcR8flBqT6Yj8TH2hqOwSE3mGsrr0dt34iz3wuy8tTTlaTN_QtIBZ0Yi1I9FnXOboUk4eyU8c9O4MLcGVlvPN8JuoU" alt="" width="375"><figcaption></figcaption></figure>

**Experiment: Swapping 0.001 ETH for USDC**&#x20;

*<mark style="color:red;">Please experiment at your own risk and may result in a failed transaction.</mark>*&#x20;

Using the default settings, the transaction fee was $0.33 with breakdown of actual fees and refund. <br>

<figure><img src="https://lh3.googleusercontent.com/8piGuT41UKrINJDzqimypbltsRZAMxtG4_pyd4aaDTnI6aAn2lV4Vq9acHEi_0UrtoeyOwSgz95O0ZQ4igRDW-fRFD6JskupjbTWmgZH4pZOoKAkb_uhWVwAjdQO-OVjUVQdALuADIzxVAou0s0_-90" alt="" width="375"><figcaption></figcaption></figure>

<figure><img src="https://lh3.googleusercontent.com/TfDE3tM3Ji7837veTKsqVx7qipGB6FBJPIT0rY-WmbYS_23xVPA5_tloVHExb6JfgKFUNdFJKdhnLNGDklW3YO4NP6zWjg2gcmp8M0VOavofJhqhdH3yd6nXAItP9D_-qBsa24yVuVDCDGs6iUre85o" alt="" width="375"><figcaption></figcaption></figure>

Adjusting the default gas limit to **minimum value for successful transaction** i.e. 330,000 which is at least 7 times lower than the default value.&#x20;

<figure><img src="https://lh3.googleusercontent.com/1nSMOxIMAUfskObKkqZt-cvw8HZhoFAjutag0WktKSrdglDvrju-vqZq_61Fi7SKOhdf7BfooXzBD54NzFtMY2lwdP3t1ZvJAaKC5BgbzkmII_SkPOy3hpx-it_1KQQSg3S_S9rum3IUunSHvIr6XPo" alt="" width="375"><figcaption></figcaption></figure>

Upon performing the transaction, you will receive 0 refund and the transaction fees is 2 times lower than the original fees ($0.33).

<figure><img src="https://lh6.googleusercontent.com/5-EEJtHpNlPg_ucfrKtEqJkAh4lK4H6bc5lbSCVVQpLfCu1V6wgOZ0ObsJyi0l1etnhyz24sgpxEISnJS4_666-51ujPHqCUhoRluTGeQiMULYhaE7gF9zfXi65YN5KOUxEPS3V6C69TzvE1nASkByc" alt="" width="375"><figcaption></figcaption></figure>

The minor difference may sum up to a significant value if you are performing higher volume and value transactions.

\
\&#xNAN;*<mark style="color:red;">Please experiment at your own risk and may result in a failed transaction.</mark>*&#x20;

\
Credits: <https://twitter.com/leshka_eth/status/1673322008418095105?s=46&t=-NCrKkS46FostsM8hS8jLg>&#x20;

\ <br>


---

# 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://derpdex.gitbook.io/home/resources/zksync-gas-fee-guide.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.
