ALEX Lab Foundation

Searchโฆ

ALEX (updated)

Product/ Features

Tokenomics

How To

White Papers

Security Audit & Bug Bounty

ALEXโs Automated Market Maker (AMM)

Letโs start with a concrete example:

Rachel has 100 USD. She wants to increase her 100 USD and thus chooses to lend her assets out. She decides to lend out her 100 USD for a fixed term of three months. Rachel goes to *ALEXโs* interface and there she sees that โthree-month ayUSDโ is currently priced at 0.9 vs USD. Put simply, this means that 1 ayUSD gets her 0.9 USD. She takes her 100 USD and exchanges it for ayUSD. Given the current exchange rate, Rachel gets about 110 ayUSD. Now that three months have passed, Rachel can exchange her 110 ayUSD for USD again. The rate is 1 ayUSD to 1 USD. So Rachel gets 110 USD โ thatโs a gain of 10 USD over 3 months. Pretty sweet!

Here is the general story:

Borrowers and lenders enter a loan contract. Specifically, they swap a forward contract-based token called โayTokenโ with โTokenโ โ the underlying asset. For example, borrowers and lenders could swap ayUSD with USD but more generally, the lender lends out โTokensโ and obtains โayTokenโ in return. The price of โTokenโ is lower than its par value. The contract starts when a lender deposits โTokenโ in an *ALEX* pool. Then, upon expiration, the lender redeems the underlying asset, โTokenโ, at par value. Because the lender lent out their โTokenโ at a discounted price some time ago, and now redeems โTokenโ for par value, there is a profit.

In mathematical terms, interest rate *r* is calculated as *pโ =*1/*eสณแต* where *pโ* is the spot price of ayToken and the interest rate is assumed to be compound. The formula utilizes one of the most fundamental concepts in asset pricing in that the present value is the discounted future value. In our example, *t =* 1 and *r* = **log 1/0.9 โ 10%.

When designing AMM, *ALEX* believes in the following:

(i) AMMs are mathematically neat and reflect economic supply and demand. For example, price should increase when supply is low or when demand is high;

(ii) AMMs are a type of mean which remains constant during trading activities. This approach is adopted by popular platforms, such as *Uniswap*, which employ algorithmic means; and

(iii) AMM can be interpreted through the lens of modern finance theory. Doing so enables *ALEX* to grow and draw comparisons with conventional finance.

After extensive research, our beliefs led us to the AMM first proposed by *YieldSpace*. While we appreciate the mathematical beauty of their derivation, we adapt it in several ways with *ALEX*. For example, we replace a simple interest rate with a compounding interest rate. This change is in line with standard uses in financial pricing and modeling since the adoption of the Black-Scholes model. We also introduce a new capital efficiency scheme, as explained below.

In mathematical terms, our AMM can be expressed as:

where *x, y, t,* and *L* are, respectively, the balance of โTokenโ, the balance of โayTokenโ, time to maturity, and a constant term when *t* is fixed. Interest rate *r* is defined as *r =* log*(y/x)*, i.e. natural logarithm of the ratio of balance between โayTokenโ and โTokenโ, while the price of โayTokenโ with respect to โTokenโ is *(y/x)แต.*

Our design depicts an AMM in the form of a generalized mean. It makes economic sense because the shape of the curve is decreasing and convex. It incorporates time to maturity *t*, which is explicitly built-in to derive ayTokenโs spot price.

LPs deposit both ayToken and Token in a pool to facilitate trading activities. LPs are typically ready to market-make on all possible scenarios of interest rate movements ranging from *โโ* to *+โ.* However*,* part of the interest rates curve or movements will never be considered by market participants. One example of this occurs when the interest rate is negative. Although negative rates can be introduced in the fiat world by central bankers as a monetary policy tool, yield farmers in the crypto world are still longing everything to be positive. In *ALEX*, a positive rate refers to the spot price of ayToken not exceeding 1 and ayToken reserve being larger than Token.

Inspired by *Uniswap v3*, *ALEX* employs virtual tokens โ part of the assets that will never be touched, hence they are not required to be held by LPs.

https://miro.medium.com/max/1400/1*h06s2YnEFXi6L97lAlP2_Q.png

Figure 1: *t =* 0.5 and *L =* 20. Blue line (IFC) satisfies *x ยนโป แต + y ยนโป แต = L,* whereas red line (CEC) satisfies *x ยนโป แต + (y+yแตฅ) ยนโป แต = L*. Virtual reserve *yแตฅ* = 100.

Figure 1 illustrates an example of adopting virtual tokens in the event of a positive interest rate. The blue line is the standard AMM. The blue dot marks an equal balance of Token and ayToken of *yแตฅ*, meaning there is no (or a 0%) interest rate. *yแตฅ* is the boundary amount, as any amount lower than it will never be touched by an LP to avoid a negative rate, which is represented by the blue dashed line. Thus, *yแตฅ* is the virtual token reserve. Effectively, LP is market-making on the red line, which shifts the blue line lower by *yแตฅ*. When ayToken is depleted as shown by the red dashed line, trading activities are suspended.

A numerical example provided in Table 1 shows capital efficiency with respect to various interest rates, assuming *t =* 0.5 and *L =* 20 for illustrationโs sake. When the current interest rate *r =* 10%, LPs are required to deposit 95 Token and 105 ayToken according to standard AMM. However, if the interest rate is floored at 0%, LPs only need to contribute 5 ayToken, as the rest 100 ayToken would be virtual. This is a decent saving of more than 90%.

https://miro.medium.com/max/1400/1*1donSHtKYaEUb3Y7d9ZwbA.png

By expressing interest rate as *pโ =1/eสณแต*, i.e. r = (-1/*t)* log *pโ*, we can obtain a series of interest rates from trading pool prices with respect to various maturities based on which we are able to build a yield curve. The yield curve is the benchmark tool for modeling risk-free rates in conventional finance. The shape of the curve dictates the expectation of future interest rate paths, which helps market participants understand market behaviors and trends. Currently, we might be able to build a Bitcoin yield curve from Bitcoin futures listed on Chicago Mercantile Exchange (CME). However, not only is the exchange heavily regulated, its trading volume is skewed to the very short-dated front-end contracts lasting several months only. *ALEX* aims to offer futures contracts up to 1y when the platform goes live. Should markets mature, *ALEX* may extend to longer tenors.

Yield farmers can benefit from understanding the yield curve by purchasing ayToken whose tenor corresponds to high interest rates and selling ayToken whose tenor associates with low interest rates. This is a typical โcarryโ strategy.

Last but certainly not least, based on the development of a yield curve and the solid design work of our AMM, *ALEX* is able to provide more products. Specifically, *ALEX* will be able to offer derivatives, including options and structured products, building on and extending a large number of influential works of literature and applications in conventional finance.

Copy link

On this page

ALEXโs Automated Market Maker (AMM) โ Short Version

1. Lending and Borrowing Process

2. Automated Market Making (AMM) Protocol

3. Liquidity Providers (LP) and Capital Efficiency

4. Yield Curve and Yield Farming