This paper will introduce Hertz, an Algorithm Based Asset (ABA) which was created on the Bitshares Decentralized Exchange (BTS DEX). Its price feed is pegged to 1 USD then predictably modified to oscillate using a sine wave with an amplitude of 14% over a period of 28 days, thus producing predictable phases of price feed appreciation and depreciation and a range of $0.86 to $1.14. Anything learned through the development process will also be elaborated upon so as to accelerate the implementation of future ABAs on the BTS DEX.
The Bitshares Decentralized Exchange (BTS DEX) provides the ability for anyone to create Market Pegged Assets (MPAs), these are cryptocurrency tokens that are typically pegged to an external reference asset’s value by multiple price feed publishers (privately fed, committee fed or witness fed) and provably backed by typically more than 175% of the reference asset’s value in collateral on the blockchain.
BTS is the core token which fuels the operations performed on the Bitshares DEX, it’s also used as the backing collateral for the committee owned bitAssets (such as bitCNY, bitUSD, bitEUR) and by the majority of privatized MPAs created by Bitshares users on the BTS DEX.
Despite the popularity of using BTS as an MPA’s backing collateral there are many alternative backing asset configurations that an asset owner can choose from which have largely gone underutilized.
The following table attempts to categorize the different types of backing collateral accounting for their level of publicly proven backing collateral proof.
| MPA Layer | Backing Collateral | Examples | MPA Layer Justification |
|---|---|---|---|
| 0 | UIA | N/A – e.g. USD MPA backed by UIA | UIA backing lacks proof of collateral on the blockchain |
| 0 | L0 MPA (UIA backed MPA) | N/A – e.g. Index MPA backed by L0 MPA | L0 backing lacks proof of collateral on the blockchain |
| 1 | ACCT UIA | N/A – ACCT is a future planned feature | ACCT has proven backing collateral, thus it’s trustless unlike EBAs. |
| 1 | BTS (Core token) | bitUSD, bitCNY, Hertz, Hero | BTS backing collateral proven on blockchain. |
| 2 | L1 MPA | XCD (backed by bitUSD) | MPA backing which has proven BTS backing |
MPAs are issued in a decentralized manner as they’re borrowed into existence and shorted on the market without introducing counter party risk. If the shorter’s backing collateral falls below the Minimum Collateral Ratio (MCR) then the shorter is force settled, forcing them to buy back their debt at market rates to then close their debt position. [2]
At any time, MPA holders can trigger a settlement which exchanges their settled MPA tokens for the MPA’s backing collateral (equivalent to the value of the settled MPA tokens) from the least collateralized short position with the force settlement exchange rate determined as the average settlement price rate during the force settlement delay period. This means that settler is protected from price feed volatility during force settlement and that force settlement occurs for the least collateralized position even if they maintain a greater collateral ratio than the MCR.[2] The settlement rate of an MPA in backing collateral is calculated as the median price feed in the set of the latest published price feeds for the MPA in question. [2]
Confirmation times for transactions on the BTS DEX are typically less than a couple of seconds, and the BTS DEX is massively scalable[1]. MPAs can take full advantage of this high performance blockchain network at little cost to the asset owner (cost of asset registration, multiple setting updates and marketing), price feed publishers (cost of frequently publishing price feeds) and the user (transfer fees).[7]
Algorithm Based Assets (ABAs) are MPAs which apply a publicly known algorithm to their reference asset’s value to produce predictable price feed behaviour over time. The concept of the ABA was first introduced by Hero which is pegged to a formula based upon the USD and its 5% annual appreciation since creation of the Federal Reserve System in 1913. [12] This translates to an approximate HERO value of $160 in 2018. [6]
The primary focus of this paper is Hertz and Algorithm Based Assets on the BTS DEX.
Hero was the primary inspiration for Hertz; initially the opposite of HERO was proposed with a goal of depreciating the value x% per year however this economic policy was perceived as undesirable for long term holders.[4] The Sine wave algorithm was proposed to combine the effects of HERO and its theoretical opposite ABA, resulting in predictable phases of both price feed appreciation and price feed depreciation every 28 days indefinitely.
To date, there are currently no examples of assets which have implemented a similar algorithm which produces an oscillating value like Hertz, in neither the FIAT nor Cryptocurrency markets, so the concept is unique and highly experimental. There are however over-the-counter financial derivatives such as variance and volatility swaps which may share similar trading behaviour to Hertz.
Unlike variance and volatility swaps, there is no expiration on shorted positions aside from margin calls (due to under collateralization) and force settlement (due being the least collateralized short position after the force settlement delay). The shorter’s ability to close their position depends entirely on their ability to buy back their debt from the open market.
Unlike established volatility/variance products like the Volatility Index (VIX) and the DJIA Volatility Index (VXD), Bitshares DEX market participants can trade Hertz directly with one another with no intermediaries involved in the process. It may be worth implementing such volatility/variance products as MPAs on the BTS DEX in the future, however such proposals are outside the scope of this paper.
Hertz is a layer 1 Algorithm Based Asset (backed by BTS) which is pegged to the value of 1 USD that's modified with a sine wave based oscillation to produce predictable price feed peaks and troughs.[3] This section will provide more info on Hertz including the definition and methodology, and goes on to include how creation of an alternative implementation is possible.
The Hertz algorithm has been implemented in Python and Javascript across multiple price feed script repositories, providing a diverse set of price feed sources for the configured price feed publishers to choose from. The price feed script fetches the recent USD value in BTS then this value is modified using a sine wave formula with a 14% amplitude over 28 days to achieve a predictable settlement price range of $0.86 to $1.14. Wednesdays were chosen as the primary milestone day as this is mid working week for the UTC time zone.
Currently Hertz is manually configured to enable a combination of active and prospective Bitshares witnesses to publish price feeds. Prospective price feed publishers need to be contacted directly before they will begin publishing price feeds for private MPA on the BTS DEX, the effort to increase the quantity of price feed publishers for Hertz is ongoing.
Note that the settlement price and market trading rates are not the same, it’s likely that market participants will trade either above or below the settlement price depending on the state of the ongoing oscillation.
The above image shows the Hertz settlement price in USD across the 28 day period.
The following Hertz Python pseudocode will briefly demonstrate how the Hertz algorithm is implemented:
from math import pi, sin
period = 2419200 # 28 days in seconds
hz_phase = 0.908056 # Time offset
amplitude = 0.14 # 14%
ref_time = "2015-10-13T14:12:24+00:00" # Bitshares 2.0 genesis block timestamp
time_diff = timestamp - (ref_time + hz_phase)
hz_now = ((time_diff/period) % 1) * period
sin_calc = sin(hz_now * ((2*pi)/period))
hertz_value = 1 + (amplitude * sin_calc)
Static variables are referenced for the amplitude, reference timestamp, period, phase, and reference asset. Only the current time and current ’BTS:USD’ rate, which was not included in code to avoid overcomplication, are dynamic. Furthermore, only the ’BTS:USD’ rate is an unknown factor for all participants.
To concisely summarise, the current point of the sine wave is estimated and either a positive or negative value is applied to the reference asset value through addition, resulting in a settlement price range of $0.86 to $1.14.
Given the MIT licensed open source licensing of the Hertz price feed scripts, the creation of an ABA with alternative static variables is possible.
Since coordinating and synchronising the modification of these static variables could prove difficult once in production, the impact of changing the variables and finalizing of the selection should be carefully researched prior to activation on the BTS DEX.
Unlike many of the current Bitshares committee controlled smartcoins (such as bitUSD), the following flags were permanently disabled to improve the decentralization of Hertz.
The possibility for the manipulation of assets currently controlled by the committee through the above permissions is removed through the election of committee members by BTS holders and the transparency of any such actions on the blockchain. The removal of these permissions simply makes such a small risk entirely impossible to improve user confidence in Hertz.
Hertz is a highly experimental MPA on the BTS DEX, all code is MIT licensed and price feeds are provided in a decentralized manner. Hertz can experience unpredictable contamination of volatility through USD and BTS value exposure, as well as through unpredictable market trading behaviour caused by the price feed's sine wave oscillation. This paper does not constitute financial advice. Individual research, consultations with financial advisors, and risk assessment are advised prior to trading Hertz.
Following the above disclaimer, this section will detail some of the theorized effects of the Hertz ABA.
The price feed value appreciates from $0.86 on day 21 of the previous cycle to $1.14 on day 7 of the next cycle (figure 2). This price feed appreciation benefits the Hertz holder at the expense of the shorter as their collateral ratio decreases, unless the value of BTS increases more than 32.55% in this timeframe.
The price feed value depreciates from $1.14 on day 7 to $0.86 by day 21 of the same cycle (figure 3). This price feed depreciation benefits the shorter through temporary debt destruction and subsequent collateral ratio increase, unless the value of BTS decreases in value more than 24.56% in this timeframe.
Day 7 of 28 is the peak settlement price after which the price feeds will begin to depreciate (figure 4)
Day 21 of 28 is the trough feed value, with the highest theoretical buy pressure, but the lowest predicted sell and settle pressure (figure 5).
It is highly likely that some Hertz holders will hold their tokens long term, especially if they were to buy at the peak and then be required to wait until subsequent peaks to settle unless BTS has depreciated more than Hertz from peak to trough.
Those who buy in a trough will be less likely to hold through peaks, unless BTS is more volatile than Hertz and which would make settling detrimental if the user is market making between BTS and Hertz.
Due to long term holding behaviour, it is possible that there may be insufficient liquidity for the shorter to buy back their debt and thus be locked into holding debt without an exit. This is potentially only a risk during the initial start-up cycles until sufficient liquidity has developed throughout all phases of the hertz cycle.
Many price feed publishers have different price feed script solution preferences; there are at least five open source multi-asset price feed script repositories needed to provide implementations of an ABA in order to enable the majority of BTS witnesses to publish price feeds.
The more price feed scripts integrated into an algorithm, the greater the likelihood of the recruitment of more price feed publishers for an ABA on the BTS DEX. Likewise, if the ABA price feed publishers utilize multiple price feed scripts the redundancy will be greater and the risk of any glitches causing an abrupt stop to published price feeds will be reduced.
Creating a reference price feed script which does not involve the existing price feed script repositories will provide a backup for witnesses to use if there are delays in integration.
Following on from the current Hertz model, several goals have been identified for further development in the future.
This section will briefly summarize the lessons learned during the implementation of Hertz over the course of the last year.
The Hertz ABA has been successful at oscillating its price feed since launch, producing predicted phases of price feed appreciation and depreciation to an MPA on the BTS DEX. These effects introduced by ertz are highly unique and require further observation as market liquidity increases over time.
Algorithm Based Assets like Hertz are cheap to implement, decentralized, highly collateralized, and free from counter-party risk. Algorithm Based Assets have great potential, and with the development of subsequent Hertz derivatives and papers outlining experiences and issues, the understanding and implementation of ABAs will progress. From these advancements it is hoped that Algorithm Based Assets would gain more attention within BTS and the greater cryptocurrency community in the future.
[1] Cryptonomex Bitshares foundation. Bitshares - Industrial Performance and Scalability, 2018. URL https://bitshares.org/technology/industrial-performance-and-scalability/.
[2] cryptonomex Bitshares foundation. DEX Margin Mechanics, 2018. URL http://docs.bitshares.org/bitshares/user/dex-margin-mechanics.html.
[3] Customminer. Hertz technical documentation, 2018. URL https://sites.google.com/view/hertz-aba/.
[4] customminer. Nemesis bitsharestalk thread, 2018. URL https://bitsharestalk.org/index.php?topic=24158.0.
[5] grctest customminer. Reference Hertz Python price feed script, 2018. URL https://github.com/BTS-CM/scripts/blob/master/hertz-feed.py.
[6] Cryptonomex‘ Hero. Hero ABA details, 2018. URL http://open-explorer.io/#/assets/HERO.
[7] Bitshares commitee Oxarbitrage. Current Bitshares fees, 2018. URL http://open-explorer.io/#/fees.
[8] pch957. pch957’s btsprice Bitshares price feed scripts, 2018. URL https://github.com/pch957/btsprice.
[9] Wackou. Wackou’s BTS tools, 2018. URL https://github.com/wackou/bts_tools/
[10] xeroc. Xeroc’s bitshares-pricefeed repo, 2018. URL https://github.com/xeroc/bitshares-pricefeed/.
[11] Clockworkgr. Clockworkgr's bitshares-pricefeed-js repo, 2018. URL https://github.com/clockworkgr/bitshares-pricefeed-js/
[12] Hero foundation. Official website for the Hero ABA, 2018. URL https://www.sovereignhero.com/