x
and y
, their product must equal some predetermined k = x * y
after
every performed swap. So, for example, if we perform a swap by providing some quantity of first asset marked as dx
and want to receive some of the second asset, quantity of second asset, marked as dy
, must be calculated from
the formula x * y = (x + dx) * (y - dy)
.