Author Topic: new api source for price feed from magicwallet faitCNY deposit / withdraw  (Read 5592 times)

0 Members and 1 Guest are viewing this topic.

Offline btspp

Excellent work!
Witness: btspp-witness
mail:cheer@btsplusplus.com
« Last Edit: September 07, 2018, 09:09:02 am by btspp »
Email:contact@btsplusplus.com
Website:http://btspp.io
Witness:btspp-witness

Offline gghi

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
  • BitShares: ttt888
A reference usage of this data is here: https://github.com/sunchao123456/btsprice .
The idea is , the recharge/withdraw price is compensated to the original BTS price through a user defined factor (0-1). For example, now magicwallet.witness set the factor to 0.4, While you can use 1.1 FaitCNY to get 1 bitCNY, it will compute:

   compensated BTS Price = original BTS Price * (1 + (1.1 - 1)*0.4)

if you can use 0.9 FaitCNY to get 1 bitCNY, it will compute:

   compensated BTS Price = original BTS Price * (1 + (0.9 - 1)*0.4)

The original BTS price is from a fork of alt's btsprice (crazybit's one).

Excellent work!

Witness: rnglab
admin@rnglab.org

      voted,  compensated BTS Price = original BTS Price * (bitcny/cny+0.02)^3
« Last Edit: September 03, 2018, 01:00:49 am by gghi »

Offline gghi

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
  • BitShares: ttt888
witness: blckchnd
mail: admin@blckchnd.com

  再来讨论下更加激进的算法,供见证人参考。

           举例论证公式效果,宽松目标负2%,加速因子N=3
当溢价负0.02时(折扣2%),加速因子喂3。理想喂价 = BTS市场价 * (1-0.02+0.02)^3=BTS市场价 *1^3=BTS市场价 *1,结论:目标达到理想状态,无需调整。
当溢价负0.01时(折扣1%),加速因子喂3。理想喂价 = BTS市场价 * (1-0.01+0.02)^3=BTS市场价 *1.01^3=BTS市场价 *1.030301,结论:市场价提高3%,接近理想目标。
当溢价0时,加速因子喂3。理想喂价 = BTS市场价 * (1+0.02)^3=BTS市场价 *1.02^3=BTS市场价 *1.0612,结论:市场价提高约6%,很满意,也很安全。

当溢价0.01时,加速因子喂3。理想喂价 = BTS市场价 * (1.01+0.02)^3=BTS市场价 *1.03^3=BTS市场价 *1.092727,结论:市场价提高约9.2%,满意,也很安全。
当溢价0.02时,加速因子喂3。理想喂价 = BTS市场价 * (1.02+0.02)^3=BTS市场价 *1.04^3=BTS市场价 *1.125,结论:市场价提高约12%,满意,也安全。
当溢价0.03时,加速因子喂3。理想喂价 = BTS市场价 * (1.03+0.02)^3=BTS市场价 *1.05^3=BTS市场价 *1.157,结论:市场价提高约15%,满意,也安全。

当溢价0.04时,加速因子喂3。理想喂价 = BTS市场价 * (1.04+0.02)^3=BTS市场价 *1.06^3=BTS市场价 *1.191,结论:市场价提高约19%,满意,安全。
     当溢价0.05时,加速因子喂3。理想喂价 = BTS市场价 * (1.05+0.02)^3=BTS市场价 *1.07^3=BTS市场价 *1.225,结论:市场价提高约22%,风险依然可控。

          我们可以看到,随着溢价参数的不断变大,市场价提高呈现线性下降趋缓模式。
实际上如果采用M=0.02,即宽松指标为2%,加速因子N=3,这样的公式后,溢价很难超过1%。因为当溢价达到1%时,喂价相对市场价提高了约9.27%,这个时候相当于MSSR为”0“了。也就是说爆仓单对内盘的价格不再有”压制“作用了,此时的内盘完全有动力和外盘保持价格”一致“。如果内外盘趋于价格持平,就是溢价消失的过程。
      结论:如果采用宽松指数M=0.02,即宽松目标2%,加速因子N=3,那么理论上溢价不会超过2%。


Let's discuss the more radical algorithm for reference.

Exemplification of formula effect, loose target negative 2%, acceleration factor N=3
When the premium is negative 0.02 (discount 2%), the acceleration factor is 3. The ideal feeding price = BTS market price * 1-0.02+0.02) ^ 3 = BTS market price * 1 ^ 3 = BTS market price * 1. Conclusion: The target is in an ideal state without adjustment.
When the premium is negative 0.01 (discount 1%), the acceleration factor is 3. Ideal feeding price = BTS market price * 1-0.01+0.02) ^ 3 = BTS market price * 1.01 ^ 3 = BTS market price * 1.030301, conclusion: the market price increases by 3%, close to the ideal target.
When the premium is 0, the acceleration factor is 3. Ideal feeding price = BTS market price * 1 + 0.02) ^ 3 = BTS market price * 1.02 ^ 3 = BTS market price * 1.0612, conclusion: the market price increase of about 6%, very satisfactory and safe.

When the premium is 0.01, the acceleration factor is 3. The ideal feeding price = BTS market price * 1.01 + 0.02) ^ 3 = BTS market price * 1.03 ^ 3 = BTS market price * 1.092727. Conclusion: The market price increases about 9.2%, satisfactory and safe.
When the premium is 0.02, the acceleration factor is 3. The ideal feeding price = BTS market price * 1.02 + 0.02) ^ 3 = BTS market price * 1.04 ^ 3 = BTS market price * 1.125. Conclusion: The market price increases about 12%, satisfactory and safe.
When the premium is 0.03, the acceleration factor is 3. The ideal feeding price = BTS market price * 1.03 + 0.02) ^ 3 = BTS market price * 1.05 ^ 3 = BTS market price * 1.157. Conclusion: The increase of market price is about 15%, satisfactory and safe.

When the premium is 0.04, the acceleration factor is 3. The ideal feeding price = BTS market price * 1.04 + 0.02) ^ 3 = BTS market price * 1.06 ^ 3 = BTS market price * 1.191. Conclusion: The market price increases about 19%, satisfactory and safe.
When the premium is 0.05, the acceleration factor is 3. The ideal feeding price = BTS market price * 1.05 + 0.02) ^ 3 = BTS market price * 1.07 ^ 3 = BTS market price * 1.225, conclusion: the market price increases about 22%, the risk is still controllable.

We can see that with the constant increase of the premium parameters, the market price increases show a linear decline slowing down model.
In fact, if M = 0.02, that is, the easing index is 2%, the accelerating factor N = 3, such a formula, the premium is very difficult to exceed 1%. Because when the premium reaches 1%, the feed price rises by about 9.27% relative to the market price, which is equivalent to the MSSR of "0". That is to say, the explosive warehouse receipt no longer has a "suppressive" effect on the price of the internal market, at this time the internal market is fully motivated and the external market to maintain a "consistent" price. If the internal and external prices tend to be flat, the premium will disappear.
Conclusion: If the easing index M = 0.02, that is, the easing target 2%, the accelerating factor N = 3, then the theoretical premium will not exceed 2%.

Offline gghi

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
  • BitShares: ttt888
Witness: elmato
matias[dot]romeo[at]diventi.com.ar

   Let's discuss the more radical algorithm for reference.

Exemplification of formula effect, loose target negative 2%, acceleration factor N=3
When the premium is negative 0.02 (discount 2%), the acceleration factor is 3. The ideal feeding price = BTS market price * 1-0.02+0.02) ^ 3 = BTS market price * 1 ^ 3 = BTS market price * 1. Conclusion: The target is in an ideal state without adjustment.
When the premium is negative 0.01 (discount 1%), the acceleration factor is 3. Ideal feeding price = BTS market price * 1-0.01+0.02) ^ 3 = BTS market price * 1.01 ^ 3 = BTS market price * 1.030301, conclusion: the market price increases by 3%, close to the ideal target.
When the premium is 0, the acceleration factor is 3. Ideal feeding price = BTS market price * 1 + 0.02) ^ 3 = BTS market price * 1.02 ^ 3 = BTS market price * 1.0612, conclusion: the market price increase of about 6%, very satisfactory and safe.

When the premium is 0.01, the acceleration factor is 3. The ideal feeding price = BTS market price * 1.01 + 0.02) ^ 3 = BTS market price * 1.03 ^ 3 = BTS market price * 1.092727. Conclusion: The market price increases about 9.2%, satisfactory and safe.
When the premium is 0.02, the acceleration factor is 3. The ideal feeding price = BTS market price * 1.02 + 0.02) ^ 3 = BTS market price * 1.04 ^ 3 = BTS market price * 1.125. Conclusion: The market price increases about 12%, satisfactory and safe.
When the premium is 0.03, the acceleration factor is 3. The ideal feeding price = BTS market price * 1.03 + 0.02) ^ 3 = BTS market price * 1.05 ^ 3 = BTS market price * 1.157. Conclusion: The increase of market price is about 15%, satisfactory and safe.

When the premium is 0.04, the acceleration factor is 3. The ideal feeding price = BTS market price * 1.04 + 0.02) ^ 3 = BTS market price * 1.06 ^ 3 = BTS market price * 1.191. Conclusion: The market price increases about 19%, satisfactory and safe.
When the premium is 0.05, the acceleration factor is 3. The ideal feeding price = BTS market price * 1.05 + 0.02) ^ 3 = BTS market price * 1.07 ^ 3 = BTS market price * 1.225, conclusion: the market price increases about 22%, the risk is still controllable.

We can see that with the constant increase of the premium parameters, the market price increases show a linear decline slowing down model.
In fact, if M = 0.02, that is, the easing index is 2%, the accelerating factor N = 3, such a formula, the premium is very difficult to exceed 1%. Because when the premium reaches 1%, the feed price rises by about 9.27% relative to the market price, which is equivalent to the MSSR of "0". That is to say, the explosive warehouse receipt no longer has a "suppressive" effect on the price of the internal market, at this time the internal market is fully motivated and the external market to maintain a "consistent" price. If the internal and external prices tend to be flat, the premium will disappear.
Conclusion: If the easing index M = 0.02, that is, the easing target 2%, the accelerating factor N = 3, then the theoretical premium will not exceed 2%.

    再来讨论下更加激进的算法,供见证人参考。

           举例论证公式效果,宽松目标负2%,加速因子N=3
当溢价负0.02时(折扣2%),加速因子喂3。理想喂价 = BTS市场价 * (1-0.02+0.02)^3=BTS市场价 *1^3=BTS市场价 *1,结论:目标达到理想状态,无需调整。
当溢价负0.01时(折扣1%),加速因子喂3。理想喂价 = BTS市场价 * (1-0.01+0.02)^3=BTS市场价 *1.01^3=BTS市场价 *1.030301,结论:市场价提高3%,接近理想目标。
当溢价0时,加速因子喂3。理想喂价 = BTS市场价 * (1+0.02)^3=BTS市场价 *1.02^3=BTS市场价 *1.0612,结论:市场价提高约6%,很满意,也很安全。

当溢价0.01时,加速因子喂3。理想喂价 = BTS市场价 * (1.01+0.02)^3=BTS市场价 *1.03^3=BTS市场价 *1.092727,结论:市场价提高约9.2%,满意,也很安全。
当溢价0.02时,加速因子喂3。理想喂价 = BTS市场价 * (1.02+0.02)^3=BTS市场价 *1.04^3=BTS市场价 *1.125,结论:市场价提高约12%,满意,也安全。
当溢价0.03时,加速因子喂3。理想喂价 = BTS市场价 * (1.03+0.02)^3=BTS市场价 *1.05^3=BTS市场价 *1.157,结论:市场价提高约15%,满意,也安全。

当溢价0.04时,加速因子喂3。理想喂价 = BTS市场价 * (1.04+0.02)^3=BTS市场价 *1.06^3=BTS市场价 *1.191,结论:市场价提高约19%,满意,安全。
     当溢价0.05时,加速因子喂3。理想喂价 = BTS市场价 * (1.05+0.02)^3=BTS市场价 *1.07^3=BTS市场价 *1.225,结论:市场价提高约22%,风险依然可控。

          我们可以看到,随着溢价参数的不断变大,市场价提高呈现线性下降趋缓模式。
实际上如果采用M=0.02,即宽松指标为2%,加速因子N=3,这样的公式后,溢价很难超过1%。因为当溢价达到1%时,喂价相对市场价提高了约9.27%,这个时候相当于MSSR为”0“了。也就是说爆仓单对内盘的价格不再有”压制“作用了,此时的内盘完全有动力和外盘保持价格”一致“。如果内外盘趋于价格持平,就是溢价消失的过程。
      结论:如果采用宽松指数M=0.02,即宽松目标2%,加速因子N=3,那么理论上溢价不会超过2%。

Offline gghi

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
  • BitShares: ttt888
A reference usage of this data is here: https://github.com/sunchao123456/btsprice .
The idea is , the recharge/withdraw price is compensated to the original BTS price through a user defined factor (0-1). For example, now magicwallet.witness set the factor to 0.4, While you can use 1.1 FaitCNY to get 1 bitCNY, it will compute:

   compensated BTS Price = original BTS Price * (1 + (1.1 - 1)*0.4)

if you can use 0.9 FaitCNY to get 1 bitCNY, it will compute:

   compensated BTS Price = original BTS Price * (1 + (0.9 - 1)*0.4)

The original BTS price is from a fork of alt's btsprice (crazybit's one).
compensated BTS Price = original BTS Price * (bitcny/cny+0.02)^3
     

Offline gghi

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
  • BitShares: ttt888

Xeldal

  • Guest

Offline ElMato

  • Sr. Member
  • ****
  • Posts: 288
    • View Profile
Witness: elmato
matias[dot]romeo[at]diventi.com.ar

Offline rnglab

  • Full Member
  • ***
  • Posts: 171
    • View Profile
  • BitShares: rnglab
A reference usage of this data is here: https://github.com/sunchao123456/btsprice .
The idea is , the recharge/withdraw price is compensated to the original BTS price through a user defined factor (0-1). For example, now magicwallet.witness set the factor to 0.4, While you can use 1.1 FaitCNY to get 1 bitCNY, it will compute:

   compensated BTS Price = original BTS Price * (1 + (1.1 - 1)*0.4)

if you can use 0.9 FaitCNY to get 1 bitCNY, it will compute:

   compensated BTS Price = original BTS Price * (1 + (0.9 - 1)*0.4)

The original BTS price is from a fork of alt's btsprice (crazybit's one).

Excellent work!

Witness: rnglab
admin@rnglab.org

Offline pluswave

A reference usage of this data is here: https://github.com/sunchao123456/btsprice .
The idea is , the recharge/withdraw price is compensated to the original BTS price through a user defined factor (0-1). For example, now magicwallet.witness set the factor to 0.4, While you can use 1.1 FaitCNY to get 1 bitCNY, it will compute:

   compensated BTS Price = original BTS Price * (1 + (1.1 - 1)*0.4)

if you can use 0.9 FaitCNY to get 1 bitCNY, it will compute:

   compensated BTS Price = original BTS Price * (1 + (0.9 - 1)*0.4)

The original BTS price is from a fork of alt's btsprice (crazybit's one).
blog: https://blog.xiaofuxing.name
org: https://www.magicwallet.io
Please vote for magicwallet.witness !

Offline blockchained


Offline pluswave

Hello,
       MagicWallet team is ready for new api source for price feed. As you know , we have the faitCNY/bitCNY deposit/withdraw gateway (p2p), so can provide some data to witnesses now. But this data is not for public. As a witness, if you are interesting to use this source, please use one of the following methods to apply your api key:

1 . reply this topic, comment your email address and your witness account
2.  send a mail to pluswave@magicwallet.io

the provided data is a array of accumulated deposit/withdraw transactions:


{  depositBitCNY: '0.0000',
    depositFiatCNY: '0.0000',
    depositCount: 0,
    withdrawBitCNY: '0.0000',
    withdrawFiatCNY: '0.0000',
    withdrawCount: 0,
    startdate: '2018-03-15T02:50:00.000Z',
    datelength: 1,
    datatype: '1m'
 },

the data is updated every minutes. you can get most recent data for:

1min
5min
15min
30min
1h
2h
4h
6h
12h
24h

blog: https://blog.xiaofuxing.name
org: https://www.magicwallet.io
Please vote for magicwallet.witness !