Skip to content

Commit

Permalink
formatting & notes
Browse files Browse the repository at this point in the history
  • Loading branch information
saucepoint committed Sep 7, 2024
1 parent c6b1f64 commit 5444ca3
Show file tree
Hide file tree
Showing 49 changed files with 257 additions and 17 deletions.
30 changes: 30 additions & 0 deletions docs/contracts/v4/concepts/01-v4-vs-v3.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: v4-versus-v3
---

While Uniswap v4's underlying concetrated liquidity is the same as Uniswap v3, there are some key differences in the architecture
and accounting.

# Singleton Design

### Pool Creation

(TODO: talk about singleton vs factory, state vs contract/V3Pool)

### Flash Accounting

(TODO: talk about flash accounting, multi-hop swaps)

# Liquidity Fee Accounting

(TODO: talk about how fees must be collected on liquidity operation)

(TODO: talk about fees are automatically credited in increase liquidity)

(TODO: talk about salts)

# Native ETH

(TODO: talk about native ETH vs WETH)

# Subscribers
15 changes: 15 additions & 0 deletions docs/contracts/v4/concepts/02-flash-accounting.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Flash Accounting
---

# Flash Accounting

## Deltas

(TODO: explain deltas / net deltas)

## Swapping
(TODO: talk about flash accounting, multi-hop swaps)

## Liquidity Management
(TODO: talk about complex liquidity operations)
7 changes: 7 additions & 0 deletions docs/contracts/v4/concepts/03-erc6909.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: ERC-6909
---

(TODO: talk about ERC-6909 claims / redemptions)

(TODO: talk about gas benefits, and users i.e. mev bots and high-frequency traders)
4 changes: 4 additions & 0 deletions docs/contracts/v4/concepts/04-hooks.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Hooks
---

7 changes: 7 additions & 0 deletions docs/contracts/v4/concepts/05-subscribers.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Subscribers
---

(TODO: talk abotu liquidity staking / subscribers)

(TODO: be sure to emphasize that subscribers dont have access to the capital)
5 changes: 5 additions & 0 deletions docs/contracts/v4/concepts/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "Concepts",
"position": 3,
"collapsed": true
}
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
30 changes: 29 additions & 1 deletion docs/contracts/v4/deployments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,32 @@
id: deployments
title: Deployments
sidebar_position: 1.1
---
---

# Uniswap v4 Deployments

## Sepolia: 11155111

| Contract | Address |
|-------------------------|--------------------------------------------|
| PoolManager | 0xA |
| PoolModifyLiquidityTest | 0xB |
| PoolSwapTest | 0xC |
| PositionManager | 0xD |
| StateView | 0xE |
| Quoter | 0xF |
| ViewQuoter | 0xG |
| Universal Router | 0xH |

## Base Sepolia: 84532

| Contract | Address |
|-------------------------|--------------------------------------------|
| PoolManager | 0xA |
| PoolModifyLiquidityTest | 0xB |
| PoolSwapTest | 0xC |
| PositionManager | 0xD |
| StateView | 0xE |
| Quoter | 0xF |
| ViewQuoter | 0xG |
| Universal Router | 0xH |
5 changes: 5 additions & 0 deletions docs/contracts/v4/deprecated/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "DEPRECATED",
"position": 1000,
"collapsed": true
}
22 changes: 22 additions & 0 deletions docs/contracts/v4/deprecated/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Uniswap V4 - Hooks

Welcome to the Uniswap V4 developer documentation.

Uniswap V4 is designed to enhance the way liquidity is provided and tokens are traded on-chain. It aims to broaden the
scope of decentralized trading. The project welcomes community participation, providing a platform for developers and
enthusiasts to contribute to this new version of the Uniswap Protocol.

A significant feature in Uniswap V4 is the introduction of "hooks." These contracts operate at different stages in a
pool action's lifecycle, allowing for a high degree of customization.

Pool creators have the option to maintain the tradeoff decisions available in V3 or to explore new features.
Uniswap V4 pools can support dynamic fees, on-chain limit orders, or act as a time-weighted average market
maker (TWAMM) to spread large orders over time. The architecture has been updated, including a new "singleton"
contract where all pools are contained within a single smart contract, enhancing the platform's efficiency and
reducing costs.

The integration of hooks with the singleton architecture is expected to make the platform more powerful and
versatile, ensuring fast, secure, and efficient customization and routing across various pools.

Note: V4 is currently in development, and changes are ongoing in the contracts. Updates to the documentation
will be provided accordingly.
7 changes: 7 additions & 0 deletions docs/contracts/v4/guides/01-create-pool.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Create Pool
---

(TODO: document manager.initialize() and its parameters)

(TODO: mention multicall posm.intializePool)
4 changes: 4 additions & 0 deletions docs/contracts/v4/guides/02-manage-liquidity/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Manage Liquidity",
"collapsed": true
}
9 changes: 9 additions & 0 deletions docs/contracts/v4/guides/03-swap.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Swap
---

(TODO: reference universal router?)

# Single Swap

# Multihop Swap
5 changes: 5 additions & 0 deletions docs/contracts/v4/guides/04-hooks/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "Hooks",
"collapsed": true
}

File renamed without changes.
9 changes: 9 additions & 0 deletions docs/contracts/v4/guides/05-subscriber.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Subscriber
---

(TODO: explain ISubscriber)

(TODO: unsubscribe gas limit)

(TODO: explain how LP tokens need to subscribe)
11 changes: 11 additions & 0 deletions docs/contracts/v4/guides/06-unlock-callback.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Unlock Callback & Deltas
---

(TODO: explain)

1. unlock()

2. operations

3. settle/take, burn/mint, clear, & deltas
5 changes: 5 additions & 0 deletions docs/contracts/v4/guides/07-read-pool-state.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Reading Pool State
---

(TODO: explain StateLibrary and TransientStateLibrary)
5 changes: 5 additions & 0 deletions docs/contracts/v4/guides/08-testing.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Testing
---

(TODO: explain Deployers / setUp() / common operations)
5 changes: 5 additions & 0 deletions docs/contracts/v4/guides/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "Guides",
"position": 4,
"collapsed": false
}
Empty file.
Empty file.
Empty file.
Empty file removed docs/contracts/v4/guides/swap.mdx
Empty file.
Empty file.
31 changes: 15 additions & 16 deletions docs/contracts/v4/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,24 @@ title: Overview
sidebar_position: 1
---

# Uniswap V4 - Hooks
# Uniswap v4

Welcome to the Uniswap V4 developer documentation.
Uniswap v4 uses all of the capital efficiency gains of Uniswap v3, but provides gas optimizations across the entire lifecycle
and flexibility via *hooks*.

Uniswap V4 is designed to enhance the way liquidity is provided and tokens are traded on-chain. It aims to broaden the
scope of decentralized trading. The project welcomes community participation, providing a platform for developers and
enthusiasts to contribute to this new version of the Uniswap Protocol.
For additional information, see the [Uniswap v4 whitepaper](https://github.com/Uniswap/v4-core/blob/main/docs/whitepaper/whitepaper-v4.pdf).

A significant feature in Uniswap V4 is the introduction of "hooks." These contracts operate at different stages in a
pool action's lifecycle, allowing for a high degree of customization.
---


## Hooks

## Dynamic Fees

## Singleton Design

Pool creators have the option to maintain the tradeoff decisions available in V3 or to explore new features.
Uniswap V4 pools can support dynamic fees, on-chain limit orders, or act as a time-weighted average market
maker (TWAMM) to spread large orders over time. The architecture has been updated, including a new "singleton"
contract where all pools are contained within a single smart contract, enhancing the platform's efficiency and
reducing costs.
## Flash Accounting

The integration of hooks with the singleton architecture is expected to make the platform more powerful and
versatile, ensuring fast, secure, and efficient customization and routing across various pools.
## Native ETH

Note: V4 is currently in development, and changes are ongoing in the contracts. Updates to the documentation
will be provided accordingly.
## Custom Accounting
5 changes: 5 additions & 0 deletions docs/contracts/v4/reference/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "Technical Reference",
"position": 5,
"collapsed": true
}
7 changes: 7 additions & 0 deletions docs/contracts/v4/reference/core/01-overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Overview
---

# Overview

(TODO: explain core contracts, and how users should expect to use them)
5 changes: 5 additions & 0 deletions docs/contracts/v4/reference/core/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "Core",
"position": 1,
"collapsed": true
}
5 changes: 5 additions & 0 deletions docs/contracts/v4/reference/core/libraries/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "Libraries",
"position": 0,
"collapsed": true
}
5 changes: 5 additions & 0 deletions docs/contracts/v4/reference/core/libraries/state-library.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: StateLibrary.sol
---

(TODO: state library)
Empty file.
3 changes: 3 additions & 0 deletions docs/contracts/v4/reference/core/poolmanager.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: PoolManager.sol
---
5 changes: 5 additions & 0 deletions docs/contracts/v4/reference/periphery/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "Periphery",
"position": 2,
"collapsed": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "Libraries",
"position": 0,
"collapsed": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: ActionConstants.sol
---

(TODO: explain gas optimizations of using special constants)
3 changes: 3 additions & 0 deletions docs/contracts/v4/reference/periphery/libraries/actions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Actions.sol
---
5 changes: 5 additions & 0 deletions docs/contracts/v4/reference/periphery/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Overview
---

(TODO: explain periphery and how its contracts are used)
5 changes: 5 additions & 0 deletions docs/contracts/v4/reference/periphery/positionmanager.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: PositionManager.sol
---

(TODO: posm)

0 comments on commit 5444ca3

Please sign in to comment.