Updated Hertz ABA whitepaper - check it out!
Hertz whitepaper updates
- Redefined the MPA collateral layer table
- Images have been improved to be more easily referenced.
- Various changes throughout whitepaper to improve readability and grammar.
- Credit to @trixiedraws for updated images and improved grammar.
'Hertz - An Oscillating USD pegged Algorithm Based Asset'
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. 
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. 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. 
Confirmation times for transactions on the BTS DEX are typically less than a couple of seconds, and the BTS DEX is massively scalable. 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).
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.  This translates to an approximate HERO value of $160 in 2018. 
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. 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. 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.
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.
Modifiable static variables:
- Reference asset (USD, CNY, EUR..).
- Amplitude (7%, 14%, 50%..).
- Period (7 days, 14 days, 30 days..).
- Wave algorithm (Sine, Cos, Combination..).
- Phase (Offset reference/genesis timestamp to a specific day of the week).
- Preferred time zone (Default: UTC).
- Reference timestamp (Default: BTS2.0 genesis timestamp).
- Minimum collateral ratio: 200%
- Max force settle volume: 5%
- Percent offset of forced settlements: 1%
- Force settlement delay: 1440 mins
- Short backing asset: BTS
Surrendered Smartcoin flags/permissions
Unlike many of the current Bitshares committee controlled smartcoins (such as bitUSD), the following flags were permanently disabled to improve the decentralization of Hertz.
- “Require holders to be white-listed”: There will never be a white-list for holders.
- “Issuer may transfer asset back to himself”: The issuer can never transfer the asset back to themselves.
- “Issuer must approve all transfers”: Transfers will never require approval.
- “Disable confidential transactions”: Confidential transactions (whenever implemented) will always be allowed.
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.
Predicted effects of 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.
Price feed appreciation
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.
Price feed depreciation
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.
Peak settlement price
Day 7 of 28 is the peak settlement price after which the price feeds will begin to depreciate (figure 4)
- Shorters aiming to maximize benefits from price feed depreciation may produce peak selling pressure.
- Holders produce peak settle pressure as they realize price feed appreciation gains from past hertz cycles.
- Less buy pressure, as holders will have to wait 28 days (a full cycle) before their Hertz tokens return to this rate, and they will not benefit from price feed appreciation.
- The potential shorter sell wall may provide sell liquidity not currently possible with other MPAs without having an impact on the core BTS trading rate.
Trough settlement price
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).
- Shorters selling Hertz during the trough face impending price feed appreciation then settlement at the peak value. This may result in a lack of sell liquidity during the trough which will affect the shorters’ ability to buy back debt at trough rates.
- Shorters buying BTS during the trough to settle their debt and realize any potential debt destruction will be a likely source of predictable buy pressure.
- Holders aiming to buy in the trough to then settle at the peak will additionally be a likely source of predictable buy pressure.
- Combined shorter and holder potential buy wall may provide shorters larger trading opportunities than currently possible with traditional MPAs (without impacting BTS core price).
Long term holders
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.
Price feed scripts
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.
Current community built price feed scripts for Hertz
- Wackou’s BTS_Tools 
- Xeroc’s bitshares-pricefeed 
- pch957’s btsprice 
- python-bitshares based reference price feed scripts 
Following on from the current Hertz model, several goals have been identified for further development in the future.
- Maximizing the quantity of Hertz price feed publishers, preferably more than 20.
- Creating alternative Hertz ABAs with different static variables.
- Implementing an alternative calendar system than the 28 day calendar, accounting for leap years and different sized months. Only for an alternative Hertz ABA.
- Experiment with layer 0 and layer 2 backing collateral ABAs.
- Once fully operational, either petition the committee to accept ownership of the Hertz ABA or transfer asset ownership of Hertz to null-account (destroying asset owner rights), to further improve decentralization.
- Creating volatility/variance product MPAs, given their popularity in the FIAT markets.
Lessons learned during development
This section will briefly summarize the lessons learned during the implementation of Hertz over the course of the last year.
- Communication with price feed publishers is key. Reaching out to price feed publishers directly and helping to troubleshoot any issues they encounter when running price feed scripts is essential. It can take several months to establish a large set of price feed publishers whom are all publishing accurate price feeds.
- Thorough testing of the price feed scripts prior to presenting them to price feed publishers will reduce time spent on troubleshooting and maintain good working relations with the price feed publishers.
- Integrating an algorithm into existing price feed scripts can take several weeks per pull request since the repository owners have a significant work load.
- Hertz static variables must be thoroughly considered prior to integration into price feed scripts. Initially the amplitude was 50%before being reduced to 33% then finally 14%. Volatility in an ABA should be carefully considered, high volatility is inadvisable. The spreadsheet hertz calculator can gauge static variable impact upon collateral ratios throughout a full cycle.
- Whilst utilising the testnet for testing an ABA is free, there are complexities which can impede testing in this manner, such as the fact that TEST does not have a value, and there is no reference bitUSD asset.
- Testing price feed publishing in production without any problems is easily possible if you set the minimum price feed publisher quantity to a value far greater than the current price feed publisher count then any issues won’t count.
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.
 Cryptonomex Bitshares foundation. Bitshares - Industrial Performance and Scalability, 2018. URL https://bitshares.org/technology/industrial-performance-and-scalability/.
 cryptonomex Bitshares foundation. DEX Margin Mechanics, 2018. URL http://docs.bitshares.org/bitshares/user/dex-margin-mechanics.html.
 Customminer. Hertz technical documentation, 2018. URL https://sites.google.com/view/hertz-aba/.
 customminer. Nemesis bitsharestalk thread, 2018. URL https://bitsharestalk.org/index.php?topic=24158.0.
 grctest customminer. Reference Hertz Python price feed script, 2018. URL https://github.com/BTS-CM/scripts/blob/master/hertz-feed.py.
 Cryptonomex‘ Hero. Hero ABA details, 2018. URL http://open-explorer.io/#/assets/HERO.
 Bitshares commitee Oxarbitrage. Current Bitshares fees, 2018. URL http://open-explorer.io/#/fees.
 pch957. pch957’s btsprice Bitshares price feed scripts, 2018. URL https://github.com/pch957/btsprice.
 Wackou. Wackou’s BTS tools, 2018. URL https://github.com/wackou/bts_tools/
 xeroc. Xeroc’s bitshares-pricefeed repo, 2018. URL https://github.com/xeroc/bitshares-pricefeed/.
 Clockworkgr. Clockworkgr's bitshares-pricefeed-js repo, 2018. URL https://github.com/clockworkgr/bitshares-pricefeed-js/
 Hero foundation. Official website for the Hero ABA, 2018. URL https://www.sovereignhero.com/