Author Topic: Price Feed Review  (Read 25811 times)

0 Members and 1 Guest are viewing this topic.

Offline binggo

  • Hero Member
  • *****
  • Posts: 2367
  • 世间太多瘪犊子
    • View Profile
内盘价格做权重,必须做上下价格保护,喂价规则起码是这样,:

偏差率=P

喂价=内盘深度加权中间价*权重+外盘深度指数价格×(1+P)*权重

设一个上下价格保护: 外盘深度指数价格×(1+P)<喂价< (1.05+P)×外盘深度指数价格

P按照历史喂价的偏差数据看,一般在2%左右,可以按照自己的喂价与实际法币价格偏离情况进行调整。

这样就算是你按USD的官方汇率换算,内盘深度价格做大权重,你的喂价在极端情况下也不会偏离出多少。

这只是针对BITCNY的喂价, 其它的锚定资产需要另讨论。

或者是这位哥哥的:
Quote
if
max(DEX*溢价、CEX1、CEX2……)≤ Average(DEX*溢价、CEX1、CEX2……)*1.05

feed price=max(DEX*溢价、CEX1、CEX2……)

otherwise

feed peice=Average(DEX*溢价、CEX1、CEX2……)*1.05

控制喂价下跌的速度,防止插针。

if

feed price(n)*0.97<feed price(n+1)<feed price(n)

feed price =feed price(n)*(1-0.5‰)

otherwise

feed price=feed price(n+1)

另外必须是深度加权中间价格,即时成交价有时候太坑。

这位兄弟,这个感觉比较冤枉。。。我这几天一直在修改喂价脚本,最先的思路是引入内盘权重,这个方法在横盘时都还比较正常,但是遇上这两天暴跌都是从内盘开始跌,就比较无力。后来感谢论坛各位的提醒,发现了根本原因,不能用美元-人民币的银行汇率进行计算。所以赶紧再次修改脚本,现经观察已经恢复正常了。不过也感谢你的监督啦,大家都希望比特股变得更好 :)
« Last Edit: June 06, 2019, 02:00:53 am by binggo »

Offline zhaomu

  • Newbie
  • *
  • Posts: 19
    • View Profile

[/quote]

这里面zhaomu、verbaltech2被点名批评次数已经数不清了,然而,稳做见证人。
[/quote]

这位兄弟,这个感觉比较冤枉。。。我这几天一直在修改喂价脚本,最先的思路是引入内盘权重,这个方法在横盘时都还比较正常,但是遇上这两天暴跌都是从内盘开始跌,就比较无力。后来感谢论坛各位的提醒,发现了根本原因,不能用美元-人民币的银行汇率进行计算。所以赶紧再次修改脚本,现经观察已经恢复正常了。不过也感谢你的监督啦,大家都希望比特股变得更好 :)

Offline zhaomu

  • Newbie
  • *
  • Posts: 19
    • View Profile
对于CNY的喂价已经采用中币的QC-USDT QC-CNY 完成 CNY到USDT的转化,再取各交易所的BTS:USDT。根据观察,喂价已经恢复正常。抱歉修改喂价脚本花了点时间,也感谢社区的监督。

Offline ioex

  • Sr. Member
  • ****
  • Posts: 201
    • View Profile


不说了,这种也能当见证人,呵呵

这里面zhaomu、verbaltech2被点名批评次数已经数不清了,然而,稳做见证人。

Offline ioex

  • Sr. Member
  • ****
  • Posts: 201
    • View Profile


不说了,这种也能当见证人,呵呵

Offline binggo

  • Hero Member
  • *****
  • Posts: 2367
  • 世间太多瘪犊子
    • View Profile
这么简单的问题也不需要1小时出一次喂价对比.

国外的见证人按照USD的价格来官方汇率换算成CNY的价格,那我们也按照我们可以使用的法币价格倒推过去,

现在法币cny的价格是0.430cny/bts,官方汇率是6.9076,USDT汇率是7.13,

按照官方汇率:bitusd的喂价就是:0.430/6.9076=0.06225。bitusd的现时喂价是0.061008,交易所USDT价格是0.0595

国外喂BITCNY的价格是低于法币价格,我们喂BITUSD的价格其实是高于USDT价格,等于实际USD价格。


另外一点是USDT在tether的充入费率是0.1%,提现费率3%。


高不高,要看当时的行情。截图USDT只是参考。

这样吧,你每小时出一个合理喂价数据,然后和见证人比一下?

« Last Edit: June 05, 2019, 10:08:02 am by binggo »

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4586
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
USD的喂价其实也不高,因为还要看实际法币USD的进场是否流畅,还是通过USDT来转换,USDT的出场费用等。

每个地区的实际交易者才对实际的法币价格有深入的了解。

就好比现在跟后面这几位见证人解释不能采用官方汇率直喂BTC与USDT价格,他们很难理解,哪怕他们自己喂USD的价格也够呛能够了解清楚

USDT现价约7.2 CNY

很多见证人的CNY喂价还行,但 USD 喂价是不对的,偏高。

进一步说,EUR和其他币种的喂价不知道差多远。


高不高,要看当时的行情。截图USDT只是参考。

这样吧,你每小时出一个合理喂价数据,然后和见证人比一下?

« Last Edit: June 05, 2019, 08:06:23 am by abit »
BitShares committee member: abit
BitShares witness: in.abit

Offline zhouxiaobao

        喂价应当是在本地购买bts所花费的法币数量。否则国际汇兑损失,交易手续费,等等,是很贵的,不计算进去,价格差就会很大。这就是为啥我们内盘投资者总觉得喂价低了,我们花的钱不止这个数啊!
       bitcny的喂价应当是“在中国购买一个bts需要的人民币法币数量”。
       bitusd的喂价应当是"在美国购买一个bts需要的美元法币数量"。
       这中间所有的手续费都应当算上。
       如果觉得难以采集数据,那就用最高价原则加上偏离顶,最高价最接近实际价格。
       mssr已经是1.01了,理论上充值费率不应当超过1%过多,现在快2%了,就是说喂价还是比实际价格低了一点。

       

Offline binggo

  • Hero Member
  • *****
  • Posts: 2367
  • 世间太多瘪犊子
    • View Profile
USD的喂价其实也不高,因为还要看实际法币USD的进场是否流畅,还是通过USDT来转换,USDT的出场费用等。

每个地区的实际交易者才对实际的法币价格有深入的了解。

就好比现在跟后面这几位见证人解释不能采用官方汇率直喂BTC与USDT价格,他们很难理解,哪怕他们自己喂USD的价格也够呛能够了解清楚

USDT现价约7.2 CNY

很多见证人的CNY喂价还行,但 USD 喂价是不对的,偏高。

进一步说,EUR和其他币种的喂价不知道差多远。


Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4586
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
The exchange of USDT with CNY

https://c2c.huobi.co/en-us/trade/buy-usdt/
https://trans.zb.com/usdtqc
https://www.gate.io/trade/USDT_CNYX

aicoin这个是大多数国人在用的行情网站。
https://www.aicoin.net.cn/

实际就是国内只能以CNY转换为USDT入金,个别交易所可以以实际法币CNY直接入金。

从交易所取的价格也不能是实时成交价格,应当是深度加权中间价格
USDT现价约7.2 CNY

很多见证人的CNY喂价还行,但 USD 喂价是不对的,偏高。

进一步说,EUR和其他币种的喂价不知道差多远。

« Last Edit: June 04, 2019, 05:26:32 pm by abit »
BitShares committee member: abit
BitShares witness: in.abit

Xeldal

  • Guest
Made some final changes to my script today.  I had CNY, USD, EUR, and BTC. properly feeding yesterday and removed my feeds on the rest of the assets temporarily until I had them reconfigured as well.  Which I've completed this morning.

I'm voted out at the moment.  Please consider re adding your votes.  Thanks. 



Offline binggo

  • Hero Member
  • *****
  • Posts: 2367
  • 世间太多瘪犊子
    • View Profile
The exchange of USDT with CNY

https://c2c.huobi.co/en-us/trade/buy-usdt/
https://trans.zb.com/usdtqc
https://www.gate.io/trade/USDT_CNYX

aicoin这个是大多数国人在用的行情网站。
https://www.aicoin.net.cn/

实际就是国内只能以CNY转换为USDT入金,个别交易所可以以实际法币CNY直接入金。

从交易所取的价格也不能是实时成交价格,应当是深度加权中间价格
« Last Edit: June 03, 2019, 10:56:00 pm by binggo »

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4586
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
看了下这个平台就是FIAT USD,USDT和美元汇率就是1.0对吗?
USDT:法币USD 的历史价格,可以参考这个图 https://trade.kraken.com/markets/kraken/usdt/usd
这个是USD法币和USDT直接交易的交易对。
最近还比较稳,在 1.0 附近

Quote
可以认为人民币通过BTC交易换美元导致美元溢价了2.2个点,这样是可以解释内盘美元比人民币溢价2.2个点
按我的历史数据,USD:CNY 在 7.0到7.1x都出现过,并不是稳定在7.05,更不是6.9。
也就是说USD相对官方汇率的溢价在1.5-3范围波动。

Quote
但是我当时是按美元计价得到内盘美元喂价低了超过2个点,人民币喂价差不多。
你看看bingo在我后面几分钟的截图,人民币计价 0.4728,按1美元7.05算是0.067美元。
有没有可能你们的脚本汇率转换逻辑有问题,把0.067美元的BTS按 6.9 转成人民币喂价 0.4627人民币,再按 7.05的汇率算成 0.0656美元了?
所以当时的实际情况是人民币和美元喂价都低了超过2个点。
binggo的图,你说的是这个吧:https://bitsharestalk.org/index.php?topic=28383.msg331008#msg331008

我看了下,那几个图是分别截的,第2/3个图明显时间戳差了十几分钟,第一个图看不到时间戳,不知道什么时候截的,感觉没法对比。
况且,第一个图是第三方行情站的图,行情站的数据采集是有延迟的,可信度不如直接从交易网站截图。

像下面我的截图这样,把所有网页窗口排在一起截的,都是一个时间点,就好算一点。

再说算法,你觉得你发帖的时候,人民币喂价差不多,这个帖子里
https://bitsharestalk.org/index.php?topic=28383.msg331007#msg331007
中间喂价 0.4640 你感觉是认可的?
你按 6.9 算的话usd喂价应该是 0.464/6.9 = 0.067

我当时的喂价是 cny 0.4637  usd 0.0652
也就是说 usd/cny = 0.4637/0.0652 = 7.11 比 6.9 差了近3个点,但逻辑是对得上的

Quote

@alt

为什么CNY:USD交易价格在7以上,而不是“官方”规定的6.9?因为“官方”汇率是被操纵的。而加密货币交易市场是自由的。

我的上次喂价:
Kraken BTC 报价 8550 美金
Bittrex BTC 报价 8549 美金
ZB BTC  报价 60241 RMB
AEX BTC 报价 60284 RMB

综合结果:
人民币:美金 约等于 7.05

最新报价截图


60300, 60202 / 8582, 8570 ~= 7.015, 7.036
BitShares committee member: abit
BitShares witness: in.abit

Offline zhouxiaobao

      Feed price is too important for DEX. If the bitcny is at a premium and the price of the DEX does not fall, the feed price should not fall.
      The price of DEX is often suppressed by feed prices, but the rise of DEX does not push up feed  prices, which is why we are angry.

Offline zhaomu

  • Newbie
  • *
  • Posts: 19
    • View Profile
unvoted delegate-zhaomu and magicwallet.witness

didn't get any response.
unvoted for verbatech2 and witness.yao.
will wait others response for another 24 hours.

Greetings to Alt and the BTS community members,

Sorry for the late response to this situation and here is my explanation. On May 31st, bitcrab @ me in wechat group about the price feed issue and I responded immediately saying "I will check it" (see the figure below).



So I started to check my price feed script, which seems like the CNY to USD exchange rate caused the issue so I started to find more reliable API of currency exchange(I used the paid openexchangerates) and find if there is any logic bug can be fixed during the calculation of exchange rate. At the meanwhile, I was planning to add the premium between dex and external exchanges as a factor which is taken into consideration as a hotfix, to calculate the final price feed. However, when I first added the premium factor, I mistakenly messed up with its signs, but I found and fixed it immediately. So that's why there is a screenshot shows that the difference between my price feed and the median price feed reached 5%. In fact, this situation might not last for more than 10 minutes. You can see that bitcrab kindly reminded me about the issue at 13:47 and the screenshot about a 5% difference showed up around 14:00 when I am fixing. Finally, my price feed seemed like working well according to my observations later on that day(I am also constantly observing the price feed these days).

Since I thought that my price feed had been back to normal, I did not go to bitsharestalk to check if there was any new discussion about the price feed on the forum that day. And when I found this thread and prepared to respond, I found I cannot get the verification code to post unless *you know it* and due to the current network status(*you know it*), I failed a lot of times. Thus, I missed the in-time response to your question. I am extremely sorry for this and I promise that I will check the forum more frequently in the future. In fact, I really care about the price feed that I check it periodically and I also make quick responses to any changes decideded by the community consensus, e.g., MSSR.

This is my explanation about this event. I apologize for it again and I would be much appreciated if you can re-vote me again. Of course, any advice and suggestion from you and the community are thankful too. I will continue improving my price feed script. I hope we can make Bitshares much better.

Delegate-zhaomu