Workspace / Research tools
Liquidity pools

Two-Hop AMM Route and Bottleneck Model

A route through two pools must pass the first pool's actual output into the second pool. Multiplying two displayed spot prices ignores curve movement and fees at both hops. This model follows a single A-to-B-to-C route, displaying the intermediate quantity, final quantity, tolerance-based minimum output and output shortfall relative to the initial fee-free marginal route across several trade sizes.

Enable JavaScript to edit assumptions, calculate and compare a baseline locally. The formula and methodology below remain available without JavaScript.

Formula and accounting assumptions

Each hop uses a full-range constant-product calculation: output equals output reserve × fee-adjusted input divided by input reserve plus fee-adjusted input. First calculate B from the initial A input; then calculate C using that B quantity. The minimum output is the final modeled C amount × (1 − entered tolerance). Tolerance defines an illustrative acceptance guard; it is not an additional fee deducted from the expected quote.

Worked hypothetical example

Consider two fee-free pools, each with 100 units on both sides of its pair. Sending ten A through the first pool yields 100 ÷ 11, approximately 9.090909 B. Sending that quantity through the second yields 100 ÷ 12, approximately 8.333333 C. At a 10% output tolerance, the illustrative minimum is 7.5 C. Quoting the second hop using the original ten-unit amount would overstate the route's result and misrepresent the intermediate inventory.

Interpret the scenarios and limits

The two B reserves must refer to exactly the same intermediate asset and unit scale. No route discovery, competing paths, gas estimate, transfer-tax adjustment or pending transaction simulation is performed. Reserve snapshots are entered by the user and are assumed unchanged except for the modeled route. A tolerance cannot make a stale quote accurate or eliminate failed execution. Compare the sensitivity rows to identify whether increasing route size creates a disproportionate final-output shortfall.

Primary documentation

Your research workspace

Save selected inputs and research notes explicitly in this browser. Compare assumptions and restore a saved setup without submitting a trade. JavaScript enables the controls.

Find a tool or research page