From 66c95eae3b3f678ffc65b1bd1c29dfe4da65d24c Mon Sep 17 00:00:00 2001 From: shulthz <34892308+shulthz@users.noreply.github.com> Date: Mon, 24 Feb 2020 09:29:32 +0800 Subject: [PATCH 01/11] Create baip-0004.md --- baip-0004.md | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 baip-0004.md diff --git a/baip-0004.md b/baip-0004.md new file mode 100644 index 0000000..90f398f --- /dev/null +++ b/baip-0004.md @@ -0,0 +1,102 @@ +``` +BAIP: 004 +Title: Use 1 hours period EMA(6) to instead of BAIP2 +Authors: shulthz +Status: Draft +Type: Consensus +Created: 2020-02-22 +``` + +# Abstract +Use 1 hours period EMA(6) to instead of BAIP2 + +# Motivation +BAIP2 track the real-time price too slowly, when the price has plummeted, there will have a big discount space for bitasset, it need two days to repair the price, this will crush the confidence of the holder of bitasset, harm the bitasset. + +EMA have a key point is more better than BAIP2: The EMA is a moving average that places a greater weight and significance on the most recent data points. + +This FEED PRICE can track the real-time price more quickly, can avoid the lower shadow and repair price more faster(but still need one or two hours to repair). + +The one hour will be cooling time. + +Shorting attack will need more time to make the price down. + +There still have a big discount space, so i think to add the Weighting factor * Current price to make the big discount space more smaller. + +Weighting factor * Current price will increase the nondeterminacy of feed price. + +# Rational + +Follow the BSIP76 and BSIP58. + +# Specifications + +>**FEED PRICE =max (Weighting factor * 1 hours period EMA(6) + Weighting factor * Current price,Current price)** + +Current price : The real-time BTS price of CEX, and notice: we still have many feed provider give a most lower feed price of CEX. + +1 hours period EMA(6): Get the latest bar data from CEX,then calculate out the EMA6. + +Weighting factor: EMA(6) is the latest bar. +The Weighting factor of EMA(6)=EMA(6)/(X * current price + EMA(6)), We can try X=6 first,X=(1,10) + +## Explanation: +As the EMA(6)come from the latest finished 1 hour bar, and the current price come from the next hour which the 1 hour bar didn't finish, so the feed price was constituted by a fixed EMA(6)in 1 hour and a variable current price. + +If use proportion of weighting factor, the weighting factor of EMA(6)will be great when the price spread became great between EMA(6)and current price, the value of X will determine the upper limit, if the price spread became small, the weight of EMA(6) will become small followling. + +proportion of weight X=3,data come from 1hour EMA6,2020/02/15 22:00 to 2020/02/17 03:00 + +| EMA\(6\) | CEX PRICE | FEEDRPICE1 | FEEDRPICE2 | EMA weight11 | CEX weight1 | EMA weight2 | CEX weight2 | Spread1 | Spread2 | FALL | +|-----------|---------|----------|----------|--------|-------|----------|----------|--------|----------|----------| +| 0\.0389 | 0\.0366 | 0\.0373 | 0\.0372 | 0\.3 | 0\.7 | 0\.2616 | 0\.7384 | 1\.89% | 1\.6439% | 6\.28% | +| 0\.0385 | 0\.0332 | 0\.0348 | 0\.0347 | 0\.3 | 0\.7 | 0\.2788 | 0\.7212 | 4\.79% | 4\.4505% | 15\.96% | +| 0\.0373 | 0\.034 | 0\.0350 | 0\.0349 | 0\.3 | 0\.7 | 0\.2678 | 0\.7322 | 2\.91% | 2\.5989% | 9\.71% | +| 0\.0364 | 0\.0332 | 0\.0342 | 0\.0341 | 0\.3 | 0\.7 | 0\.2676 | 0\.7324 | 2\.89% | 2\.5797% | 9\.64% | +| 0\.0359 | 0\.0346 | 0\.0350 | 0\.0349 | 0\.3 | 0\.7 | 0\.2570 | 0\.7430 | 1\.13% | 0\.9655% | 3\.76% | +| 0\.0357 | 0\.0345 | 0\.0349 | 0\.0348 | 0\.3 | 0\.7 | 0\.2565 | 0\.7435 | 1\.04% | 0\.8921% | 3\.48% | +| 0\.0354 | 0\.0346 | 0\.0348 | 0\.0348 | 0\.3 | 0\.7 | 0\.2543 | 0\.7457 | 0\.69% | 0\.5880% | 2\.31% | +| 0\.0353 | 0\.0348 | 0\.0350 | 0\.0349 | 0\.3 | 0\.7 | 0\.2527 | 0\.7473 | 0\.43% | 0\.3631% | 1\.44% | +| 0\.0352 | 0\.0346 | 0\.0348 | 0\.0348 | 0\.3 | 0\.7 | 0\.2532 | 0\.7468 | 0\.52% | 0\.4391% | 1\.73% | +| 0\.035 | 0\.034 | 0\.0343 | 0\.0343 | 0\.3 | 0\.7 | 0\.2555 | 0\.7445 | 0\.88% | 0\.7514% | 2\.94% | +| 0\.035 | 0\.0349 | 0\.0349 | 0\.0349 | 0\.3 | 0\.7 | 0\.2505 | 0\.7495 | 0\.09% | 0\.0718% | 0\.29% | +| 0\.0351 | 0\.0351 | 0\.0351 | 0\.0351 | 0\.3 | 0\.7 | 0\.2500 | 0\.7500 | 0\.00% | 0\.0000% | 0\.00% | +| 0\.0355 | 0\.0361 | 0\.0361 | 0\.0361 | 0\.3 | 0\.7 | 0\.2469 | 0\.7531 | 0\.00% | 0\.0000% | \-1\.66% | +| 0\.0357 | 0\.0361 | 0\.0361 | 0\.0361 | 0\.3 | 0\.7 | 0\.2479 | 0\.7521 | 0\.00% | 0\.0000% | \-1\.11% | +| 0\.0359 | 0\.0355 | 0\.0356 | 0\.0356 | 0\.3 | 0\.7 | 0\.2521 | 0\.7479 | 0\.34% | 0\.2841% | 1\.13% | +| 0\.0358 | 0\.0355 | 0\.0356 | 0\.0356 | 0\.3 | 0\.7 | 0\.2516 | 0\.7484 | 0\.25% | 0\.2126% | 0\.85% | +| 0\.0357 | 0\.0354 | 0\.0355 | 0\.0355 | 0\.3 | 0\.7 | 0\.2516 | 0\.7484 | 0\.25% | 0\.2132% | 0\.85% | +| 0\.0357 | 0\.0351 | 0\.0353 | 0\.0353 | 0\.3 | 0\.7 | 0\.2532 | 0\.7468 | 0\.51% | 0\.4328% | 1\.71% | +| 0\.0356 | 0\.035 | 0\.0352 | 0\.0352 | 0\.3 | 0\.7 | 0\.2532 | 0\.7468 | 0\.51% | 0\.4341% | 1\.71% | +| 0\.0354 | 0\.0336 | 0\.0341 | 0\.0341 | 0\.3 | 0\.7 | 0\.2599 | 0\.7401 | 1\.61% | 1\.3924% | 5\.36% | +| 0\.035 | 0\.0333 | 0\.0338 | 0\.0337 | 0\.3 | 0\.7 | 0\.2595 | 0\.7405 | 1\.53% | 1\.3245% | 5\.11% | +| 0\.0345 | 0\.0332 | 0\.0336 | 0\.0335 | 0\.3 | 0\.7 | 0\.2573 | 0\.7427 | 1\.17% | 1\.0074% | 3\.92% | +| 0\.0342 | 0\.0324 | 0\.0329 | 0\.0329 | 0\.3 | 0\.7 | 0\.2603 | 0\.7397 | 1\.67% | 1\.4460% | 5\.56% | +| 0\.034 | 0\.0326 | 0\.0330 | 0\.0330 | 0\.3 | 0\.7 | 0\.2580 | 0\.7420 | 1\.29% | 1\.1078% | 4\.29% | +| 0\.0337 | 0\.032 | 0\.0325 | 0\.0324 | 0\.3 | 0\.7 | 0\.2598 | 0\.7402 | 1\.59% | 1\.3803% | 5\.31% | +| 0\.0333 | 0\.0301 | 0\.0311 | 0\.0310 | 0\.3 | 0\.7 | 0\.2694 | 0\.7306 | 3\.19% | 2\.8642% | 10\.63% | +| 0\.0328 | 0\.0303 | 0\.0311 | 0\.0310 | 0\.3 | 0\.7 | 0\.2652 | 0\.7348 | 2\.48% | 2\.1878% | 8\.25% | +| 0\.0323 | 0\.0317 | 0\.0319 | 0\.0319 | 0\.3 | 0\.7 | 0\.2535 | 0\.7465 | 0\.57% | 0\.4799% | 1\.89% | +| 0\.0322 | 0\.0305 | 0\.0310 | 0\.0309 | 0\.3 | 0\.7 | 0\.2603 | 0\.7397 | 1\.67% | 1\.4509% | 5\.57% | +| 0\.0317 | 0\.0305 | 0\.0309 | 0\.0308 | 0\.3 | 0\.7 | 0\.2573 | 0\.7427 | 1\.18% | 1\.0123% | 3\.93% | + + +# Coordination +https://github.com/bitshares/bsips/issues/221 +https://github.com/bitshares/baips/issues/4 +https://github.com/bitshares/baips/issues/7 + +# Summary for holders + +# Discussion +https://bitsharestalk.org/index.php?topic=32153.msg341242#new +https://bitsharestalk.org/index.php?topic=32143.msg341235;topicseen#msg341235 + +# See also +Exponential Moving Average - EMA Definition: https://www.investopedia.com/terms/e/ema.asp +Inflation Index:https://www.imf.org/external/pubs/ft/spn/2010/spn1003.pdf +Weight:https://cn.bing.com/academic/profile?id=134466208&v=fos_preview + +# Copyright + +This document is placed in the public domain. From a16cb472e6fe7896389f68aa7a2b325f07f90171 Mon Sep 17 00:00:00 2001 From: shulthz <34892308+shulthz@users.noreply.github.com> Date: Mon, 24 Feb 2020 09:32:56 +0800 Subject: [PATCH 02/11] Update baip-0004.md --- baip-0004.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/baip-0004.md b/baip-0004.md index 90f398f..5a0e9af 100644 --- a/baip-0004.md +++ b/baip-0004.md @@ -31,13 +31,13 @@ Follow the BSIP76 and BSIP58. # Specifications ->**FEED PRICE =max (Weighting factor * 1 hours period EMA(6) + Weighting factor * Current price,Current price)** +**FEED PRICE =max (Weighting factor * 1 hours period EMA(6) + Weighting factor * Current price,Current price)** Current price : The real-time BTS price of CEX, and notice: we still have many feed provider give a most lower feed price of CEX. 1 hours period EMA(6): Get the latest bar data from CEX,then calculate out the EMA6. -Weighting factor: EMA(6) is the latest bar. +Weighting factor: EMA(6) is the latest bar. The Weighting factor of EMA(6)=EMA(6)/(X * current price + EMA(6)), We can try X=6 first,X=(1,10) ## Explanation: From f0ce263e1ea1ed96b484db8a5f4a122e20901494 Mon Sep 17 00:00:00 2001 From: shulthz <34892308+shulthz@users.noreply.github.com> Date: Mon, 24 Feb 2020 10:41:39 +0800 Subject: [PATCH 03/11] Update baip-0004.md --- baip-0004.md | 1 + 1 file changed, 1 insertion(+) diff --git a/baip-0004.md b/baip-0004.md index 5a0e9af..03d5256 100644 --- a/baip-0004.md +++ b/baip-0004.md @@ -85,6 +85,7 @@ proportion of weight X=3,data come from 1hour EMA6,2020/02/15 22:00 to 202 https://github.com/bitshares/bsips/issues/221 https://github.com/bitshares/baips/issues/4 https://github.com/bitshares/baips/issues/7 +https://github.com/bitshares/bsips/blob/master/bsip-0042.md # Summary for holders From 8ee966c3a5f4e7fc6a98496578f8baadc9e72da8 Mon Sep 17 00:00:00 2001 From: shulthz <34892308+shulthz@users.noreply.github.com> Date: Mon, 24 Feb 2020 10:42:33 +0800 Subject: [PATCH 04/11] Update baip-0004.md --- baip-0004.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/baip-0004.md b/baip-0004.md index 03d5256..4797a8c 100644 --- a/baip-0004.md +++ b/baip-0004.md @@ -82,21 +82,21 @@ proportion of weight X=3,data come from 1hour EMA6,2020/02/15 22:00 to 202 # Coordination -https://github.com/bitshares/bsips/issues/221 -https://github.com/bitshares/baips/issues/4 -https://github.com/bitshares/baips/issues/7 +https://github.com/bitshares/bsips/issues/221 +https://github.com/bitshares/baips/issues/4 +https://github.com/bitshares/baips/issues/7 https://github.com/bitshares/bsips/blob/master/bsip-0042.md # Summary for holders -# Discussion -https://bitsharestalk.org/index.php?topic=32153.msg341242#new -https://bitsharestalk.org/index.php?topic=32143.msg341235;topicseen#msg341235 +# Discussion +https://bitsharestalk.org/index.php?topic=32153.msg341242#new +https://bitsharestalk.org/index.php?topic=32143.msg341235;topicseen#msg341235 # See also -Exponential Moving Average - EMA Definition: https://www.investopedia.com/terms/e/ema.asp -Inflation Index:https://www.imf.org/external/pubs/ft/spn/2010/spn1003.pdf -Weight:https://cn.bing.com/academic/profile?id=134466208&v=fos_preview +Exponential Moving Average - EMA Definition: https://www.investopedia.com/terms/e/ema.asp +Inflation Index:https://www.imf.org/external/pubs/ft/spn/2010/spn1003.pdf +Weight:https://cn.bing.com/academic/profile?id=134466208&v=fos_preview # Copyright From 7235a0cbef15ae1b51bb8f278dd3491663b5c185 Mon Sep 17 00:00:00 2001 From: shulthz <34892308+shulthz@users.noreply.github.com> Date: Mon, 24 Feb 2020 10:53:41 +0800 Subject: [PATCH 05/11] Update baip-0004.md --- baip-0004.md | 69 ++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/baip-0004.md b/baip-0004.md index 4797a8c..b30c348 100644 --- a/baip-0004.md +++ b/baip-0004.md @@ -45,40 +45,41 @@ As the EMA(6)come from the latest finished 1 hour bar, and the current price If use proportion of weighting factor, the weighting factor of EMA(6)will be great when the price spread became great between EMA(6)and current price, the value of X will determine the upper limit, if the price spread became small, the weight of EMA(6) will become small followling. -proportion of weight X=3,data come from 1hour EMA6,2020/02/15 22:00 to 2020/02/17 03:00 - -| EMA\(6\) | CEX PRICE | FEEDRPICE1 | FEEDRPICE2 | EMA weight11 | CEX weight1 | EMA weight2 | CEX weight2 | Spread1 | Spread2 | FALL | -|-----------|---------|----------|----------|--------|-------|----------|----------|--------|----------|----------| -| 0\.0389 | 0\.0366 | 0\.0373 | 0\.0372 | 0\.3 | 0\.7 | 0\.2616 | 0\.7384 | 1\.89% | 1\.6439% | 6\.28% | -| 0\.0385 | 0\.0332 | 0\.0348 | 0\.0347 | 0\.3 | 0\.7 | 0\.2788 | 0\.7212 | 4\.79% | 4\.4505% | 15\.96% | -| 0\.0373 | 0\.034 | 0\.0350 | 0\.0349 | 0\.3 | 0\.7 | 0\.2678 | 0\.7322 | 2\.91% | 2\.5989% | 9\.71% | -| 0\.0364 | 0\.0332 | 0\.0342 | 0\.0341 | 0\.3 | 0\.7 | 0\.2676 | 0\.7324 | 2\.89% | 2\.5797% | 9\.64% | -| 0\.0359 | 0\.0346 | 0\.0350 | 0\.0349 | 0\.3 | 0\.7 | 0\.2570 | 0\.7430 | 1\.13% | 0\.9655% | 3\.76% | -| 0\.0357 | 0\.0345 | 0\.0349 | 0\.0348 | 0\.3 | 0\.7 | 0\.2565 | 0\.7435 | 1\.04% | 0\.8921% | 3\.48% | -| 0\.0354 | 0\.0346 | 0\.0348 | 0\.0348 | 0\.3 | 0\.7 | 0\.2543 | 0\.7457 | 0\.69% | 0\.5880% | 2\.31% | -| 0\.0353 | 0\.0348 | 0\.0350 | 0\.0349 | 0\.3 | 0\.7 | 0\.2527 | 0\.7473 | 0\.43% | 0\.3631% | 1\.44% | -| 0\.0352 | 0\.0346 | 0\.0348 | 0\.0348 | 0\.3 | 0\.7 | 0\.2532 | 0\.7468 | 0\.52% | 0\.4391% | 1\.73% | -| 0\.035 | 0\.034 | 0\.0343 | 0\.0343 | 0\.3 | 0\.7 | 0\.2555 | 0\.7445 | 0\.88% | 0\.7514% | 2\.94% | -| 0\.035 | 0\.0349 | 0\.0349 | 0\.0349 | 0\.3 | 0\.7 | 0\.2505 | 0\.7495 | 0\.09% | 0\.0718% | 0\.29% | -| 0\.0351 | 0\.0351 | 0\.0351 | 0\.0351 | 0\.3 | 0\.7 | 0\.2500 | 0\.7500 | 0\.00% | 0\.0000% | 0\.00% | -| 0\.0355 | 0\.0361 | 0\.0361 | 0\.0361 | 0\.3 | 0\.7 | 0\.2469 | 0\.7531 | 0\.00% | 0\.0000% | \-1\.66% | -| 0\.0357 | 0\.0361 | 0\.0361 | 0\.0361 | 0\.3 | 0\.7 | 0\.2479 | 0\.7521 | 0\.00% | 0\.0000% | \-1\.11% | -| 0\.0359 | 0\.0355 | 0\.0356 | 0\.0356 | 0\.3 | 0\.7 | 0\.2521 | 0\.7479 | 0\.34% | 0\.2841% | 1\.13% | -| 0\.0358 | 0\.0355 | 0\.0356 | 0\.0356 | 0\.3 | 0\.7 | 0\.2516 | 0\.7484 | 0\.25% | 0\.2126% | 0\.85% | -| 0\.0357 | 0\.0354 | 0\.0355 | 0\.0355 | 0\.3 | 0\.7 | 0\.2516 | 0\.7484 | 0\.25% | 0\.2132% | 0\.85% | -| 0\.0357 | 0\.0351 | 0\.0353 | 0\.0353 | 0\.3 | 0\.7 | 0\.2532 | 0\.7468 | 0\.51% | 0\.4328% | 1\.71% | -| 0\.0356 | 0\.035 | 0\.0352 | 0\.0352 | 0\.3 | 0\.7 | 0\.2532 | 0\.7468 | 0\.51% | 0\.4341% | 1\.71% | -| 0\.0354 | 0\.0336 | 0\.0341 | 0\.0341 | 0\.3 | 0\.7 | 0\.2599 | 0\.7401 | 1\.61% | 1\.3924% | 5\.36% | -| 0\.035 | 0\.0333 | 0\.0338 | 0\.0337 | 0\.3 | 0\.7 | 0\.2595 | 0\.7405 | 1\.53% | 1\.3245% | 5\.11% | -| 0\.0345 | 0\.0332 | 0\.0336 | 0\.0335 | 0\.3 | 0\.7 | 0\.2573 | 0\.7427 | 1\.17% | 1\.0074% | 3\.92% | -| 0\.0342 | 0\.0324 | 0\.0329 | 0\.0329 | 0\.3 | 0\.7 | 0\.2603 | 0\.7397 | 1\.67% | 1\.4460% | 5\.56% | -| 0\.034 | 0\.0326 | 0\.0330 | 0\.0330 | 0\.3 | 0\.7 | 0\.2580 | 0\.7420 | 1\.29% | 1\.1078% | 4\.29% | -| 0\.0337 | 0\.032 | 0\.0325 | 0\.0324 | 0\.3 | 0\.7 | 0\.2598 | 0\.7402 | 1\.59% | 1\.3803% | 5\.31% | -| 0\.0333 | 0\.0301 | 0\.0311 | 0\.0310 | 0\.3 | 0\.7 | 0\.2694 | 0\.7306 | 3\.19% | 2\.8642% | 10\.63% | -| 0\.0328 | 0\.0303 | 0\.0311 | 0\.0310 | 0\.3 | 0\.7 | 0\.2652 | 0\.7348 | 2\.48% | 2\.1878% | 8\.25% | -| 0\.0323 | 0\.0317 | 0\.0319 | 0\.0319 | 0\.3 | 0\.7 | 0\.2535 | 0\.7465 | 0\.57% | 0\.4799% | 1\.89% | -| 0\.0322 | 0\.0305 | 0\.0310 | 0\.0309 | 0\.3 | 0\.7 | 0\.2603 | 0\.7397 | 1\.67% | 1\.4509% | 5\.57% | -| 0\.0317 | 0\.0305 | 0\.0309 | 0\.0308 | 0\.3 | 0\.7 | 0\.2573 | 0\.7427 | 1\.18% | 1\.0123% | 3\.93% | +proportion of weight X=6,data come from huobi 1hour EMA6,2020/02/15 22:00 to 2020/02/17 03:00 + +| EMA\(6\) | CEX PRICE | FEED PRICE | EMA WEIGHT | CEX weight | spread | FALL | +|-----------|---------|----------|----------|----------|----------|----------| +| 0\.0389 | 0\.0366 | 0\.0369 | 0\.1505 | 0\.8495 | 0\.9457% | 6\.28% | +| 0\.0385 | 0\.0332 | 0\.0341 | 0\.1620 | 0\.8380 | 2\.5856% | 15\.96% | +| 0\.0373 | 0\.034 | 0\.0345 | 0\.1546 | 0\.8454 | 1\.5003% | 9\.71% | +| 0\.0364 | 0\.0332 | 0\.0337 | 0\.1545 | 0\.8455 | 1\.4891% | 9\.64% | +| 0\.0359 | 0\.0346 | 0\.0348 | 0\.1474 | 0\.8526 | 0\.5539% | 3\.76% | +| 0\.0357 | 0\.0345 | 0\.0347 | 0\.1471 | 0\.8529 | 0\.5116% | 3\.48% | +| 0\.0354 | 0\.0346 | 0\.0347 | 0\.1457 | 0\.8543 | 0\.3368% | 2\.31% | +| 0\.0353 | 0\.0348 | 0\.0349 | 0\.1446 | 0\.8554 | 0\.2078% | 1\.44% | +| 0\.0352 | 0\.0346 | 0\.0347 | 0\.1450 | 0\.8550 | 0\.2514% | 1\.73% | +| 0\.035 | 0\.034 | 0\.0341 | 0\.1464 | 0\.8536 | 0\.4307% | 2\.94% | +| 0\.035 | 0\.0349 | 0\.0349 | 0\.1432 | 0\.8568 | 0\.0410% | 0\.29% | +| 0\.0351 | 0\.0351 | 0\.0351 | 0\.1429 | 0\.8571 | 0\.0000% | 0\.00% | +| 0\.0355 | 0\.0361 | 0\.0361 | 0\.1408 | 0\.8592 | 0\.0000% | \-1\.66% | +| 0\.0357 | 0\.0361 | 0\.0361 | 0\.1415 | 0\.8585 | 0\.0000% | \-1\.11% | +| 0\.0359 | 0\.0355 | 0\.0356 | 0\.1442 | 0\.8558 | 0\.1625% | 1\.13% | +| 0\.0358 | 0\.0355 | 0\.0355 | 0\.1439 | 0\.8561 | 0\.1216% | 0\.85% | +| 0\.0357 | 0\.0354 | 0\.0354 | 0\.1439 | 0\.8561 | 0\.1219% | 0\.85% | +| 0\.0357 | 0\.0351 | 0\.0352 | 0\.1449 | 0\.8551 | 0\.2478% | 1\.71% | +| 0\.0356 | 0\.035 | 0\.0351 | 0\.1450 | 0\.8550 | 0\.2485% | 1\.71% | +| 0\.0354 | 0\.0336 | 0\.0339 | 0\.1494 | 0\.8506 | 0\.8002% | 5\.36% | +| 0\.035 | 0\.0333 | 0\.0336 | 0\.1491 | 0\.8509 | 0\.7610% | 5\.11% | +| 0\.0345 | 0\.0332 | 0\.0334 | 0\.1476 | 0\.8524 | 0\.5781% | 3\.92% | +| 0\.0342 | 0\.0324 | 0\.0327 | 0\.1496 | 0\.8504 | 0\.8311% | 5\.56% | +| 0\.034 | 0\.0326 | 0\.0328 | 0\.1481 | 0\.8519 | 0\.6359% | 4\.29% | +| 0\.0337 | 0\.032 | 0\.0323 | 0\.1493 | 0\.8507 | 0\.7932% | 5\.31% | +| 0\.0333 | 0\.0301 | 0\.0306 | 0\.1557 | 0\.8443 | 1\.6551% | 10\.63% | +| 0\.0328 | 0\.0303 | 0\.0307 | 0\.1528 | 0\.8472 | 1\.2611% | 8\.25% | +| 0\.0323 | 0\.0317 | 0\.0318 | 0\.1452 | 0\.8548 | 0\.2748% | 1\.89% | +| 0\.0322 | 0\.0305 | 0\.0308 | 0\.1496 | 0\.8504 | 0\.8340% | 5\.57% | +| 0\.0317 | 0\.0305 | 0\.0307 | 0\.1476 | 0\.8524 | 0\.5809% | 3\.93% | + # Coordination From 0af0d4e7a1873eccce3370aedff8df9e7cc90bde Mon Sep 17 00:00:00 2001 From: shulthz <34892308+shulthz@users.noreply.github.com> Date: Thu, 27 Feb 2020 08:32:22 +0800 Subject: [PATCH 06/11] Update baip-0004.md --- baip-0004.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baip-0004.md b/baip-0004.md index b30c348..8aaf9c2 100644 --- a/baip-0004.md +++ b/baip-0004.md @@ -38,7 +38,7 @@ Current price : The real-time BTS price of CEX, and notice: we still have many f 1 hours period EMA(6): Get the latest bar data from CEX,then calculate out the EMA6. Weighting factor: EMA(6) is the latest bar. -The Weighting factor of EMA(6)=EMA(6)/(X * current price + EMA(6)), We can try X=6 first,X=(1,10) +The Weighting factor of EMA(6)=EMA(6)/(X * current price + EMA(6)), We can try X=5 first,X=(1,10) ## Explanation: As the EMA(6)come from the latest finished 1 hour bar, and the current price come from the next hour which the 1 hour bar didn't finish, so the feed price was constituted by a fixed EMA(6)in 1 hour and a variable current price. From a4426d005a89e6190e68603ee7bc76439e6fbf04 Mon Sep 17 00:00:00 2001 From: shulthz <34892308+shulthz@users.noreply.github.com> Date: Sun, 1 Mar 2020 11:00:29 +0800 Subject: [PATCH 07/11] Update baip-0004.md --- baip-0004.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baip-0004.md b/baip-0004.md index 8aaf9c2..1b0567e 100644 --- a/baip-0004.md +++ b/baip-0004.md @@ -38,7 +38,7 @@ Current price : The real-time BTS price of CEX, and notice: we still have many f 1 hours period EMA(6): Get the latest bar data from CEX,then calculate out the EMA6. Weighting factor: EMA(6) is the latest bar. -The Weighting factor of EMA(6)=EMA(6)/(X * current price + EMA(6)), We can try X=5 first,X=(1,10) +The Weighting factor of EMA(6)=EMA(6)/(X * current price + EMA(6)), We can try X=4.5 first,X=(1,10) ## Explanation: As the EMA(6)come from the latest finished 1 hour bar, and the current price come from the next hour which the 1 hour bar didn't finish, so the feed price was constituted by a fixed EMA(6)in 1 hour and a variable current price. From ea80f4c65caddef3ed96ac3fe81c9b878497c001 Mon Sep 17 00:00:00 2001 From: shulthz <34892308+shulthz@users.noreply.github.com> Date: Thu, 5 Mar 2020 16:24:32 +0800 Subject: [PATCH 08/11] Update baip-0004.md --- baip-0004.md | 95 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 59 insertions(+), 36 deletions(-) diff --git a/baip-0004.md b/baip-0004.md index 1b0567e..396f74f 100644 --- a/baip-0004.md +++ b/baip-0004.md @@ -27,59 +27,82 @@ Weighting factor * Current price will increase the nondeterminacy of feed price. # Rational -Follow the BSIP76 and BSIP58. +Follow BSIP58. # Specifications **FEED PRICE =max (Weighting factor * 1 hours period EMA(6) + Weighting factor * Current price,Current price)** +**Adjustment factor: X,X=(1,10). + +**The Weighting factor of EMA(6) = EMA(6)/(X * current price + EMA(6)), We can try X=4.5 first. + Current price : The real-time BTS price of CEX, and notice: we still have many feed provider give a most lower feed price of CEX. -1 hours period EMA(6): Get the latest bar data from CEX,then calculate out the EMA6. +1 hours period EMA(6): Get the latest bar data from CEX,then calculate out the latest EMA6. + + -Weighting factor: EMA(6) is the latest bar. -The Weighting factor of EMA(6)=EMA(6)/(X * current price + EMA(6)), We can try X=4.5 first,X=(1,10) ## Explanation: + As the EMA(6)come from the latest finished 1 hour bar, and the current price come from the next hour which the 1 hour bar didn't finish, so the feed price was constituted by a fixed EMA(6)in 1 hour and a variable current price. -If use proportion of weighting factor, the weighting factor of EMA(6)will be great when the price spread became great between EMA(6)and current price, the value of X will determine the upper limit, if the price spread became small, the weight of EMA(6) will become small followling. +If use proportion of weighting factor, the weighting factor of EMA(6)will be great when the price spread between EMA(6)and current price became great , the value of X will determine the upper limit, if the price spread between EMA(6)and current price became small, the weight of EMA(6) will become small followling. + +Adjustment factor X=4.5,data come from huobi 1 hour EMA6,2020/02/15 22:00 to 2020/02/17 03:00 -proportion of weight X=6,data come from huobi 1hour EMA6,2020/02/15 22:00 to 2020/02/17 03:00 +![2020-03-05 16_02_48-Window](https://user-images.githubusercontent.com/34892308/75960531-2a6fe580-5efb-11ea-880e-bcd7d82d7ab3.png) | EMA\(6\) | CEX PRICE | FEED PRICE | EMA WEIGHT | CEX weight | spread | FALL | |-----------|---------|----------|----------|----------|----------|----------| -| 0\.0389 | 0\.0366 | 0\.0369 | 0\.1505 | 0\.8495 | 0\.9457% | 6\.28% | -| 0\.0385 | 0\.0332 | 0\.0341 | 0\.1620 | 0\.8380 | 2\.5856% | 15\.96% | -| 0\.0373 | 0\.034 | 0\.0345 | 0\.1546 | 0\.8454 | 1\.5003% | 9\.71% | -| 0\.0364 | 0\.0332 | 0\.0337 | 0\.1545 | 0\.8455 | 1\.4891% | 9\.64% | -| 0\.0359 | 0\.0346 | 0\.0348 | 0\.1474 | 0\.8526 | 0\.5539% | 3\.76% | -| 0\.0357 | 0\.0345 | 0\.0347 | 0\.1471 | 0\.8529 | 0\.5116% | 3\.48% | -| 0\.0354 | 0\.0346 | 0\.0347 | 0\.1457 | 0\.8543 | 0\.3368% | 2\.31% | -| 0\.0353 | 0\.0348 | 0\.0349 | 0\.1446 | 0\.8554 | 0\.2078% | 1\.44% | -| 0\.0352 | 0\.0346 | 0\.0347 | 0\.1450 | 0\.8550 | 0\.2514% | 1\.73% | -| 0\.035 | 0\.034 | 0\.0341 | 0\.1464 | 0\.8536 | 0\.4307% | 2\.94% | -| 0\.035 | 0\.0349 | 0\.0349 | 0\.1432 | 0\.8568 | 0\.0410% | 0\.29% | -| 0\.0351 | 0\.0351 | 0\.0351 | 0\.1429 | 0\.8571 | 0\.0000% | 0\.00% | -| 0\.0355 | 0\.0361 | 0\.0361 | 0\.1408 | 0\.8592 | 0\.0000% | \-1\.66% | -| 0\.0357 | 0\.0361 | 0\.0361 | 0\.1415 | 0\.8585 | 0\.0000% | \-1\.11% | -| 0\.0359 | 0\.0355 | 0\.0356 | 0\.1442 | 0\.8558 | 0\.1625% | 1\.13% | -| 0\.0358 | 0\.0355 | 0\.0355 | 0\.1439 | 0\.8561 | 0\.1216% | 0\.85% | -| 0\.0357 | 0\.0354 | 0\.0354 | 0\.1439 | 0\.8561 | 0\.1219% | 0\.85% | -| 0\.0357 | 0\.0351 | 0\.0352 | 0\.1449 | 0\.8551 | 0\.2478% | 1\.71% | -| 0\.0356 | 0\.035 | 0\.0351 | 0\.1450 | 0\.8550 | 0\.2485% | 1\.71% | -| 0\.0354 | 0\.0336 | 0\.0339 | 0\.1494 | 0\.8506 | 0\.8002% | 5\.36% | -| 0\.035 | 0\.0333 | 0\.0336 | 0\.1491 | 0\.8509 | 0\.7610% | 5\.11% | -| 0\.0345 | 0\.0332 | 0\.0334 | 0\.1476 | 0\.8524 | 0\.5781% | 3\.92% | -| 0\.0342 | 0\.0324 | 0\.0327 | 0\.1496 | 0\.8504 | 0\.8311% | 5\.56% | -| 0\.034 | 0\.0326 | 0\.0328 | 0\.1481 | 0\.8519 | 0\.6359% | 4\.29% | -| 0\.0337 | 0\.032 | 0\.0323 | 0\.1493 | 0\.8507 | 0\.7932% | 5\.31% | -| 0\.0333 | 0\.0301 | 0\.0306 | 0\.1557 | 0\.8443 | 1\.6551% | 10\.63% | -| 0\.0328 | 0\.0303 | 0\.0307 | 0\.1528 | 0\.8472 | 1\.2611% | 8\.25% | -| 0\.0323 | 0\.0317 | 0\.0318 | 0\.1452 | 0\.8548 | 0\.2748% | 1\.89% | -| 0\.0322 | 0\.0305 | 0\.0308 | 0\.1496 | 0\.8504 | 0\.8340% | 5\.57% | -| 0\.0317 | 0\.0305 | 0\.0307 | 0\.1476 | 0\.8524 | 0\.5809% | 3\.93% | +| 0\.0389 | 0\.0366 | 0\.0370 | 0\.1911 | 0\.8089 | 1\.2007% | 6\.28% | +| 0\.0385 | 0\.0332 | 0\.0343 | 0\.2049 | 0\.7951 | 3\.2709% | 15\.96% | +| 0\.0373 | 0\.034 | 0\.0346 | 0\.1960 | 0\.8040 | 1\.9024% | 9\.71% | +| 0\.0364 | 0\.0332 | 0\.0338 | 0\.1959 | 0\.8041 | 1\.8883% | 9\.64% | +| 0\.0359 | 0\.0346 | 0\.0348 | 0\.1874 | 0\.8126 | 0\.7040% | 3\.76% | +| 0\.0357 | 0\.0345 | 0\.0347 | 0\.1870 | 0\.8130 | 0\.6503% | 3\.48% | +| 0\.0354 | 0\.0346 | 0\.0347 | 0\.1852 | 0\.8148 | 0\.4283% | 2\.31% | +| 0\.0353 | 0\.0348 | 0\.0349 | 0\.1839 | 0\.8161 | 0\.2643% | 1\.44% | +| 0\.0352 | 0\.0346 | 0\.0347 | 0\.1844 | 0\.8156 | 0\.3198% | 1\.73% | +| 0\.035 | 0\.034 | 0\.0342 | 0\.1862 | 0\.8138 | 0\.5476% | 2\.94% | +| 0\.035 | 0\.0349 | 0\.0349 | 0\.1822 | 0\.8178 | 0\.0522% | 0\.29% | +| 0\.0351 | 0\.0351 | 0\.0351 | 0\.1818 | 0\.8182 | 0\.0000% | 0\.00% | +| 0\.0355 | 0\.0361 | 0\.0361 | 0\.1793 | 0\.8207 | 0\.0000% | \-1\.66% | +| 0\.0357 | 0\.0361 | 0\.0361 | 0\.1802 | 0\.8198 | 0\.0000% | \-1\.11% | +| 0\.0359 | 0\.0355 | 0\.0356 | 0\.1835 | 0\.8165 | 0\.2068% | 1\.13% | +| 0\.0358 | 0\.0355 | 0\.0356 | 0\.1831 | 0\.8169 | 0\.1547% | 0\.85% | +| 0\.0357 | 0\.0354 | 0\.0355 | 0\.1831 | 0\.8169 | 0\.1551% | 0\.85% | +| 0\.0357 | 0\.0351 | 0\.0352 | 0\.1844 | 0\.8156 | 0\.3151% | 1\.71% | +| 0\.0356 | 0\.035 | 0\.0351 | 0\.1844 | 0\.8156 | 0\.3160% | 1\.71% | +| 0\.0354 | 0\.0336 | 0\.0339 | 0\.1897 | 0\.8103 | 1\.0163% | 5\.36% | +| 0\.035 | 0\.0333 | 0\.0336 | 0\.1893 | 0\.8107 | 0\.9666% | 5\.11% | +| 0\.0345 | 0\.0332 | 0\.0334 | 0\.1876 | 0\.8124 | 0\.7346% | 3\.92% | +| 0\.0342 | 0\.0324 | 0\.0327 | 0\.1900 | 0\.8100 | 1\.0556% | 5\.56% | +| 0\.034 | 0\.0326 | 0\.0329 | 0\.1882 | 0\.8118 | 0\.8080% | 4\.29% | +| 0\.0337 | 0\.032 | 0\.0323 | 0\.1896 | 0\.8104 | 1\.0075% | 5\.31% | +| 0\.0333 | 0\.0301 | 0\.0307 | 0\.1973 | 0\.8027 | 2\.0979% | 10\.63% | +| 0\.0328 | 0\.0303 | 0\.0308 | 0\.1939 | 0\.8061 | 1\.5999% | 8\.25% | +| 0\.0323 | 0\.0317 | 0\.0318 | 0\.1846 | 0\.8154 | 0\.3494% | 1\.89% | +| 0\.0322 | 0\.0305 | 0\.0308 | 0\.1900 | 0\.8100 | 1\.0592% | 5\.57% | +| 0\.0317 | 0\.0305 | 0\.0307 | 0\.1876 | 0\.8124 | 0\.7382% | 3\.93% | + + + + + +Adjustment factor X=4.5,data come from ZB,2020-02-26 08:00 到 2020-02-26 13:00 + +![2020-03-05 16_07_48-Window](https://user-images.githubusercontent.com/34892308/75960720-8470ab00-5efb-11ea-890f-780776092c1f.png) +| EMA\(6\) | CEX PRICE | FEED PRICE | EMA WEIGHT | CEX weight | spread | FALL | +|-----------|---------|----------|----------|----------|-----------|---------| +| 0\.2069 | 0\.185 | 0\.1894 | 0\.1991 | 0\.8009 | 2\.3564% | 11\.84% | +| 0\.2036 | 0\.1429 | 0\.1575 | 0\.2405 | 0\.7595 | 10\.2148% | 42\.48% | +| 0\.1961 | 0\.1725 | 0\.1773 | 0\.2017 | 0\.7983 | 2\.7592% | 13\.68% | +| 0\.1905 | 0\.175 | 0\.1780 | 0\.1948 | 0\.8052 | 1\.7252% | 8\.86% | +| 0\.1875 | 0\.1778 | 0\.1796 | 0\.1899 | 0\.8101 | 1\.0358% | 5\.46% | +| 0\.1863 | 0\.1815 | 0\.1824 | 0\.1857 | 0\.8143 | 0\.4912% | 2\.64% | # Coordination From 56ac55ef45e6429302db3acc280e0cfad788d516 Mon Sep 17 00:00:00 2001 From: shulthz <34892308+shulthz@users.noreply.github.com> Date: Thu, 5 Mar 2020 16:28:40 +0800 Subject: [PATCH 09/11] Update baip-0004.md --- baip-0004.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/baip-0004.md b/baip-0004.md index 396f74f..dacd528 100644 --- a/baip-0004.md +++ b/baip-0004.md @@ -33,9 +33,9 @@ Follow BSIP58. **FEED PRICE =max (Weighting factor * 1 hours period EMA(6) + Weighting factor * Current price,Current price)** -**Adjustment factor: X,X=(1,10). +**Adjustment factor: X,X=(1,10).** -**The Weighting factor of EMA(6) = EMA(6)/(X * current price + EMA(6)), We can try X=4.5 first. +**The Weighting factor of EMA(6) = EMA(6)/(X * current price + EMA(6)), We can try X=4.5 first.** Current price : The real-time BTS price of CEX, and notice: we still have many feed provider give a most lower feed price of CEX. From 0bbf1cfc0d258d84973a1a978c528212db10c506 Mon Sep 17 00:00:00 2001 From: shulthz <34892308+shulthz@users.noreply.github.com> Date: Sat, 20 Jun 2020 16:52:50 +0800 Subject: [PATCH 10/11] Update baip-0004.md --- baip-0004.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/baip-0004.md b/baip-0004.md index dacd528..673f304 100644 --- a/baip-0004.md +++ b/baip-0004.md @@ -8,24 +8,22 @@ Created: 2020-02-22 ``` # Abstract + Use 1 hours period EMA(6) to instead of BAIP2 # Motivation -BAIP2 track the real-time price too slowly, when the price has plummeted, there will have a big discount space for bitasset, it need two days to repair the price, this will crush the confidence of the holder of bitasset, harm the bitasset. - -EMA have a key point is more better than BAIP2: The EMA is a moving average that places a greater weight and significance on the most recent data points. -This FEED PRICE can track the real-time price more quickly, can avoid the lower shadow and repair price more faster(but still need one or two hours to repair). +BAIP2 tracks the CEX real-time price too slowly, when the CEX price began to move downward, there will appear a big price discount between DEX and CEX, and it needs two days to repair the bts price discount between DEX and CEX, this will crush the confidence of the bitasset and harm the reputation of bitasset very easily,and when the price become continuously falling,then the pirce discount will be very greater,this is very dangerous for the bitassets market. -The one hour will be cooling time. +# Rational -Shorting attack will need more time to make the price down. +EMA have a key point is more better than BAIP2: The EMA is a moving average that places a greater weight and significance on the most recent data points. -There still have a big discount space, so i think to add the Weighting factor * Current price to make the big discount space more smaller. +This new FEED PRICE mechanism can track the CEX real-time price very quickly, and can avoid the lower shadow of price,repair price between DEX and CEX more faster(but still need one or two hours to repair).This repairing price time will be a cooling time for the traders in the bitassets market,and can prevent many unnecessary margin called by the lower shadow of price. -Weighting factor * Current price will increase the nondeterminacy of feed price. +The debt Shorting attack will need more time to make the price fall. -# Rational +To avoid the big price discount between DEX and CEX on price quick falling, so add the **Weighting factor * Current price** to make the big price discount become more smaller,and **Weighting factor * Current price** will increase the nondeterminacy of feed price,this is very important for trading. Follow BSIP58. @@ -37,18 +35,22 @@ Follow BSIP58. **The Weighting factor of EMA(6) = EMA(6)/(X * current price + EMA(6)), We can try X=4.5 first.** -Current price : The real-time BTS price of CEX, and notice: we still have many feed provider give a most lower feed price of CEX. +Current price : The real-time BTS price of CEX; -1 hours period EMA(6): Get the latest bar data from CEX,then calculate out the latest EMA6. +1 hours period EMA(6): Get the latest pirce bar data from CEX,then calculate out the latest EMA6 price. ## Explanation: -As the EMA(6)come from the latest finished 1 hour bar, and the current price come from the next hour which the 1 hour bar didn't finish, so the feed price was constituted by a fixed EMA(6)in 1 hour and a variable current price. +As the EMA(6)pirce come from the latest finished 1 hour bar, and the current price come from the next hour which the 1 hour bar didn't finish, so the feed price was constituted by a latest finished 1 hour bar EMA(6)pirce and a variable current price. + +Using proportion of weighting factor, the weighting factor of EMA(6)will become great when the price spread became big between EMA(6)and current price,if the price spread became small between EMA(6)and current price,the weight of EMA(6) will become small followling. + +The value of X will determine the upper limit of weighting factor. -If use proportion of weighting factor, the weighting factor of EMA(6)will be great when the price spread between EMA(6)and current price became great , the value of X will determine the upper limit, if the price spread between EMA(6)and current price became small, the weight of EMA(6) will become small followling. +## Example: Adjustment factor X=4.5,data come from huobi 1 hour EMA6,2020/02/15 22:00 to 2020/02/17 03:00 From 1317672a6408911ddf8ce9a587fd6d71912cdafd Mon Sep 17 00:00:00 2001 From: shulthz <34892308+shulthz@users.noreply.github.com> Date: Sun, 21 Jun 2020 15:24:33 +0800 Subject: [PATCH 11/11] Update baip-0004.md --- baip-0004.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/baip-0004.md b/baip-0004.md index 673f304..9ed04f9 100644 --- a/baip-0004.md +++ b/baip-0004.md @@ -25,8 +25,6 @@ The debt Shorting attack will need more time to make the price fall. To avoid the big price discount between DEX and CEX on price quick falling, so add the **Weighting factor * Current price** to make the big price discount become more smaller,and **Weighting factor * Current price** will increase the nondeterminacy of feed price,this is very important for trading. -Follow BSIP58. - # Specifications **FEED PRICE =max (Weighting factor * 1 hours period EMA(6) + Weighting factor * Current price,Current price)**