Đang lật trang.
Đang mở chương tiếp theo…
Này… tạo phong cách đọc riêng nhé.
Phông chữ và chủ đề nằm trong Giao diện. Hãy chọn điều dễ chịu cho mắt.
Đang mở chương tiếp theo…
The x * y = k rule used by Uniswap v2-style pools. Larger trades pay a steeper price.
Đang kiểm tra khả năng đọc thành tiếng của trình duyệt…
Bài đọc này hiện có bằng tiếng Anh. Giao diện sử dụng ngôn ngữ bạn đã chọn.
Đọc bản gốc tiếng Anh →A simple constant-product market maker relates two reserves through x multiplied by y equals k. A trade that removes one asset must add enough of the other to satisfy the pool's invariant. This produces a curved exchange rate: buying a larger portion of a reserve becomes progressively more expensive. In an implementation with retained trading fees, the reserve product can increase over time, so constant product describes the pricing relationship rather than a claim that the numerical product never changes.
Start with 100 units of token A and 1,000 units of token B, giving a product of 100,000. Ignoring fees, a trader adding 10 A leaves 110 A in the pool. Keeping the product constant requires about 909.09 B to remain, so the trader receives about 90.91 B. The starting reserve ratio was ten B per A, but the average execution price is lower because the trade moves along the curve. This difference arises from the trade's size relative to liquidity.
The formula enforces a reserve relationship; it does not know the asset's fair price on other venues. Arbitrage can move pool ratios toward external prices, and a temporary reserve ratio can be manipulated by trading. An application relying on a pool for valuation therefore needs an appropriate oracle design rather than blindly trusting its current spot ratio. The illustrative arithmetic also omits fees, integer rounding, transfer restrictions, and other implementation details. Those details must be included when calculating the actual outcome of a transaction.