Formula and accounting assumptions
For input reserve A, output reserve B and normalized weights wA and wB, output is B × [1 − (A ÷ (A + effective input))^(wA ÷ wB)]. Effective input deducts the input fee. The initial marginal output rate is B × wA ÷ (A × wB). Comparing the full input paid per output received with that marginal rate measures both the fee and movement along the weighted curve.
Worked hypothetical example
With 100 units in each reserve, a 50/50 weight and no fee, an input of ten produces approximately 9.090909 output units. Changing only the weight to 80/20 changes the exponent to four and the initial marginal rate to four output units per input. Output then equals 100 × [1 − (100 ÷ 110)^4], approximately 31.69865 units. The reserves alone are therefore insufficient to compare pool prices when the normalized weights differ.
Interpret the scenarios and limits
This is a two-token constant-weight mathematical pool. It does not reproduce deployment-specific swap limits, token scaling, dynamic weights, transfer taxes or smart-contract rounding. The fee is retained in the input reserve. Very extreme inputs that exhaust representable output-reserve precision are rejected. Use consistent human token units and verify the actual protocol configuration separately; the result is neither a wallet quote nor confirmation that a proposed size can be executed in a deployed pool.