docs: clarify ReservesLens coreAmount0/1 cover the whole curve, not in-range depth - #1145
Open
david-uniswap wants to merge 1 commit into
Open
docs: clarify ReservesLens coreAmount0/1 cover the whole curve, not in-range depth#1145david-uniswap wants to merge 1 commit into
david-uniswap wants to merge 1 commit into
Conversation
…n-range depth Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Thanks for contributing to Uniswap Docs! 🦄 Quick heads up on how this repo works: the docs you see on developers.uniswap.org are built from a separate source repo. When we accept a change here, we port it over there, so your fix might show up on the live site before it lands in this repo. Updates to this repo come in batches on a regular cadence. When yours is included, you'll be credited as a co-author on the commit, so the contribution counts on your GitHub profile and in Uniswap/docs. We review every PR but can't merge everything. Either way, someone from the docs team will follow up here once we've taken a look. One legal bit: by submitting a PR you agree your contribution is licensed under the repo's MIT license. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The reading-pool-reserves guide implied
coreAmount0/1are in-range swappable depth ("token amounts represented by the liquidity curve at the current price", "the honest swappable-depth number"). That's not what the lens computes: it walks every initialized tick and converts all positions (in and out of range) back to raw token amounts. The current price only determines the token0/token1 split of the one range that straddles it.Changes:
coreAmount0/1row: whole curve, all positions, current price just sets the split of the straddling rangeactiveLiquidityif they want swappable depth at the current priceMatches the NatSpec in v4-periphery
IReservesLens.sol("liquidity principal at the current price... exclude uncollected LP fees, protocol fees, donations, and hook-managed assets").🤖 Generated with Claude Code