Transmitter is a CLI tool for STEEM blockchain witnesses. It quickly allows you to enable/disable your witness or set some properties for the new witness_set_properties call introduced in Hard Fork 20. - announcement post
I have been testing the publish_feed
command in the last couple of days and it works like a charm!
New market adapters
Initial support for the markets were limited to Poloniex, Bittrex, and Binance. While these markets are enough to create an average price, I have also added two more markets: Upbit and Huobi.
Both these markets don't have a direct BTC-USD market, so to calculate the price, I have used BTC-USDT pair.
Pull Request:
https://github.com/emre/transmitter/pull/4/files
Price outlier detection
Sometimes, STEEM prices on the mark fluctuates a lot in different markets due to wallet lockouts. I remember poloniex having low prices, or some korean markets having absurdly high prices.
Witnesses should feed the price with a stable amount to make sure the blockchain processes the correct information.
It's possible to enable/disable markets by hand but these market movements may happen anytime. In order to solve that, I have implemented a simple outlier detection.
This uses a simplified "modified z score" to detect outliers in the price.
Since it works best when more data available, outlier logic works only if you have enabled at least three markets.
Let's have a look at the current STEEM prices and test the outlier:
Exchange | STEEM in USD |
---|---|
Binance | 0.373316 |
Bithumb | 1.75 |
Bittrex | 0.372458 |
Upbit | 0.378082 |
Huobi | 0.375992 |
Poloniex | 0.370313 |
from transmitter.pricefeed.markets import exclude_outliers
prices = [0.3733, 1.7500, 0.3724, 0.3780, 0.3759, 0.3703]
print(" - Price list before outlier detection", prices)
print(" - Price list after exclusion", exclude_outliers(prices))
The output is perfect where Bithumb's price is excluded:
- Price list before outlier detection [0.3733, 1.75, 0.3724, 0.378, 0.3759, 0.3703]
- Price list after exclusion [0.3733, 0.3724, 0.378, 0.3759, 0.3703]
Disclaimer: This feature is kind of experimental and it's possible for it to create false positives. If you use publish_feed
command make sure to monitor it's output to check the outlier detection feature.
Upgrading
$ pip install transmitter --upgrade
Using the publish_feed
$ transmitter publish_feed
INFO:transmitter.main:Connecting to the blockchain using mainnet.
INFO:transmitter.main:Got the SIGNING_KEY in the config file.
INFO:transmitter.main:Got the WITNESS_ACCOUNT in the config file.
INFO:transmitter.pricefeed.adapters.base:PoloniexAdapter: Price: 0.3818
INFO:transmitter.pricefeed.adapters.base:BinanceAdapter: Price: 0.3822
INFO:transmitter.pricefeed.adapters.base:BittrexAdapter: Price: 0.3681
INFO:transmitter.pricefeed.adapters.base:HuobiAdapter: Price: 0.3822
INFO:transmitter.pricefeed.adapters.base:UpbitAdapter: Price: 0.3802
INFO:transmitter.main:Prices: [0.3818, 0.3822, 0.3681, 0.3822, 0.3802]
INFO:transmitter.main:Base price: 0.379 SBD, Quote price: 1.000 STEEM
INFO:transmitter.main:Operation broadcasted.
Make sure you have SIGNING_KEY
and WITNESS_ACCOUNT
placed on your configuration file.( ~/.transmitter/config.json.
)