Skip to content

Commit

Permalink
v4 concepts: erc6909 (#745)
Browse files Browse the repository at this point in the history
Co-authored-by: saucepoint <[email protected]>
  • Loading branch information
0xdevant and saucepoint authored Sep 12, 2024
1 parent 2ad677f commit 2d46785
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions docs/contracts/v4/concepts/03-erc6909.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@
title: ERC-6909
---

(TODO: talk about ERC-6909 claims / redemptions)
Uniswap v4 uses [ERC-6909](https://eips.ethereum.org/EIPS/eip-6909) to further improve gas-efficiency on token claims and redemptions.

ERC-6909 is a simple multi-token contract standard. The token standard is analogous to managing multiple ERC-20 tokens from a single smart contract - similar to ERC-1155. The major difference between ERC-6909 vs. ERC-1155 is granular approvals and the removal of inefficient safe transfer callbacks.

# How it works

Instead of choosing to move tokens in/out of the `PoolManager`, developers can opt-in and leave the ERC-20 tokens within the `PoolManager`. In exchange, the `PoolManager` can **mint them an ERC-6909 token representing their claim**. In subsequent interactions requiring _paying_ tokens, users will not need to transfer ERC-20 tokens into the `PoolManager` - users can simply _burn_ some (or all) of their claim tokens they have


Doing _real_ ERC-20 token transfers requires calls to external smart contracts - incurring gas overhead compared to internal accounting. Secondly, these external smart contracts have their own custom logic within their transfer functions - for example USDC's blocked-address list - which is a further gas overhead. Thus, minting and burning ERC-6909 tokens are more gas-efficient because they don't require external function calls and have a constant-size gas overhead regardless of the underlying ERC-20 token.

This mechanism therefore helps further reduce gas costs. All these gas cost reductions overall make pools much more competitive based on the fees they charge.

# Examples

## High-frequency traders / MEV bots

These users are often conducting a lot of swaps in relatively short durations of time, while staying within the Uniswap Protocol. These power-users can trade using ERC-6909 tokens for improved gas-efficiency.


## Liquidity management

ERC-6909 does not only benefit swappers. For power-users that may be opening and closing liquidity positions frequently, liquidity managers can opt-in and receive their capital as ERC-6909.




(TODO: talk about gas benefits, and users i.e. mev bots and high-frequency traders)

0 comments on commit 2d46785

Please sign in to comment.