Skip to content

Fixed broken links for example file - active-liquidity.ts #882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/sdk/v3/guides/advanced/03-active-liquidity.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ We define our GraphQL query and [send a POST request](https://axios-http.com/doc

```typescript
axios.post(
"https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3",
"https://gateway.thegraph.com/api/${api_key}/subgraphs/id/5zvR82QoaXYFyDEKLZ9t6v9adgnptxYpKpSbxtgVENFV",
{"query": `{ ticks(
where: {poolAddress: "${poolAddress.toLowerCase()}", liquidityNet_not: "0"}
first: 1000,
Expand Down Expand Up @@ -246,7 +246,7 @@ for (let i = 0; i < 100; i++) {
```

After we are done calculating the next 100 Ticks after the current Tick, we iterate in the opposite direction for the previous Ticks. Iterating downwards, we need to subtract the net liquidity where we added it when iterating upwards.
You can find a full code example in the [Uniswap Example repository](https://github.com/Uniswap/examples/tree/main/v3-sdk/active-liquidity).
You can find a full code example in the [Uniswap Example repository](https://github.com/Uniswap/examples/blob/main/v3-sdk/pool-data/src/libs/active-liquidity.ts).

We are finally able to combine the previous, active and subsequent Ticks:

Expand Down Expand Up @@ -289,7 +289,7 @@ Finally, we draw the Chart:
```

In a real application, you will probably want to format the chart properly and display additional information for users.
Check out the full [code example](https://github.com/Uniswap/examples/tree/main/v3-sdk/active-liquidity) to this guide and the official recharts [documentation](https://recharts.org/).
Check out the full [code example](https://github.com/Uniswap/examples/blob/main/v3-sdk/pool-data/src/libs/active-liquidity.ts) to this guide and the official recharts [documentation](https://recharts.org/).

You can also take a look at the [Uniswap Info](https://github.com/Uniswap/v3-info) repository to see a similar chart used in production.

Expand All @@ -300,7 +300,7 @@ The total locked liqudity in the tooltip represents the sum of positions in the
It is calculated as the maximum token output of a swap when crossing to the next Tick.
The V3 pool here is initialized with only the liquidity of the current Tick.

Depending on your use case, it may make sense to display this value. You can find the full code in the [code example](https://github.com/Uniswap/examples/tree/main/v3-sdk/active-liquidity).
Depending on your use case, it may make sense to display this value. You can find the full code in the [code example](https://github.com/Uniswap/examples/blob/main/v3-sdk/pool-data/src/libs/active-liquidity.ts).

## Next Steps

Expand Down