Author Topic: [Witness Proposal] 1.6.129 - zapata42-witness  (Read 2103 times)

0 Members and 1 Guest are viewing this topic.

Offline zapata42

  • Full Member
  • ***
  • Posts: 57
    • View Profile
  • BitShares: zapata42
Re: [Witness Proposal] 1.6.129 - zapata42-witness
« Reply #15 on: August 31, 2018, 11:45:33 pm »
Thanks for your votes, I am an active witness since the begining of the week.

Some updates from the last two weeks:
  • my nodes have been updated to 2.0.180823.
  • my pricefeed configuration has been updated following Abit's comments.
  • I have published code to experiment with BSIP42. It currently implements all the algorithms publicly discussed.  I have not activated any of them in my feed as I wait for the end of the BSIP42 voting period. This should allow anyone to experiment their formulas easely (just add your algorithm there).
  • a first Dedicated 4c/8t 3Ghz CPU, 64go RAM, 1To SSD hard drive, 250Mpbs internet bandwith has been ordered. I will use it to setup ElasticSearch + OpenExplorer + Explorer API in the coming weeks.
  • I am helping Alfredo on the backend of open-explorer.io to improve performances and make it easier to install and maintain (see this, this, this and this PR.. and more to come)

I will be at BitFest, Friday and Saturday, ping me here or on Telegram if you want to have a chat there.

Online gghi

  • Sr. Member
  • ****
  • Posts: 280
    • View Profile
  • BitShares: ttt888
Re: [Witness Proposal] 1.6.129 - zapata42-witness
« Reply #16 on: September 01, 2018, 08:27:54 am »
Identity, we must increase feedback so that we can quickly rectify the deviation. It is suggested that the ideal price = BTS market price * (bitcny/cny price +M) ^N, M indicates the loose index, N is the acceleration factor. For example, when the premium is zero, the easing target is negative 2%, the acceleration is 1.8, then the ideal feed = BTS market price * 1 + 0.02 ^ 1.8, for example, when the premium is 0.001, the easing target is negative 1%, the acceleration is 1.5, then the ideal feed = BTS market price * 1.001 + 0.01 ^ 1.5.
For example, the formula is proved to be effective, and the loose target is minus 1%.
When the premium is negative 0.01 (discount 1%), the acceleration factor is 2. Ideal feed price = BTS market price * 1-0.01 + 0.01) ^ 2 = BTS market price * 1 ^ 2 = BTS market price * 1. Conclusion: The target is achieved, very ideal.
When the premium is 0, the acceleration factor is 2. Ideal feeding price = BTS market price * 1 + 0.01) ^ 2 = BTS market price * 1.01 ^ 2 = BTS market price * 1.02, conclusion: the market price increase by 2%, very satisfactory, very safe.
When the premium is 0.01, the acceleration factor is 2. The ideal feeding price = BTS market price * 1.01 + 0.01) ^ 2 = BTS market price * 1.02 ^ 2 = BTS market price * 1.0404. Conclusion: The increase of market price by 4% is very satisfactory and safe.
When the premium is 0.02, the acceleration factor is 2. The ideal feeding price = BTS market price * 1.02 + 0.01) ^ 2 = BTS market price * 1.03 ^ 2 = BTS market price * 1.0609. Conclusion: The increase of the market price by 6% is very satisfactory and safe.
When the premium is 0.03, the acceleration factor is 2. The ideal feeding price = BTS market price * 1.03 + 0.01) ^ 2 = BTS market price * 1.04 ^ 2 = BTS market price * 1.0816. Conclusion: The higher the market price is, the more satisfied and safe it is.

When the premium is 0.04, the acceleration factor is 2. The ideal feeding price = BTS market price * 1.04 + 0.01) ^ 2 = BTS market price * 1.05 ^ 2 = BTS market price * 1.1025. Conclusion: The market price increases by about 10%, satisfactory and safe.
When the premium is 0.05, the acceleration factor is 2. The ideal feeding price = BTS market price * 1.05 + 0.01) ^ 2 = BTS market price * 1.06 ^ 2 = BTS market price * 1.1236. Conclusion: The market price increases about 11.2%, satisfies, speeds up the correction.
When the premium is 0.06, the acceleration factor is 2. Ideal Feed = BTS Market Price * 1.06+0.01) ^ 2 = BTS Market Price * 1.07 ^ 2 = BTS Market Price * 1.1449. Conclusion: The market price increases about 11.4%, satisfactory, accelerate the correction of deviation.
When the premium is 0.07, the acceleration factor is 2. Ideal Feed = BTS Market Price * 1.07+0.01) ^ 2 = BTS Market Price * 1.08 ^ 2 = BTS Market Price * 1.1664. Conclusion: Market Price increases by about 11.66%, satisfies, speeds up the correction.
When the premium is 0.08, the acceleration factor is 2. Ideal Feed = BTS Market Price * 1.08+0.01) ^ 2 = BTS Market Price * 1.09 ^ 2 = BTS Market Price * 1.1881, Conclusion: Market Price increased by 11.88%, satisfactory, accelerate correction.
When the premium is 0.09, the acceleration factor is 2. The ideal feeding price = BTS market price * 1.09 + 0.01) ^ 2 = BTS market price * 1.1 ^ 2 = BTS market price * 1.21. Conclusion: The market price increases about 12%, satisfies, accelerates the correction, and the risk is still controllable.

  认同,必须加大反馈力度才可以快速纠偏。建议理想喂价 = BTS市场价 * (bitcny/cny价+M)^N,M表示宽松指标,N为加速因子。比如溢价为零时,宽松目标负2%,加速度1.8,那么,理想喂价 = BTS市场价 * (1+0.02)^1.8,比如溢价为0.001时,宽松目标负1%,加速度1.5,那么,理想喂价 = BTS市场价 * (1.001+0.01)^1.5。
       举例论证公式效果,宽松目标负1%。
当溢价负0.01时(折扣1%),加速因子喂2。理想喂价 = BTS市场价 * (1-0.01+0.01)^2=BTS市场价 *1^2=BTS市场价 *1,结论:目标达到,非常理想。
当溢价0时,加速因子喂2。理想喂价 = BTS市场价 * (1+0.01)^2=BTS市场价 *1.01^2=BTS市场价 *1.02,结论:市场价提高2%,很满意,也很安全。
当溢价0.01时,加速因子喂2。理想喂价 = BTS市场价 * (1.01+0.01)^2=BTS市场价 *1.02^2=BTS市场价 *1.0404,结论:市场价提高约4%,很满意,也很安全。
当溢价0.02时,加速因子喂2。理想喂价 = BTS市场价 * (1.02+0.01)^2=BTS市场价 *1.03^2=BTS市场价 *1.0609,结论:市场价提高约6%,很满意,也很安全。
当溢价0.03时,加速因子喂2。理想喂价 = BTS市场价 * (1.03+0.01)^2=BTS市场价 *1.04^2=BTS市场价 *1.0816,结论:市场价提高越8%,很满意,也很安全。

当溢价0.04时,加速因子喂2。理想喂价 = BTS市场价 * (1.04+0.01)^2=BTS市场价 *1.05^2=BTS市场价 *1.1025,结论:市场价提高约10%,满意,也很安全。
     当溢价0.05时,加速因子喂2。理想喂价 = BTS市场价 * (1.05+0.01)^2=BTS市场价 *1.06^2=BTS市场价 *1.1236,结论:市场价提高约11.2%,满意,加速纠偏。
     当溢价0.06时,加速因子喂2。理想喂价 = BTS市场价 * (1.06+0.01)^2=BTS市场价 *1.07^2=BTS市场价 *1.1449,结论:市场价提高约11.4%,满意,加速纠偏
当溢价0.07时,加速因子喂2。理想喂价 = BTS市场价 * (1.07+0.01)^2=BTS市场价 *1.08^2=BTS市场价 *1.1664,结论:市场价提高约11.66%,满意,加速纠偏
当溢价0.08时,加速因子喂2。理想喂价 = BTS市场价 * (1.08+0.01)^2=BTS市场价 *1.09^2=BTS市场价 *1.1881,结论:市场价提高约11.88%,满意,加速纠偏
当溢价0.09时,加速因子喂2。理想喂价 = BTS市场价 * (1.09+0.01)^2=BTS市场价 *1.1^2=BTS市场价 *1.21,结论:市场价提高约12%,满意,加速纠偏,风险依然可控。

Offline zapata42

  • Full Member
  • ***
  • Posts: 57
    • View Profile
  • BitShares: zapata42
Re: [Witness Proposal] 1.6.129 - zapata42-witness
« Reply #17 on: September 07, 2018, 12:03:13 am »
As BSIP42 has been voted in, my feed price has been adjusted accordingly.

The current adjustment is the use the same formula as gdex-witness.

Online gghi

  • Sr. Member
  • ****
  • Posts: 280
    • View Profile
  • BitShares: ttt888
Re: [Witness Proposal] 1.6.129 - zapata42-witness
« Reply #18 on: September 07, 2018, 12:35:37 am »
As BSIP42 has been voted in, my feed price has been adjusted accordingly.

The current adjustment is the use the same formula as gdex-witness.

     GOOD,voted

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3429
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: [Witness Proposal] 1.6.129 - zapata42-witness
« Reply #19 on: September 08, 2018, 10:17:13 am »
Hi Zapata, we're discussing new algorithm: https://bitsharestalk.org/index.php?topic=26315.msg322068#msg322068, please check.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Online armin

  • Full Member
  • ***
  • Posts: 90
    • View Profile
Re: [Witness Proposal] 1.6.129 - zapata42-witness
« Reply #20 on: September 08, 2018, 12:06:58 pm »
Hi Zapata, we're discussing new algorithm: https://bitsharestalk.org/index.php?topic=26315.msg322068#msg322068, please check.

Do you know when "the highest one" price feed will be implemented?

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3429
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: [Witness Proposal] 1.6.129 - zapata42-witness
« Reply #21 on: September 09, 2018, 08:59:10 am »
Hi Zapata, we're discussing new algorithm: https://bitsharestalk.org/index.php?topic=26315.msg322068#msg322068, please check.

Do you know when "the highest one" price feed will be implemented?
It's up to the witnesses to decide. Personally I don't think "the highest one" is correct.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3429
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: [Witness Proposal] 1.6.129 - zapata42-witness
« Reply #22 on: October 03, 2018, 11:31:59 pm »
@zapata42 USDT is now trading at around 0.991 USD. Data sources (direct trading pairs):
* https://www.kraken.com/charts
* https://bittrex.com/Market/Index?MarketName=USD-USDT

CoinMarketCap is reporting 0.9968 which seems a bit off. https://coinmarketcap.com/currencies/tether/

Perhaps your script need to be updated.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline zapata42

  • Full Member
  • ***
  • Posts: 57
    • View Profile
  • BitShares: zapata42
Re: [Witness Proposal] 1.6.129 - zapata42-witness
« Reply #23 on: October 04, 2018, 10:16:52 pm »
@zapata42 USDT is now trading at around 0.991 USD. Data sources (direct trading pairs):
* https://www.kraken.com/charts
* https://bittrex.com/Market/Index?MarketName=USD-USDT

CoinMarketCap is reporting 0.9968 which seems a bit off. https://coinmarketcap.com/currencies/tether/

Perhaps your script need to be updated.

It was already possible to configure the script to retrieve USDT price from Bittrex.
However, the Kraken source was not implemented, so I just added it.

As an example witnesses can add this configuration to the script in order to use Bittrex+Kraken sources for USDT:
Code: [Select]
    usdt_price:
        klass: Composite
        aggregation_type: 'weighted_mean'
        exchanges:
            bittrex:
                klass: Bittrex
                quotes:
                    - USDT
                bases:
                    - USD
            kraken:
                klass: Kraken
                quotes:
                    - USDT
                bases:
                    - ZUSD
                aliases:
                    ZUSD: USD

I have updated my script to use those sources.

I would also like to take this opportunity to say that the PID formula implementation is also available if poeple want to practice with it.

I am also working on a tool to visualize witness pricefeeds over time: http://pricefeed-tracker.dex.trading/
(code is here)

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3429
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: [Witness Proposal] 1.6.129 - zapata42-witness
« Reply #24 on: October 05, 2018, 07:18:52 pm »
Thanks!

Another thing mentioned in Telegram group by @pc:
> please make sure that you publish a CER that is not higher than the settlement price for assets in black swan state. "higher" as in more BTS per bitXYZ

If CER is too low, it's cheaper for people to pay fees in that asset than in BTS if there is some BTS in the fee pool, although not a big deal because there should not be much BTS in the fee pool.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline zapata42

  • Full Member
  • ***
  • Posts: 57
    • View Profile
  • BitShares: zapata42
Re: [Witness Proposal] 1.6.129 - zapata42-witness
« Reply #25 on: October 07, 2018, 12:15:46 am »
Another thing mentioned in Telegram group by @pc:
> please make sure that you publish a CER that is not higher than the settlement price for assets in black swan state. "higher" as in more BTS per bitXYZ

If CER is too low, it's cheaper for people to pay fees in that asset than in BTS if there is some BTS in the fee pool, although not a big deal because there should not be much BTS in the fee pool.

I have updated the script to handle the case, see commit 1, 2.
The applyed formula is: If CER < asset global settlement price, then published CER is the asset global settlement price.

My feed for those assets will be impacted: BTC, SILVER, GOLD, SGD, CHF, AUD.

« Last Edit: October 07, 2018, 10:08:48 am by zapata42 »

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3429
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: [Witness Proposal] 1.6.129 - zapata42-witness
« Reply #26 on: October 16, 2018, 10:43:40 pm »
  • Get BTC/USD, ETH/USD, USDT/USD from CoinMarketCap.com (fallback to worldcoinindex.com)
As discussed in Telegram channel, CMC's price is not reliable thus should be avoided.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3429
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: [Witness Proposal] 1.6.129 - zapata42-witness
« Reply #27 on: October 20, 2018, 10:08:04 am »
@zapata42 USDT is now trading at around 0.991 USD. Data sources (direct trading pairs):
* https://www.kraken.com/charts
* https://bittrex.com/Market/Index?MarketName=USD-USDT

CoinMarketCap is reporting 0.9968 which seems a bit off. https://coinmarketcap.com/currencies/tether/

Perhaps your script need to be updated.

It was already possible to configure the script to retrieve USDT price from Bittrex.
However, the Kraken source was not implemented, so I just added it.

As an example witnesses can add this configuration to the script in order to use Bittrex+Kraken sources for USDT:
Code: [Select]
    usdt_price:
        klass: Composite
        aggregation_type: 'weighted_mean'
        exchanges:
            bittrex:
                klass: Bittrex
                quotes:
                    - USDT
                bases:
                    - USD
            kraken:
                klass: Kraken
                quotes:
                    - USDT
                bases:
                    - ZUSD
                aliases:
                    ZUSD: USD

I have updated my script to use those sources.

I would also like to take this opportunity to say that the PID formula implementation is also available if poeple want to practice with it.

I am also working on a tool to visualize witness pricefeeds over time: http://pricefeed-tracker.dex.trading/
(code is here)
http://www.untether.space/ has some interesting data about USDT, perhaps we can use it or the way it calculates USDT price.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline zapata42

  • Full Member
  • ***
  • Posts: 57
    • View Profile
  • BitShares: zapata42
Re: [Witness Proposal] 1.6.129 - zapata42-witness
« Reply #28 on: October 21, 2018, 05:34:41 pm »
  • Get BTC/USD, ETH/USD, USDT/USD from CoinMarketCap.com (fallback to worldcoinindex.com)
As discussed in Telegram channel, CMC's price is not reliable thus should be avoided.

Agree, I have removed it since, my configuration now use a weighted mean of exchanges with FIAT deposit (Coinbase, Kraken and Bitstamp).
Here is the config:

Code: [Select]
    btc_and_eth_price:
        klass: Composite
        aggregation_type: 'weighted_mean'
        exchanges:
            coinbase:
                klass: Coinbase
                quotes:
                    - BTC
                    - ETH
                bases:
                    - USD
            kraken:
                klass: Kraken
                quotes:
                    - XXBT
                    - XETH
                bases:
                    - ZUSD
                aliases:
                    XXBT: BTC
                    XETH: ETH
                    ZUSD: USD
            bitstamp:
                klass: Bitstamp
                quotes:
                    - BTC
                    - ETH
                bases:
                    - USD

Note that Coinbase source has been added for that.

http://www.untether.space/ has some interesting data about USDT, perhaps we can use it or the way it calculates USDT price.

Unfortunately the website does not provide any API currently. We can easely recompute the same data (see the code), but I don't see big differences with current approach (weighted average of USD/USDT of Bittrex and Kraken). Market arbitrage seems efficient.

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3429
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: [Witness Proposal] 1.6.129 - zapata42-witness
« Reply #29 on: October 24, 2018, 09:12:36 am »
Thanks again.

As discussed in Telegram:

I think it's better to use highest bid price (in terms of buying BTS with bitcny) than to use latest fill price to judge if bitcny is at discount. Likewise, use lowest ask to judge if bitcny is at premium. Perhaps using volume weighted moving average price is best.

Recently I feel the scripts made quite some false positives. The adjustment is too sensitive when bitcny is at discount, causing unnecessary margin calls. When someone bought up some BTS with little volume, the script thinks bitcny is at discount, thus lowers the price feed and triggers margin calls, which usually cause the price swing more than expected. Also the 110% MSSR is a big penalty to debt positions and big pressure on buy support.

Since we're able to "control" existing debt positions (via margin calls) to counter discount, but can only "incentivize" new debt positions and buy support to counter premium, that means we have more "power" on the former, so it's wise to save our power as much as possible. So it's better to adjust slower/softer/ with smaller steps when at discount, and adjust quicker/harder/with bigger steps when at premium.

For same reason, for my "adjusted_price" algorithm, it's wise to apply larger scale when at premium, but smaller scale when at discount.

Wish this helps.
« Last Edit: October 24, 2018, 09:38:29 am by abit »
BTS account: abit
BTS committee member: abit
BTS witness: in.abit