> For the complete documentation index, see [llms.txt](https://bladeswap.gitbook.io/bladeswap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bladeswap.gitbook.io/bladeswap/blades-edge/gas-optimization.md).

# Gas Optimization

<table data-full-width="false"><thead><tr><th width="192">Dex</th><th width="124">Bladeswap</th><th data-type="number">U** swap (V3)</th><th data-type="number">P** swap</th><th data-type="number">i** swap</th><th data-type="number">k** swap</th></tr></thead><tbody><tr><td>ETH->USDC swap</td><td>104069</td><td>127543</td><td>184329</td><td>197983</td><td>246445</td></tr><tr><td>Swap with 1 hop<br>(ex. ETH->USDC-> USDT )</td><td>144093</td><td>235295</td><td>258926</td><td>579632</td><td>396242</td></tr><tr><td>Add ETH-USDC  LP</td><td>148185</td><td>401924</td><td>511149</td><td>614200</td><td>459928</td></tr></tbody></table>

Even though L2 gas fees aren't as high as on the ETH mainnet, they can still be quite expensive.&#x20;

Just as vectorized.eth achieved gas optimization in ERC721a, BladeSwap's core contract is dedicated to optimizing gas at every stage.

&#x20;Through an internal accounting method, it conducts only net transfers instead of token transfers for each pair in multi-hop swap paths.&#x20;

It also minimizes storage slot usage through byte packing and utilizes assembly code where necessary, creating a highly efficient codebase with the best efforts.
