docs: document trade-type constraints for hooked pools - #1152
Closed
wangluolingxing wants to merge 1 commit into
Closed
docs: document trade-type constraints for hooked pools#1152wangluolingxing wants to merge 1 commit into
wangluolingxing wants to merge 1 commit into
Conversation
|
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. |
5 tasks
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.
Summary
This PR documents a routing constraint for non-vanilla v4 hooks: allowlisting makes a hooked pool eligible for routing, but it does not change the hook's swap validation or make the pool compatible with every direction and trade type.
The update:
EXACT_INPUT/EXACT_OUTPUT;BEST_PRICEto the submitted trade type for Uniswap Protocol AMM routing; andThis is a generic documentation change. It does not add Morphogen-specific content to the published docs and does not change routing behavior.
Why this is needed
The current hook-routing page explains allowlisting, but not that an allowlisted hook can still reject a quote because of its direction, trade type, or current state. The Swap Routing page explains
protocolsandroutingPreference, but does not currently explain howtypeconstrains Uniswap Protocol AMM routing.A verified production case makes the missing guidance concrete:
EXACT_INPUTBuyRequiresExactOutputEXACT_OUTPUTThe Morphogen hook is source-verified, marked
vanillaSwap: false, and publicly allowlisted on Robinhood Chain. Its verified source requires MGEN buys to use exact output and MGEN sells to use exact input in both formation and permanent phases.EXACT_OUTPUTis a first-class v4 quote and execution mode, but it is a separate request type. The canonical quoter and router expose the corresponding exact-output purchase path, and a successful production transaction exercises that path with a declared maximum input and a nonzero refund.Uniswap's public Interface derives
tradeTypefrom the edited field and preserves it in the quote request. In the public UniRoute request-to-execution path reviewed for this change,tradeTypeis likewise preserved through quote processing, route selection, and trade construction.The hook registry can identify Morphogen as non-vanilla, but its current schema has no direction-specific
EXACT_INPUT/EXACT_OUTPUTcapability fields. Allowlisting therefore makes the pool eligible for routing without expressing this constraint in a standard machine-readable form.This PR does not claim that the public UniRoute repository is byte-for-byte identical to every production service. It documents the integration constraint demonstrated by Uniswap's public API definitions, interface source, routing source, hook registry, and the verified deployed hook.
Canonical production identifiers
4663)0x822850e3d25A19258eE160F8Bb33FB1345B703720xD27596adD474e5f645Cc1D2141e8Ff2A3FD33AEC0xae0acc3836678141dc58ac679d2ab66619afedf32095fde8f773aead524847ca0xFCB9b9dC8DDCaA1a71869Bf0003d6da493C8BABb0x5f586aBcED4982a88426034CD1c0Fa72F59b5756The linked production transaction requested
110,651.713076158913831201 MGEN, declared a maximum input of1.009999999964863360 ETH, spent0.999999999965211247 ETH, refunded0.009999999999652113 ETH, and succeeded onchain.Documentation changes
Hook routing
Swap routing
typefield alongsideprotocolsandroutingPreference.BEST_PRICEoptimizes routes for the submittedtypeand does not reinterpretEXACT_INPUTasEXACT_OUTPUT.Type of change
How has this been verified?
Integration and registry evidence
vanillaSwapbut has no direction or trade-type capability fieldsMorphogen contract and production evidence
Uniswap request and routing evidence
Additional corroborating public routing sources
Repository checks
git diff --check.<Callout>structure.The current public docs repository contains documentation content but no runnable current-site package, so validation covers the MDX structure and links rather than claiming a local full-site build.
Scope and non-claims
Documentation alone does not resolve the observed routing behavior. This PR intentionally limits itself to making the constraint clear for hook builders and API integrators while capability metadata or intent-translation changes are evaluated separately.
Applicable screenshots
Not applicable to the rendered documentation change. The supplementary reports below contain the reproduced interface comparison.
Supplementary reproduction and analysis
These reports contain the observed UI reproduction, screenshots, source trace, limitations, and longer-form analysis. The documentation change relies on the pinned primary sources above rather than these reports.
Anything else reviewers should know?
The docs diff intentionally stays focused and cross-links existing pages. A routing or interface implementation change would require a separate issue or RFC with raw quote payloads and implementation-specific tests.
Implementation follow-up: Uniswap/interface#8057