Skip to content

Commit 8c5d09e

Browse files
authored
General fixes for docs (#1120)
1 parent 37fc7e4 commit 8c5d09e

9 files changed

Lines changed: 60 additions & 60 deletions

File tree

docs/contracts/liquidity-launchpad/01-introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The Uniswap Liquidity Launchpad framework is built on three coordinated componen
3434

3535
1. **[Liquidity Launcher →](https://github.com/Uniswap/liquidity-launcher)** Central orchestration contract that coordinates distribution and liquidity deployment
3636
2. **[Token Factory →](https://github.com/Uniswap/uerc20-factory)** (Optional) Creates new ERC-20 tokens with metadata, or integrates existing tokens
37-
3. **Liquidity Strategies** - Modular contracts for different price discovery and liquidity mechanisms (prebuilt [LBP Strategy](https://github.com/Uniswap/liquidity-launcher) or [custom strategies](./05-strategies.md#writing-a-custom-strategy))
37+
3. **Liquidity Strategies** - Modular contracts for different price discovery and liquidity mechanisms (prebuilt [LBP Strategy](./06-strategies.md#lbpstrategybase) or [custom strategies](./06-strategies.md#writing-a-custom-strategy))
3838

3939
Each component is designed to be composable and extensible, allowing you to customize your liquidity bootstrapping while maintaining security and fairness guarantees.
4040

docs/contracts/v4/guides/position-manager.mdx

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ At its core, the Position Manager works by executing a sequence of commands:
1414
```solidity
1515
// Example: Minting a new position requires two commands
1616
bytes memory actions = abi.encodePacked(
17-
Actions.MINT_POSITION, // Create the position
18-
Actions.SETTLE_PAIR // Provide the tokens
17+
uint8(Actions.MINT_POSITION), // Create the position
18+
uint8(Actions.SETTLE_PAIR) // Provide the tokens
1919
);
2020
```
2121

@@ -108,17 +108,17 @@ Understanding how operations create and resolve deltas helps in ordering them ef
108108
```solidity
109109
// Efficient: Group operations that create deltas, then resolve them together
110110
bytes memory actions = abi.encodePacked(
111-
Actions.MINT_POSITION, // First delta: -100 tokens
112-
Actions.INCREASE_LIQUIDITY, // Second delta: -50 tokens
113-
Actions.SETTLE_PAIR // Resolve total: -150 tokens at once
111+
uint8(Actions.MINT_POSITION), // First delta: -100 tokens
112+
uint8(Actions.INCREASE_LIQUIDITY), // Second delta: -50 tokens
113+
uint8(Actions.SETTLE_PAIR) // Resolve total: -150 tokens at once
114114
);
115115
116116
// Less efficient: Resolving deltas multiple times
117117
bytes memory actions = abi.encodePacked(
118-
Actions.MINT_POSITION, // Delta: -100 tokens
119-
Actions.SETTLE_PAIR, // Resolve: -100 tokens
120-
Actions.INCREASE_LIQUIDITY, // New delta: -50 tokens
121-
Actions.SETTLE_PAIR // Resolve again: -50 tokens
118+
uint8(Actions.MINT_POSITION), // Delta: -100 tokens
119+
uint8(Actions.SETTLE_PAIR), // Resolve: -100 tokens
120+
uint8(Actions.INCREASE_LIQUIDITY), // New delta: -50 tokens
121+
uint8(Actions.SETTLE_PAIR) // Resolve again: -50 tokens
122122
);
123123
```
124124

@@ -190,8 +190,8 @@ Define the sequence of operations needed for minting:
190190
// 1. MINT_POSITION - Creates the position and calculates token requirements
191191
// 2. SETTLE_PAIR - Provides the tokens needed
192192
bytes memory actions = abi.encodePacked(
193-
Actions.MINT_POSITION,
194-
Actions.SETTLE_PAIR
193+
uint8(Actions.MINT_POSITION),
194+
uint8(Actions.SETTLE_PAIR)
195195
);
196196
```
197197

@@ -249,18 +249,18 @@ Unlike minting where we always use SETTLE_PAIR, increasing liquidity has differe
249249

250250
```solidity
251251
bytes memory actions = abi.encodePacked(
252-
Actions.INCREASE_LIQUIDITY,
253-
Actions.SETTLE_PAIR
252+
uint8(Actions.INCREASE_LIQUIDITY),
253+
uint8(Actions.SETTLE_PAIR)
254254
);
255255
```
256256

257257
**2. Fee Conversion**: When converting accumulated fees to liquidity
258258

259259
```solidity
260260
bytes memory actions = abi.encodePacked(
261-
Actions.INCREASE_LIQUIDITY,
262-
Actions.CLOSE_CURRENCY, // For token0
263-
Actions.CLOSE_CURRENCY // For token1
261+
uint8(Actions.INCREASE_LIQUIDITY),
262+
uint8(Actions.CLOSE_CURRENCY), // For token0
263+
uint8(Actions.CLOSE_CURRENCY) // For token1
264264
);
265265
```
266266

@@ -293,14 +293,14 @@ Choose the appropriate delta resolution based on whether we’re using fees:
293293
bytes memory actions;
294294
if (useFeesAsLiquidity) {
295295
actions = abi.encodePacked(
296-
Actions.INCREASE_LIQUIDITY, // Add liquidity
297-
Actions.CLOSE_CURRENCY, // Handle token0 (might need to pay or receive)
298-
Actions.CLOSE_CURRENCY // Handle token1 (might need to pay or receive)
296+
uint8(Actions.INCREASE_LIQUIDITY), // Add liquidity
297+
uint8(Actions.CLOSE_CURRENCY), // Handle token0 (might need to pay or receive)
298+
uint8(Actions.CLOSE_CURRENCY) // Handle token1 (might need to pay or receive)
299299
);
300300
} else {
301301
actions = abi.encodePacked(
302-
Actions.INCREASE_LIQUIDITY, // Add liquidity
303-
Actions.SETTLE_PAIR // Provide tokens
302+
uint8(Actions.INCREASE_LIQUIDITY), // Add liquidity
303+
uint8(Actions.SETTLE_PAIR) // Provide tokens
304304
);
305305
}
306306
```
@@ -366,8 +366,8 @@ When decreasing liquidity, you’ll receive tokens, so it's most common to recei
366366

367367
```solidity
368368
bytes memory actions = abi.encodePacked(
369-
Actions.DECREASE_LIQUIDITY,
370-
Actions.TAKE_PAIR
369+
uint8(Actions.DECREASE_LIQUIDITY),
370+
uint8(Actions.TAKE_PAIR)
371371
);
372372
```
373373

@@ -452,8 +452,8 @@ function collectFees(
452452
) external {
453453
// Define the sequence of operations
454454
bytes memory actions = abi.encodePacked(
455-
Actions.DECREASE_LIQUIDITY, // Remove liquidity
456-
Actions.TAKE_PAIR // Receive both tokens
455+
uint8(Actions.DECREASE_LIQUIDITY), // Remove liquidity
456+
uint8(Actions.TAKE_PAIR) // Receive both tokens
457457
);
458458
459459
// Prepare parameters array
@@ -529,8 +529,8 @@ function burnPosition(
529529
// 1. BURN_POSITION - Removes the position and creates positive deltas
530530
// 2. TAKE_PAIR - Sends all tokens to the recipient
531531
bytes memory actions = abi.encodePacked(
532-
Actions.BURN_POSITION,
533-
Actions.TAKE_PAIR
532+
uint8(Actions.BURN_POSITION),
533+
uint8(Actions.TAKE_PAIR)
534534
);
535535
```
536536

@@ -607,9 +607,9 @@ function rebalanceLiquidity(
607607
) external {
608608
// Group liquidity operations first, then delta resolutions
609609
bytes memory actions = abi.encodePacked(
610-
Actions.BURN_POSITION, // Remove old position
611-
Actions.MINT_POSITION, // Create new position
612-
Actions.SETTLE_PAIR // Provide tokens for new position
610+
uint8(Actions.BURN_POSITION), // Remove old position
611+
uint8(Actions.MINT_POSITION), // Create new position
612+
uint8(Actions.SETTLE_PAIR) // Provide tokens for new position
613613
);
614614
```
615615

@@ -686,8 +686,8 @@ When you can’t predict whether you’ll need to pay or receive tokens, CLOSE_C
686686
```solidity
687687
// Example scenario: Converting fees to liquidity
688688
bytes memory actions = abi.encodePacked(
689-
Actions.INCREASE_LIQUIDITY,
690-
Actions.CLOSE_CURRENCY // Will automatically settle or take based on final delta
689+
uint8(Actions.INCREASE_LIQUIDITY),
690+
uint8(Actions.CLOSE_CURRENCY) // Will automatically settle or take based on final delta
691691
);
692692
693693
bytes[] memory params = new bytes[](2);
@@ -739,8 +739,8 @@ SWEEP helps recover any excess tokens sent to the PoolManager:
739739

740740
```solidity
741741
bytes memory actions = abi.encodePacked(
742-
Actions.YOUR_MAIN_OPERATION,
743-
Actions.SWEEP // Add at the end to collect any excess
742+
uint8(Actions.YOUR_MAIN_OPERATION),
743+
uint8(Actions.SWEEP) // Add at the end to collect any excess
744744
);
745745
746746
// Parameters for SWEEP

docs/sdk/v3/guides/advanced/02-pool-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const USDC_TOKEN = new Token(
7272
'0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
7373
6,
7474
'USDC',
75-
'USD//C'
75+
'USDC'
7676
)
7777
```
7878

docs/sdk/v3/guides/swaps/01-quoting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const USDC_TOKEN = new Token(
112112
'0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
113113
6,
114114
'USDC',
115-
'USD//C'
115+
'USDC'
116116
)
117117
```
118118

@@ -184,7 +184,7 @@ We get access to the contract's ABI through the [@uniswap/v3-periphery](https://
184184
import Quoter from '@uniswap/v3-periphery/artifacts/contracts/lens/Quoter.sol/Quoter.json'
185185
```
186186

187-
We get the QUOTE_CONTRACT_ADDRESS for our chain from [GitHub](https://github.com/Uniswap/v3-periphery/blob/main/deploys.md).
187+
We get the QUOTER_CONTRACT_ADDRESS for our chain from [GitHub](https://github.com/Uniswap/v3-periphery/blob/main/deploys.md).
188188

189189
We can now use our Quoter contract to obtain the quote.
190190

docs/sdk/v4/guides/advanced/pool-data.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export const CurrentConfig: ExampleConfig = {
4040
},
4141
...
4242
poolKey: {
43-
currency0: USDC_TOKEN.address,
44-
currency1: ETH_TOKEN.address,
43+
currency0: ETH_TOKEN.address,
44+
currency1: USDC_TOKEN.address,
4545
fee: FEE_AMOUNT_LOW,
4646
tickSpacing: TICK_SPACING_TEN,
4747
hooks: EMPTY_HOOK,
@@ -73,7 +73,7 @@ export const USDC_TOKEN = new Token(
7373

7474
## Computing the PoolId out of PoolKey
7575

76-
In this example, we will construct the **USDC - ETH** Pool with **LOW** fees and without hooks. The SDK provides a method to compute the `PoolId` for this pool:
76+
In this example, we will construct the **ETH - USDC** Pool with **LOW** fees and without hooks. The SDK provides a method to compute the `PoolId` for this pool:
7777

7878
```typescript
7979
import { Pool } from '@uniswap/v4-sdk';
@@ -85,7 +85,7 @@ const poolId = Pool.getPoolId(currency0, currency1, fee, tickSpacing, hooks);
8585

8686
## Referencing the StateView contract and fetching metadata
8787

88-
Now that we have the `PoolId` of a **USDC - ETH** Pool, we need to call [StateView](/contracts/v4/guides/state-view) contract to get the pool state. In v4 you need to use `StateLibrary` to read pool state, but offchain systems—such as frontends or analytics services—require a deployed contract with view functions. This is where `StateView` comes in.
88+
Now that we have the `PoolId` of a **ETH - USDC** Pool, we need to call [StateView](/contracts/v4/guides/state-view) contract to get the pool state. In v4 you need to use `StateLibrary` to read pool state, but offchain systems—such as frontends or analytics services—require a deployed contract with view functions. This is where `StateView` comes in.
8989
To construct the Contract we need to provide the address of the contract, its ABI and a provider connected to an RPC endpoint.
9090

9191
```typescript
@@ -103,7 +103,7 @@ const stateViewContract = new ethers.Contract(
103103

104104
We get the `STATE_VIEW_ADDRESS` for our chain from [Uniswap Deployments](/contracts/v4/deployments).
105105
Once we have set up our reference to the contract, we can proceed to access its methods. To construct our offchain representation of the Pool, we need to fetch its liquidity, sqrtPrice, currently active tick and the full Tick data.
106-
We get the **liquidity**, **sqrtPrice** and **tick** directly from the blockchain by calling `getLiquidity()`and `getSlot0()` on the StateView contract:
106+
We get the **liquidity**, **sqrtPrice** and **tick** directly from the blockchain by calling `getLiquidity()` and `getSlot0()` on the StateView contract:
107107

108108
```typescript
109109
const [slot0, liquidity] = await Promise.all([
@@ -127,12 +127,12 @@ For our use case, we only need the `sqrtPriceX96` and the currently active `tick
127127
## Fetching all Ticks
128128

129129
v4 pools use ticks to [concentrate liquidity](/concepts/protocol/concentrated-liquidity) in price ranges and allow for better pricing of trades.
130-
Even though most Pools only have a couple of **initialized ticks**, it is possible that a pools liquidity is defined by thousands of **initialized ticks**.
130+
Even though most Pools only have a couple of **initialized ticks**, it is possible that a pool's liquidity is defined by thousands of **initialized ticks**.
131131
In that case, it can be very expensive or slow to get all of them with normal RPC calls.
132132

133133
If you are not familiar with the concept of ticks, check out the [`introduction`](/concepts/protocol/concentrated-liquidity#ticks).
134134

135-
To access tick data, we will use the `getTickInfo` function of the State View contract:
135+
To access tick data, we will use the `getTickInfo` function of the StateView contract:
136136

137137
```solidity
138138
function getTickInfo(PoolId poolId, int24 tick)
@@ -148,7 +148,7 @@ To access tick data, we will use the `getTickInfo` function of the State View co
148148

149149
The `tick` parameter that we provide the function with is the **index** (memory position) of the Tick we are trying to fetch.
150150
To get the indices of all initialized Ticks of the Pool, we can calculate them from the **tickBitmaps**.
151-
To fetch a `tickBitmap` we use a `getTickBitmap` function of the State View contract:
151+
To fetch a `tickBitmap` we use a `getTickBitmap` function of the StateView contract:
152152

153153
```solidity
154154
function getTickBitmap(
@@ -159,7 +159,7 @@ To fetch a `tickBitmap` we use a `getTickBitmap` function of the State View cont
159159

160160
A pool stores lots of bitmaps, each of which contain the status of 256 Ticks.
161161
The parameter `int16 wordPosition` the function accepts is the position of the bitMap we want to fetch.
162-
We can calculate all the position of bitMaps (or words as they are sometimes called) from the `tickSpacing` of the Pool, which is in turn dependant on the Fee tier.
162+
We can calculate all the position of bitMaps (or words as they are sometimes called) from the `tickSpacing` of the Pool, which is in turn dependent on the Fee tier.
163163

164164
So to summarise we need 4 steps to fetch all initialized ticks:
165165

@@ -176,7 +176,7 @@ Multicall contracts **aggregate results** from multiple contract calls and there
176176
This can improve the **speed** of fetching large amounts of data significantly and ensures that the data fetched is all from the **same block**.
177177

178178
We will use the Multicall2 contract by MakerDAO.
179-
We use the `ethers-muticall` npm package to easily interact with the Contract.
179+
We use the `ethers-multicall` npm package to easily interact with the Contract.
180180

181181
## Calculating all bitMap positions
182182

@@ -207,7 +207,7 @@ One word contains 256 ticks, so we can compress the ticks by right shifting 8 bi
207207

208208
Knowing the positions of words, we can now fetch them using multicall.
209209

210-
First we initialize our multicall providers and State View Contract:
210+
First we initialize our multicall providers and StateView Contract:
211211

212212
```typescript
213213
import { ethers } from 'ethers'
@@ -245,7 +245,7 @@ const results: bigint[] = (await multicallProvider.all(calls)).map(
245245
)
246246
```
247247

248-
A great visualization of what the bitMaps look like can be found in the [Uniswap v3 development book](https://uniswapv3book.com/docs/milestone_2/tick-bitmap-index/](https://uniswapv3book.com/milestone_2/tick-bitmap-index.html):
248+
A great visualization of what the bitMaps look like can be found in the [Uniswap v3 development book](https://uniswapv3book.com/milestone_2/tick-bitmap-index.html):
249249

250250
<img src={require('./images/tickBitmap_cut.png').default} alt="TickBitmap" box-shadow="none"/>
251251

@@ -262,7 +262,7 @@ const bit = 1n
262262
const initialized = (bitmap & (bit << BigInt(i))) !== 0n
263263
```
264264

265-
If the tick is **initialized**, we revert the compression from tick to word we made earlier by multiplying the word index with 256, which is the same as left shifting by 8 bit, adding the position we are currently at, and multiplying with the tickSpacing:
265+
If the tick is **initialized**, we revert the compression from tick to word we made earlier by multiplying the word index with 256, which is the same as left shifting by 8 bits, adding the position we are currently at, and multiplying with the tickSpacing:
266266

267267
```typescript
268268
const tickIndex = (ind * 256 + i) * tickSpacing
@@ -333,9 +333,9 @@ We need to parse the response from our RPC provider to JSBI values that the v4-s
333333
We have everything to construct our `Pool` now:
334334

335335
```typescript
336-
const usdcWethPool = new Pool(
337-
USDC,
338-
WETH,
336+
const usdcEthPool = new Pool(
337+
USDC_TOKEN,
338+
ETH_TOKEN,
339339
feeAmount,
340340
slot0.sqrtPriceX96,
341341
liquidity,

docs/sdk/v4/guides/liquidity/collecting-fees.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ async function verifyFeeCollection(receipt, userAddress, positionDetails, ethBal
246246

247247
### Check Your Token Balances
248248

249-
You can simply measuring the balance change in your wallet before vs. after the call. For example, read your token balances (and ETH balance) prior to calling, then after the transaction confirm the increases. Because v4 might auto-wrap or unwrap ETH, if one of the tokens was ETH you should check your ETH balance difference. In ETH pools, no ERC-20 transfer event will fire for the ETH – the ETH will be sent directly to you (as an internal transfer), which is why checking the balance or the transaction's internal traces is necessary to confirm the amount.
249+
You can simply measure the balance change in your wallet before vs. after the call. For example, read your token balances (and ETH balance) prior to calling, then after the transaction confirm the increases. Because v4 might auto-wrap or unwrap ETH, if one of the tokens was ETH you should check your ETH balance difference. In ETH pools, no ERC-20 transfer event will fire for the ETH – the ETH will be sent directly to you (as an internal transfer), which is why checking the balance or the transaction's internal traces is necessary to confirm the amount.
250250

251251
```typescript
252252
// Check native ETH balance changes

docs/sdk/v4/guides/swaps/multi-hop-swapping.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ const receipt = await tx.wait()
153153
console.log('Multi-hop swap completed! Transaction hash:', receipt.transactionHash)
154154
```
155155

156-
The token approvals for ERC20 token swaps remain the same as the [single-hop swapping guide](./02-single-hop-swapping.md).
156+
The token approvals for ERC20 token swaps remain the same as the [single-hop swapping guide](./single-hop-swapping.md).
157157

158158
## Next Steps
159159

160-
Now that you're familiar with trading, consider checking out our next guides on [pooling liquidity](../liquidity/01-pool-data.md) to Uniswap!
160+
Now that you're familiar with trading, consider checking out our next guides on [pooling liquidity](../advanced/pool-data.md) to Uniswap!

docs/sdk/v4/guides/swaps/quoting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const quoterContract = new ethers.Contract(
8484
)
8585
```
8686

87-
We get the `QUOTE_CONTRACT_ADDRESS` for our chain from [Uniswap Deployments](https://docs.uniswap.org/contracts/v4/deployments).
87+
We get the `QUOTER_CONTRACT_ADDRESS` for our chain from [Uniswap Deployments](https://docs.uniswap.org/contracts/v4/deployments).
8888

8989
We can now use our Quoter contract to obtain the quote.
9090

@@ -109,7 +109,7 @@ The result of the call is the number of output tokens you would receive for the
109109
It should be noted that `quoteExactInputSingle` is only 1 of 4 different methods that the quoter offers:
110110

111111
1. `quoteExactInputSingle` - given an input amount, produce a quote of the output amount for a swap on a single pool
112-
2. `quoteExactInput` - given an input amount, produce a quote for the output amount a swap over multiple pools
112+
2. `quoteExactInput` - given an input amount, produce a quote for the output amount for a swap over multiple pools
113113
3. `quoteExactOutputSingle` - given a desired output amount, produce a quote for the input amount on a swap over a single pool
114114
4. `quoteExactOutput` - given a desired output amount, produce a quote for the input amount in for a swap over multiple pools
115115

docs/sdk/v4/guides/swaps/single-hop-swapping.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,4 @@ The rest of the swap process remains the same.
167167

168168
## Next Steps
169169

170-
Now that you understand single-hop swaps, you might want to explore [multi-hop swaps](./03-multi-hop-swapping.md) for trading between tokens without direct pools or enough liquidity.
170+
Now that you understand single-hop swaps, you might want to explore [multi-hop swaps](./multi-hop-swapping.md) for trading between tokens without direct pools or enough liquidity.

0 commit comments

Comments
 (0)