Prospective Study: ahr999-AMM Smart Fund Pool

BytomDAO
BytomDAO
Published in
16 min readMay 27, 2021

--

Abstract: Explore a new type of AMM with (index) fund properties, and obtain both alpha income (AMM trading fee income) and beta income (passively following the bull & bear market income).

Background introduction

Recently, the market has rapidly turned from bull to bear. It not only has a shock on the cryptocurrency investment market led by BTC, but also has a impact on the DeFi that is in its young age. The enthusiasm, patience of people’s participation is no longer the same as before. Even so, as researchers, our responsibility is still to help everyone and the industry, especially in the current big market fluctation, continue to adhere to the essence of research, so that the truly valuable things can be discovered again, and these things must will be the leader and mainstay of the next rise.

As early as a year ago, we publicly issued the conclusion that “AMM will become the third largest blockchain invention after Bitcoin and Ethereum” [1]. During this year, we have also been leading the way around “transactions”. To date, we have always believed that “AMM is still the most valuable form of invention brought to the crypto industry by this wave of DeFi ”. Especially with in-depth research and entry into the game, we increasingly believe that AMM can do more and can bring greater changes to the crypto industry. The phased successful launch of Uniswap V3 further confirms our persistence. Based on this, during this sharp decline, we still pay attention to the projects and development of the AMM concept sector, and it is believed that the potential opportunities in the crisis will emerge soon . Here, we also present a new thinking about the future form of AMM for everyone and colleagues. This solution will integrate many well-known projects and models today. We also hope that we can work together and help each other to survive the short dark moments together.

AMM and index funds

Not long ago, we published our thoughts and cognitions on DeFi index funds-”On Rebalancing: The Correct Way for DeFi to Realize Index Funds” [2]. In this article, we propose a more complex AMM strategy control, we believe that the idea of ​​implementing index funds based on AMM is worth a try, and it is also an innovative feature that today’s leading AMM projects are likely to integrate in the future, because AMM and index funds have the same essential existence form. Inspired by this idea, we chose ahr999 index, which is regarded as the standard by many big players in the field of cryptocurrency investment, and combined it with the basic form of AMM to jointly form an intelligent automatic fund pool.

Let’s take a brief look at the ahr999 index. As shown in the figure below, the entire area is divided into three color areas: buy the dip area (below the red line), selling area (above the green horizontal line) and fixed investment area (between the two line). The blue line is the ahr999 index line, which is calculated by the formula in the figure based on the actual BTC price indicated by the green line. Cryptocurrency investors who believe in ahr999 will always pay attention to the area reached by the blue line. For example, on March 12, 2020, the sharp drop of the day directly caused the ahr999 blue line to shift from the fixed investment zone to the buy the dip zone, releasing the signal of “buy the dip” ; In the following year, the ahr999 blue line has risen all the way, constantly breaking through the “buy the dip” zone and fixed investment zone, until the big bull market formed at the end of last year, and released the signal of “start selling”; now the ahr999 blue line has begun to approach the fixed investment zone, it is warned that investors need to invest carefully at this time and do not give strong “buy dip” or “sell” signals.

(Picture from https://www.qkl123.com/

Choosing ahr999 does not mean that we fully agree with or firmly believe in the correctness of its investment guidance, but in today’s crypto industry, the unique consensus group and guidance formed by ahr999 is still relatively leading, so we choose ahr999 as our preferred index reference for practicing theory. Under the guidance of this index, fund managers can get direct instructions on where to cash out at high positions, where to buy the dip at low positions, and even make regular investments. The investors who choose this kind of fund also agree with the historical correctness of ahr999. So we return to the perspective of AMM. Isn’t AMM itself a fund that passively follows the market to change positions, but its strategy is very single and relatively “clumsy”-although it can indeed reach the highest point of the bull market during the bull market continue to sell BTC to USDT, with the decline and the opening of the bear market, these high-level realizable USDT all become BTC in the same position. Fund returns may be zero after a lap, so the traditional AMM strategy is from the perspective of the fund. Simple, it relies heavily on the timing correctness of ordinary investors (called LP in AMM). Is it possible to evolve the naive AMM into a fund form? of course can. The design we propose today is not only recognizing the limitations of traditional AMM income growth but also inspired by the strategy of traditional financial market index fund managers, replacing traditional funds with a more validated ahr999 chain index. Managers, automatically guide the AMM system to set up intelligent trading strategies and mathematical models, instead of a single control that only follows a constant product formula throughout the process.

Semi-automated solution

We call this AMM form “ahr999-AMM Smart Fund Pool”. Therefore, in essence, this is still an AMM-based trading platform. LP can join and exit freely, and can normally enjoy the annualized income of trading fees. The operating experience for ordinary users is also the same as that of normal AMM products. It’s just that when LP can cross a bull-bear cycle or even a longer cycle, it can find that its wealth increase is much greater than that of traditional AMM’s fee income. And behind it, this contribution is made based on the prediction of the ahr999 index. Smart fund strategy model. We will give two solutions to achieve, the simplest and most flexible is the semi-automatic solution.

Both schemes rely on a model that effectively solves impermanence loss. In our initial publication of “Five Types of Impermanence Loss Solutions” [3], it is mentioned in detail-the constant reduction geometric mean function of dynamic weights, referred to as “dynamic weight schemes” “, or it can be classified as a broad category of “oracles schemes” because we will also pay attention to several other models that we have chosen later.

The dynamic weight model is essentially the same as Uniswap’s constant product and Balancer’s weighted constant weighted geometric average, except that it turns the weight terms w1 and w2 in the following Balancer formula into real-time dynamic changes, and the driving force for this change is the introduction The price oracle machine, which continuously feeds the real-time market exchange rate of the trading pair to the AMM system. AMM can continuously adjust w1 and w2 without changing the number of pool assets, so that the AMM quotation formula P can always be consistent with the market exchange rate. Similarly, the conversion formula will re-provide the calculation of the conversion amount under the definition of the new weight. This oracle-driven weighting scheme avoids changes in the positions of pool assets. Ideally, the number of assets can always be kept consistent with the initialization time, thus avoiding the introduction of impermanent losses. From a geometrically intuitive point of view, this dynamic weight actually rotates the ordinary constant product curve around a fixed point (initial asset position), so that the slope of the tangent line (exchange rate) at this point is always consistent with the value of the market exchange rate.

This model was first proposed by Balancer, and the subsequent Bancor V2 carried out more detailed design and testing. Although there are two major projects, it has not yet entered the actual combat environment and has not been tested. Therefore, we also recommend several alternatives, such as DODO, which is also classified as a “predictor”. When DODO solves the impermanence loss, it also introduces an oracle to directly output the quotation formula of the system. Therefore, it does not need to change the quotation output by changing the asset position. When a specific user exchange operation occurs, it constructs a hybrid curve to meet the demand. Curve can be understood as a simple mixed-function between the straight line formula and the constant product formula, as follows — —

Among them, k is the weight tendency. For example, when k=1, the formula will all tend to the constant product formula; when k=0, all will be inclined to the straight line formula. When k is between 0 and 1, it is a dark black mixed form in the figure, the curvature of the curve can be adjusted by adjusting the size of k. For example, the closer k is to 0, the smaller the curvature of the curve, the more suitable it is to provide stablecoin exchange services.

So in general, although the implementation of DODO is essentially a re-optimization of the orderbook model, it also has the form of AMM exchange. DODO’s actual combat experience is also conducive to the promotion of this model. Once again, we only describe several schemes objectively, and there is no subjective tendency. Any scheme that solves impermanence losses through an oracle can theoretically be applied to the ahr999-AMM smart fund pool we are talking about today.

The reason why this impermanent loss solution is described a lot is that the most core mathematical part of our semi-automatic solution is nothing more than that. The impermanent loss solution represented by the dynamic weight model is essentially an “automatic position control” method that can keep the position basically unchanged.

Now we talk about the semi-automatic solution of the ahr999-AMM smart fund pool, see the picture below.

We start the fund pool at T1 (suppose we go back to the summer of the year 2020), and the ahr999 index predictor informs the AMM system that the market is in the “fixed investment zone” at this time, and it is not appropriate to adopt a drastic position change strategy. The AMM system will operate with a dynamic weight model , Provide normal exchange services and capture fee income for LP. Due to the adoption of this position-changing model, LP have also got rid of the trouble of impermanence loss;

When it is T2 (the bull market starts at the end of 2020), the ahr999 oracle triggers a “sell” signal to the system. At this time, the manual quantitative team began to intervene in the position management of the fund pool and act as the role of ahr999 fund manager. At this time, it is necessary to make a preliminary prediction for the trend and price range of the market outlook, and formulate position changes in each range, and finally follow the bull city. The fund selling strategy of the company is open to all LP and is strictly implemented in accordance with this open strategy.

(1) Ahr999 oracle conveys the “market enters the sale period” signal to the system;

(2) Quantitative market makers began to intervene, and based on the current market price and the prediction of the future bull market, formulated a “sell btc” position plan (the above table), and made it public to LP investors to show transparency;

(3) As the rising market touches the first position, the quantitative market maker will automatically obtain the control of part of the BTC positions split by the AMM system. For example, when the price breaks through $20,000 , the system pool will automatically transfer to the market maker pool and divide 10 btc. Quantitative market makers require selling BTC at an average price greater than or equal to $20,000 in exchange for USDT, and inject USDT into the system pool;

(4) In order to successfully complete the quantitative operation, we will follow the model of traditional funds and set up an [public fund operation day], that is, when the market conditions trigger the adjustment position, the time period for the quantitative market maker to complete a series of quantitative operations is an “public fund operation day”, which can be 10 hours or 24 hours. At the end of the operation day, the quantitative market maker needs to be able to return the exchanged USDT back to the system pool. Complete a round of fund operations and disclose the operation process to LP for transparency;

(5) While the quantitative market maker changes the position of the system pool, the AMM system needs to be able to continue to provide exchange services for ordinary users without interruption. For example, before the start of the “public fund operation day”, the system pool will be reduced by 10 btc and transferred to the quantitative pool. In order to seamlessly provide safe exchange services, the weight of the formula needs to be adjusted immediately when the number of positions changes, so that the AMM formula the quotations and exchanges of are not affected;

Similarly, when the “public fund operation day” ends, the quantitative market maker returns USDT to the system pool. When the system position changes, it is also necessary to change the weight immediately to keep the system quotation unchanged.

When it is T3 (in order to simulate a complete bull-bear cycle, we assume that the future trend is basically the same as 2019~2020), ahr999 conveys the “fixed investment” signal, the market enters a quiet period, and the dynamic weight model can always be used in the AMM system to maintain positions constant;

When it is T4, the “buy dip” signal appears, and the system once again activates the “quantitative position adjustment + dynamic weight” combination model. The quantitative market maker develops a phased bottom buy strategy for LP to accumulate a large amount of cheap BTC at the bottom of the market, waiting for a new one. Selling in the bull market, the specific method is similar to that during T2, and will not be repeated.

To sum up, the semi-automated solution is actually very simple and plain:

In the quiet “fixed investment period”, the system degenerates to an AMM system that uses a dynamic weight model, which only brings fee income to LP and avoids the risk of impermanent loss;

After the start of the bull market, professional manual quantitative market makers began to cash out BTC at a high level for LP according to the publicly formulated position strategy. The AMM system still provides users with exchange services without interruption under the control of the dynamic weight model, and will not be affected;

At the bottom of the bear market, quantitative market makers can continue to buy cheap BTC to sell when it rises. Such a cyclical cycle brings LP an increase in revenue that is far greater than the fee.

Note:

(1) After the emergence of the bull market signal, the quantitative market maker can make a reasonable range selling strategy. It should not be too aggressive to avoid early liquidation of BTC, and can change the strategy table in time according to the development of the subsequent market. All formulations and changes need to be disclosed to the LP and the community to achieve transparency in fund operations;

(2) The AMM system needs to be able to automatically complete the division and adjustment of positions before and after the “public fund operation day”, and adjust the weights in time to avoid interruption of exchange services; quantify the market maker’s ownership during the “public fund operation day” larger autonomy, free to determine the trading market and average exchange price, but all processes must also be open and transparent to LP;

(3) LP are free to join and withdraw from the system, but cannot join or withdraw during the “public fund operation day”;

(4) Since the quantitative market maker adopts “upgrade and sell”, for those LP who joined at the top of the bull market, the system will not sell assets at a price lower than the market exchange rate when they joined. This part of the LP suffered losses;

(5) From the perspective of the entire simulation, the wealth income of LP comes from the crossing of a bull and bear. Therefore, we suggest that any LP needs to have enough patience to go through an entire bull and bear cycle to obtain multiple returns of wealth.

Fully automated solution

The semi-automated solution is simple and clear, and the position strategy can be flexibly adjusted according to the market development trend. The entire system will not have too many hidden safety hazards. However, it relies on manual quantification of the market maker’s position adjustment, which requires strong information and operational transparency. The DeFi system introduces the “human” element. Is there a fully automated purely mathematically driven solution to realize the ahr999-AMM smart fund pool? We also give an exploration here for discussion.

Dynamic weight:

Balancer:

The fund pool is activated at T1. Like the semi-automatic solution, the AMM system is driven by the “dynamic weight model”;

At T2, ahr999 triggers the “sell” signal, and the AMM system formula stops the “dynamic change of weight” and degenerates into the Balancer formula. As the market rises, the Balancer formula can drive the BTC position to shrink and the USDT position to increase to achieve automatic smart selling of BTC.

During the bull market rise period, it is not blindly rising without falling. For example, there is a normal and high frequency of small declines (case A), there is a periodical callback with a certain time interval (case B), and there is a bull market high and a sudden decline. The bear market begins (Situation C). The complexity of the fully automatic solution is that it needs to introduce a monitoring mechanism that can record every highest point and maximum retracement of the rising market at all times, and use this to determine whether to switch the formula. For example, the small box in the middle of the above figure represents a substantial correction that occurred in January 2021. At that time, whether it was a phase correction or a bear market turning point, if the Balancer formula is still used in the system, the BTC that was originally cashed out at a high position will be Being bought back in full, it is unable to hold high wealth for LP and deviates from the idea of ​​the fund. Therefore, we need to introduce a “maximum drawdown detection mechanism” to the system: price prediction opportunities will convey real-time market changes to our AMM system, and capture When the market decline is greater than 5–10%, the system will automatically switch from the Balancer formula to the “dynamic weight model”, relying on the dynamic adjustment of weights to avoid further changes in the number of assets. The system will then be dominated by the dynamic weight model until-

(1) If the market outlook proves that this is a phased callback, when the price breaks through the previous “peak” again, the system will switch back to the Balancer formula from the dynamic weight model, and the formula weight of the system and the assets at this time The quantity coincides with the Balancer formula. In the subsequent new round of rising market, the Balancer formula will continue to sell BTC;

(2) If the market outlook no longer breaks new highs, it is confirmed that this high point is the highest point of the bull market. Since the system has always been dominated by the dynamic weight model, it will not change the position of the system pool during the decline process and hold the wealth cashed out at the peak. .

At T3 time (if the future occurs according to the historical trend), it can be found that the dynamic weight model always dominates the system during the entire process of going down from the bull market high and entering the “fixed investment zone” predicted by ahr999;

Until the end of the bear market at T4, ahr999 triggers the “buy bottom” signal, and the system formula will switch to the Balancer formula to implement the “buy more down” strategy. The entire process is similar to the bull market operation indicated by T2.

On the whole, the fully automatic solution is also designed in accordance with the principle of simplicity. The operation of the entire system does not exceed two mathematical formulas. The only complex factor introduced is that it can record the highest point and the largest retracement at all times (bear market corresponds to the lowest point) judgment mechanism to make the judgment basis for intelligent switching.

Finally, we do a simple data simulation. Here we only simulate the cyclic process of LP from the fixed investment area to the sell-off area. The corresponding time point is from the second half of 2020 to today (May 2021), according to the scheme model described above. Calculate the number of assets that the LP can extract today, and compare the total net wealth. From the data or intuitive point of view, the two solutions lead the traditional constant product model in terms of net wealth increase.

Conclusion

There is no complicated mathematical model introduced in our design, basically we reorganize and innovate on the existing projects and models. In the most essential innovative concept, we are exploring the true essence of AMM-the form of smart funds. Uniswap V3 [4] is in full swing. From another perspective, isn’t it because professional quantitative market makers are constantly predicting the market to adjust positions in order to maximize the increase in revenue. If an ordinary user is optimistic about a certain market maker strategy, he can choose to join the camp, and the professional quantitative market maker will continue to change positions, eliminate market friction and loss, and obtain the largest fee income and market passiveness to follow the gains.

Quote

[1] “AMM will Become the Third-largest Blockchain Invention after Bitcoin and Ethereum”, https://mp.weixin.qq.com/s/230hlBdN6hMfZyOXNlKMew

[2] “On Rebalancing: The Correct Way for DeFi to Realize Index Funds”, https://mp.weixin.qq.com/s/T5T-ukJ9dqr8zuNA_XP1Pw

[3] “AMM Ultimate Notes-Five Types of Impermanent Loss Solutions”, https://mp.weixin.qq.com/s/r4U4iz25F3_pWCubok9iOA

[4] “The Mathematical Principles of Uni V3”, https://mp.weixin.qq.com/s/IY5nnFJeSgel07y0L3eSxA

--

--