Keep the price orientation consistent
For reserves A and B, the implied price is B ÷ A in token B per token A. Relative divergence is (implied price ÷ external price − 1) × 100. With k = A × B, target reserve A is sqrt(k ÷ external price), and target reserve B is sqrt(k × external price). Positive reserves and a positive external price are necessary for these ratios and square roots.
Calculate a theoretical reserve adjustment
Suppose a hypothetical pool holds 100 A and 10,000 B, so its implied price is 100 B per A and k is 1,000,000. An external reference of 121 B per A produces target reserves of approximately 90.9091 A and 11,000 B. The starting price is about 17.36% below that reference. Reaching the target in the fee-free model removes about 9.0909 A and adds 1,000 B.
Distinguish the target from an achievable trade
The target keeps k constant and ignores fees, whereas fee-retaining swaps can increase the reserve product. External markets may have spreads, limited depth, or different settlement costs. A reference quote is not a guarantee that assets can be bought or sold at that price. The calculation also excludes intervening trades and token transfer mechanics. Reversing the token pair changes the price orientation and percentage comparison, so recheck both reserve labels before interpreting a result.