We consider here a pool of the form k=xy, ie a pool where the invariant function, also called indifference function k(x,y) is the product of the volume of pool holdings x of asset X and y of asset Y. Both x and y are measured in their native units, eg number of shares or number of tokens.

The fundamental principle of that pool is that, as the name implies, it is indifferent as to its asset holdings (x,y) provided that the indifference function k(x,y) remains at the same value. In other words, if initially the pool holdings are (x0,y0) then the pool will trade with any third party provided that the pool holdings after the trade (x,y) satisfy k(x,y)=k(x0,y0). This of course ignores transaction fees charged by the pool which we will address at a later stage.

Exchange ratio

Proposition. Assume a pool that that currently contains an asset portfolio of (x0,y0) and that charges no transaction fees. Assume a third party the wants to trade dx units of assets of type X with the pool, and we want to know the amount of assets of type Y traded in return. We use the viewed-from-pool-perspective convention that dx>0 means the pool receives X and therefore returns Y, dy<0. We find that the pool offers the following exchange ratios dydx=y0x011+dxx0

Proof. We use the shorthand x=x0+dx and y=y0+dy. Using the invariance equation yields k=x0y0=xy=(x0+dx)(y0+dy).

We start with dy=yy0=kxkx0=kx0kxxx0=kxx0dx=kxdxx0=ydxx0 or, to slightly rewrite the above dyy=dxx0 Similarly we get dyy0=dxx Note the respective index or absence thereof one the left and right hand sides of the equation – one of the terms is always backwards and the other forwards.

We are using the second equation above to write dy=y0x0+dxdx=y0x0dx1+dxx0 which is essentially the equation we wanted to prove. QED.

Marginal exchange ratios

We are now looking what happens in an equilibrium when this pool is embedded into a wider market. In a first step we simply look at what happens for very small trading volumes dx (remember that dx is the choice of the 3rd party trading with the pool, and the pool then chooses the corresponding dy).

Proposition. (i) For infinitesimal trades, ie dx close to zero, we find dydx=y0x0 ie the pool exchanges the two assets at exactly the ratio of its current composition (the minus sign simply indicates that exactly on of the terms dx,dy is negative, indicating that the corresponding asset is paid out of the pool).

(ii) The above equation can trivially rewritten into the form dyy0=dxx0 ie for infinitesimal transactions, the percentage changes in the holdings of the assets X and *Y are of the same size and opposite sign.

(ii) Moreover, the bigger the trade the less favorable the exchange ratio for the pool.

Proof. The equation above is simply a consequence of the fact that in the limit dx0 the term κ=11+dx/x01 for any non-zero value of x0. We further note that for dx>0 we have κ<1 and vice versa. To show that the bigger the absolute value of dx, ie the size of the trade, we first note that a positive dx means that the pool is receiving X and paying away Y and vice versa. So lets assume that indeed dx>0. As we showed above in this case we have κ<1 and this means that the amount dy received by the third party is, in absolute terms, smaller than what they’d receive in the limit dx0. Similalry for dx<0, meaning the pool pays of X, we find α>1 meaning that the other party has to pay more Y than in the case dx0.

Pool composition

We now define px and py respectively as the price of one native unit in some common numeraire. To give an example, if of the pool consist of X=ETH and Y=BTC and the numeraire is USD then px is the USD price of Ethereum (say 300 at at the time of writing) and py is the USD price of BTC (say USD 10,000).

Note that the choice of numeraire is arbitrary, and in some cases it makes sense to chose one of the two assets as numeraire. Say we choose ETH, in which case px=1 and p=py is the BTC price in ETH, in our example py=p=10,000/300=33.3.

We define a deep and liquid market with no transaction costs as a market, accessible to at least a subset of profit maximising market participants (the “arbitrageurs”) where the assets X and Y can be traded against the numeraire asset at a price of px and py respectively, with no transaction costs, no bid/offer spread, and at unlimited volume.

Proposition. (i) In a deep and liquid market, assuming no pool transaction costs, and using the notation from above, we have pxx=pyy In other words, when expressed in any common numeraire, the value of the assets X and Y that are held in the pool is the same.

(ii) This relation holds whatever the numeraire chosen.

Proof. To prove (ii) we simply note that a change of numeraire simply means multiplying the equation from (i) with the same number on both sides. In the equilibrium we must have that, for infinitesimal trades, dy/dx from the marginal exchange ratios equation (i) equals p, as otherwise arbitrageurs would trade against the pool. Using the other side of this equation yields p=y0/x0 or px0=y0. px0 is the value of the X component of the pool expressed in the Y numeraire, and y0 is the value of the Y component, also in the Y numeraire. Because we already proved part (ii) the general equation (i) is true whatever the numeraire.

Pricing formula

We now assume a pool that is arbitraged at a price level of p0. We know from the formulas above that this means that if the pool contains (x0,y0) units of X and Y respectively that then p0x0=y0 expressing the fact that both assets in the pool are held in the same monetary amount, whatever the numeraire in which that amount is determined.

Proposition. (i) A pool that is arbitraged at a price p0 and where the volume of assets held is (x0,y0) trades with 3rd parties at a price of p(dx)=p011+dxx0 where a positive trading volume dx>0 indicates that the pool receives X and pays away Y, and a negative volume dx<0 indicates it receives Y and pays away X.

(ii) We define α=dxx0 which in an arbitraged pool is the trading volume as percentage of the overall pool value. In this case the above equation becomes p(α)=p01+α

Proof. Noting that p(dx)=dy/dx this is a trivial rewrite of the equations above.