Skip to content

create v4 data doc #927

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 11 commits into
base: main
Choose a base branch
from
Open

create v4 data doc #927

wants to merge 11 commits into from

Conversation

agaperste
Copy link

  • fix local build for images
  • make v1 of data hub doc, along with migrating the data guides over

Copy link

vercel bot commented Mar 26, 2025

@agaperste is attempting to deploy a commit to the Uniswap Team on Vercel.

A member of the Team first needs to authorize it.

@agaperste
Copy link
Author

@saucepoint ready for review 🙏

Copy link
Collaborator

@saucepoint saucepoint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just reviewed data_hub for now

agaperste and others added 7 commits April 22, 2025 17:27
Co-authored-by: saucepoint <98790946+saucepoint@users.noreply.github.com>
Co-authored-by: saucepoint <98790946+saucepoint@users.noreply.github.com>
Co-authored-by: saucepoint <98790946+saucepoint@users.noreply.github.com>
Co-authored-by: saucepoint <98790946+saucepoint@users.noreply.github.com>
Co-authored-by: saucepoint <98790946+saucepoint@users.noreply.github.com>
Co-authored-by: saucepoint <98790946+saucepoint@users.noreply.github.com>
Welcome to the Uniswap v4 Data Hub — your central resource for understanding Uniswap v4 metrics, hook data standards, and accessing Uniswap v4 data tools.

:::info
Join the conversation on v4 hook data standards in our Telegram group: https://t.me/v4_hooks_data.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Join the conversation on v4 hook data standards in our Telegram group: https://t.me/v4_hooks_data.
Join the conversation on v4 hook data standards in our [Telegram group](https://t.me/v4_hooks_data)

#### Custom Curve
![Custom Curve Flow](./guides/images/hook_diagram_custom_curves.png)

In v4, developers can bypass the built-in v3 concentrated liquidity by using [custom accounting](https://docs.uniswap.org/contracts/v4/guides/custom-accounting), allowing them to implement their own swap curves. This enables custom liquidity provisioning and swap logic. [Custom curves](https://www.v4-by-example.org/hooks/custom-curve) are enabled through `Hooks.BEFORE_SWAP_FLAG` and `Hooks.BEFORE_SWAP_RETURNS_DELTA_FLAG`. Examples of such curves include:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few more references in this file where we're hard-linking the domain. would just ctrl+F "https://docs.uniswap.org/"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also lets not link v4-by-example, its pretty out of date and dont have bandwidth to maintain 😭


Now, v4 retains those v3 benefits but layers on new features such as a singleton architecture and hooks, enabling more efficient and creative AMM expression. These innovations also complicate the data landscape:

- **Singleton [PoolManager](https://docs.uniswap.org/contracts/v4/reference/core/PoolManager)** replaces factory-created pool contracts, changing how we track pool creation and liquidity events.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more hard links that we should clean up -- i.e. strip off the domain / base URL


As we covered in the previous [v4 data guide](https://uniswapfoundation.mirror.xyz/c7LDDTWhC2ry6gp0nGqcSKHvNHosJmhPQ-ZuIxqeB2I), [hooks](https://docs.uniswap.org/contracts/v4/concepts/hooks) are the defining feature of Uniswap v4. They enable developers to customize and extend the behavior of liquidity pools. In this guide, we aim to establish a standard for hook developers, hook data indexers, and analysts, such that all users, from developers and LPs to analysts, can use the same shared framework when it comes to hook data.

_Want to collect this guide on Mirror? [Click here to grab it](https://uniswapfoundation.mirror.xyz/KGKMZ2Gbc_I8IqySVUMrEenZxPnVnH9-Qe4BlN1qn0g)._
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

:::

## Hooks vs. Uni v4
But first, let’s clarify how hooks fit into v4. Think of them as plugins or external APIs for the `PoolManager` contract. Each pool can only link to one hook, but a single hook contract can serve multiple pools. Once a pool is initialized with a hook, that pool becomes a “hooked pool” (as opposed to a “vanilla pool”), and the hook itself is then considered “initialized.” By contrast, a hook contract with no pools is just an unused Solidity contract that implements a subset of the [core hook functions](https://docs.uniswap.org/contracts/v4/concepts/hooks#core-hook-functions).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more https://docs.uniswap.org/... links in this file that should be stripped out

_Want to collect this guide on Mirror? [Click here to grab it](https://uniswapfoundation.mirror.xyz/KGKMZ2Gbc_I8IqySVUMrEenZxPnVnH9-Qe4BlN1qn0g)._

:::info
Join the conversation on v4 hook data standards in our Telegram group: https://t.me/v4_hooks_data.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Join the conversation on v4 hook data standards in our Telegram group: https://t.me/v4_hooks_data.
Join the conversation on v4 hook data standards in our [Telegram group](https://t.me/v4_hooks_data)

Join the conversation on v4 hook data standards in our Telegram group: https://t.me/v4_hooks_data.
:::

## Hooks vs. Uni v4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Hooks vs. Uni v4
## Hooks vs. Uniswap v4

Comment on lines +202 to +204
:::info
Join the conversation on v4 hook data standards in our Telegram group: https://t.me/v4_hooks_data.
:::
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this if it exists at the top of the page?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants