BM's latest article "High Liquidity Price Linked Token Algorithm"

The author of this article is EOS, Bitshares founder Daniel Larimer (BM) released the translation of the " High Liquidity Price Pegged Token Algorithm " on Medium.

Today, I introduced a new token-linked algorithm that provides high liquidity and narrow spreads, and is highly resistant to defaults when collateral is depreciated over time. The basis of our algorithm is a short position that combines the Banco algorithm's severe over-guarantee to provide liquidity for long and short positions. Price feeds are used to guide the market, but their impact is limited to long-term deviations to protect market makers from abuse.


Image source: Unsplash


In 2013, BitShares introduced the concept of BitUSD, a "smart coin" supported by the Bitcoin BTS, designed to track the value of the dollar. BitUSD works by creating an order book between those who want to leverage BTS leverage and those who want price stability. In order to provide liquidity to investors who purchased BitUSD, BitUSD holders were allowed to force a settlement of the shortest secured short position in the price feed after a multi-day delay. This creates an effective margin-call and guarantees to BitUSD buyers that their tokens are always worth about $1 BTS. In order to prevent default, if the price is lower than the minimum margin requirement, the minimum guaranteed short position can also be forced to close.

The main problems with BitUSD's strategy are lack of liquidity, limited availability of available BitUSD, and market spreads. The market maker is required to operate a trading robot that can move orders on the internal order book. Although BitUSD holders gained liquidity, short positions did not receive liquidity guarantees. Finally, when the most unsecured positions cannot be guaranteed, a black swan event will occur throughout the market. When this happens, the hook will be permanently broken and a fixed exchange rate will be established between BitUSD and BTS.

This lack of incentives creates BitUSD, the risk of low liquidity (which cannot be compensated for without an unreasonable decline), the unexpected margin addition, and the difficulty of manufacturing robots in a safe market, meaning that the supply of BitUSD is small, the spread Very high.

There are many other projects that take advantage of changes in over-guaranteed positions and margin requirements. They all face similar problems with BitUSD.

The traditional derivatives market implements “futures trading”, which allows people to provide collateral and settle at a fixed price at a fixed time in the future. These futures contracts are substitutable and can be traded within a certain period of time, but due to expiration and the need for settlement/expansion, they are not suitable for creating a linked token.

The Bancor algorithm provides automatic mobility between the two assets while protecting its reserves from being lost to experienced traders. Regardless of the number and type of orders executed by the Bancor algorithm, the algorithm always generates a profit when the price of the asset pair returns to the initial point. A typical Bancor market maker is known as a repeater, which has two "connectors" that represent balances of equal market value. The algorithm successfully provides automatic mobility in markets such as the EOS RAM market.

Hooking algorithm

This hooking algorithm is based on the concept that hooked tokens are short-to-multiple-served services. This service requires short sellers to provide liquidity for the linked tokens. If there is a demand for hooked tokens, then even if the market is relatively stable, the transaction costs earned by market makers should be profitable for service providers.

Other hooking algorithms allow short sellers to compete with each other rather than promote their cooperation in order to bring a linked money service to market. In these other algorithms, shorts compete to replenish and mortgage their positions, and are worried about short squeezes.

The premise of our algorithm is that those who are willing to use a little longer leverage in a mortgage asset (such as EOS) can make money by promoting market-making activities between EOS and an alternative linked asset (such as USD). It is to track a price feed within an allowed range.

Instead of letting the user create a separate short position, our algorithm is to create a global short position that allows the user to buy and sell the share of the global position. Trading in short positions is a neutral and reversible process (less transaction costs), provided that no other transactions occur during this period. Leverage is not the main motivation. Instead, transaction costs are the motivation to buy a position. This means that a 400% over-guarantee or higher target is feasible, allowing short sellers to use only a small amount of leverage in the encumbered assets, so they have the opportunity to earn transaction fees.

Market makers were originally created by depositing collateral in contracts. The contract will create tokens in the market maker (MMS) and hand over the tokens to the original depositor. To illustrate, we will assume that the collateral is EOS and the linked token is USD, which is designed to track the 24-hour median EOS dollar price.

The target reserve ratio is determined, for example 400%. Based on the 4x reserve ratio, 75% of EOS deposits will be used as excess collateral, and 25% will be placed in the Bancor Relay connector with a weight of 50%. At this point, the automated market maker contract will create a number of dollar tokens to fund the second Bancor Relay connector, making the market value of the EOS and USD connector balances the same as the initial value of the price feed.

Under initial conditions, the market maker owns 100% of the USD in the connector, so there is no net debt (USD that must be repurchased). The book value of MMS is equal to the value of the EOS held in the connector plus the excess collateral EOS, minus any circulating USD sold from the connector. After this initial setup, anyone can buy USD from the market maker, which creates a future repurchase debt for the MMS holder. The mathematical nature of the Bancor Relay algorithm means that when a user buys a USD from a market maker, the quote will rise. If every person who buys dollars sells them, the connector will eventually be in its initial state. Any fees charged for the transaction will result in a net increase in EOS in the connector balance.

Considering this setup and the 400% reserve target, we can prove that the ratio of actual reserves to sold USD will far exceed 400%. In order to drop to 400% (no market price changes), the entire USD connector will have to buy out, which will push the USD price to limit. In fact, the market maker automatically increases the cost of buying USD longs because the available USD long supply is reduced.

The spot price provided by the market maker is equal to the ratio of EOS to USD in the connector balance. When the spot price deviates from the feed price by more than an acceptable range (eg +/- 2%) and exceeds the allowed time (eg 24 hours), the market maker will take one of the following actions depending on market conditions:

Screenshot 2019-04-29 Afternoon 7.33.56

The goal of the algorithm is to always move the state closer to the initial state, ie, additional collateral three times more than the Bancor balance and 100% of the USD in the USD connector. Obviously, in the case of a circulating USD, the connector is unlikely to reach 100% USD, but when the value of EOS relative to USD rises significantly, the percentage of circulation supply will decrease.

The rate of collateral transfer or USD issuance should be adjusted to within the acceptable range of the target time (eg, 1 hour). In theory, traders should buy and sell USD like the USD value of $1, because they are confident that they will always be able to sell USD for $1 in the near future. This means that when the relative price of EOS and USD is stable, the market maker will not have to rely on the price feed to correct the real-time price, and the Bancor algorithm protects the connector balance from being lost by the trader for the operator's security.

When configuring parameters, such as allowing deviations from feed, correction rate and delay until price correction begins, the key is to minimize the frequency of active intervention market makers. When intervention is required, the intervention is slow and gradual. Market participants should not rob the market maker before making a profit.

The result of this algorithm is a hooked asset that follows the 24-hour median, not the instantaneous value. Only when the 24-hour median of the market maker is significantly larger than the 24-hour median of the real market, will it actively correct the linked exchange rate. When the real market goes up, we want traders to interact with the Bancor algorithm to take a speculative approach ahead of the 24-hour median. This early run prevents the Bancor connector from being forced to adjust unless it is used for a long time. The slower the mid-price change, the less risk the market maker has, but the greater the deviation between the dollar and the actual dollar. Allowing the Bancor algorithm to deviate from a larger percentage (such as 5%) also minimizes manual interaction with pricing due to feeds. The less human interaction, the less relevant the instantaneous accuracy of the price feed.

Buy and sell MMS tokens

Anyone can contribute a new EOS at any time to purchase a combination of MMS and USD. This is achieved by maintaining the ratio of USD in the MMS, EOS, Bancor connector and USD in circulation after adding a new EOS. Individuals receive MMS, plus one percent of the newly created USD ratio of USD circulation. USD and EOS are also added to the connector and excess reserve. The user can then sell the USD to get the EOS and repeat the process, or just hold the excess USD or EOS.

The number of USDs required to sell an MMS token is equal to USD_circulation * MMS_Sell / MMS_Supply. This is the same amount of USD they received when they first purchased EMS using EOS (minus all transaction fees charged).

This process can be seen as splitting and joining the same short positions. Once you control all outstanding debt for a short position, you can lift it and take back all the collateral. The key to this process is to maintain this invariant, that is, someone who uses/as a collateral to buy or sell market makers does not change the MMS, EOS, USD, and USD circulation ratios. If you want to sell a 1% share of the market maker (MMS), you must also purchase and cover 1% of the circulating USD. Fortunately, you can buy a circulating USD from a market maker, so there is always liquidity.

Market transaction fee

When users buy and sell dollars, EOS and MMS, they need to charge transaction fees. This cost represents a stream of income that can bring capital gains to those who hold MMS. The greater the volatility, the more transactions, the more costs it generates. These costs continue to restructure the market makers without any investment from collectively leveraged investors. Regardless of market conditions, those who are leveraged cannot reduce their collateral or add to it. If the initial mortgage ratio is high (eg, 4 times), the collateral will have to fall 75% faster than the transaction fee.

Black swan event

The black swan means that the market maker cannot maintain the USD near the price feed. This happens when the excess collateral disappears. When this happens, the market maker will continue to operate, but the USD price will float independently of the price feed. A savvy observer might consider removing the USD from one side of the connector to maintain the price, but this is not desirable as it creates a run on the remaining EOS in the connector. Once the excess collateral disappears, by letting the price float, those who want to retire early will pay a premium for liquidity and ongoing transactions, thereby refinancing the rest of the parties.

Even during the Black Swan trading, the income stream represented by transaction costs will encourage the parties to provide collateral and provide funds for market makers. If the collateral asset (eg EOS) does not anticipate the recovery of future value, then the holder of the pledged asset (eg USD) will obtain a fair share of the remaining EOS in the connector at a market-determined price.

Unlike some other systems, the Black Swan event is not a special case, and the market has a seamless, natural recovery method to restore this hook.

If there is no excess collateral, the market maker can be configured to prevent the sale of MMS tokens while allowing EMS to be purchased at a 10% discount. This will restructure the market makers and benefit the new MMS holders from the previous holders. Once the excess collateral is restored, the MMS can be resold as described above. The exact point and discount range of collateral over-loss is a variable that can be adjusted to minimize the risk of complete loss and maximize incentives to capitalize the market quickly without overly penalizing former MMS holders. Reorganization.

Price feed

There are many different ways to generate a trusted price feed; however, there are some suggestions for better results. The linked tokens can track any price feed, including artificial feeds such as the 30-day moving average. Typical price feeds attempt to track real-time spot prices, but such expectations are unrealistic for safe market makers. The slower the price change, the easier it is to maintain the hook because market participants have more time to adjust.

My suggestion is that the target of the hook is the 24-hour mid-price, not the instantaneous price. This will reduce the frequency and magnitude of deviations from the hooks without compromising the value of the linked USD as a dollar substitute. In fact, it transfers some of the intraday volatility risk to dollar holders (off-average) while still hedging the risk of long-term volatility by dollar holders.

Some experimentation is needed in the market to determine the appropriate balance between the responsiveness of the price feed and the profitability of the market maker due to volatility.

Alternative price correction strategy

When traders interact with the algorithm, they either push the Bancor price farther away from the feed or push it closer to the feed. It should be possible to charge a dynamic fee for the transaction, and as the transaction pushes the Bancor price further from the feed, the transaction cost will increase. This allows MMS holders to increase profits and prevent the operator from causing excessive deviations from price feeds.


Compared to systems like BitUSD, our peg mechanism motivates asset creation and liquidity by providing transaction costs to short sellers who provide collateral, while effectively eliminating most of the liquidity risk of short sellers. In addition, the algorithm provides the same liquidity for both parties, while BitUSD only provides mandatory settlement to the market side. Transaction costs continue to re-collateralize the market, enabling it to recover from losses caused by price changes. As long as the revenue from transaction costs is greater than the average decline in the value of collateral assets, the system can maintain solvency and liquidity. We believe that this approach maximizes the utility of all participants while minimizing risk.