Data retrieval: the latest prices of the major exchanges are retrieved through API every 10 seconds.
Exchange |
Weight |
BitForex |
20% |
Bitfinex |
20% |
OKEX |
20% |
Binance |
20% |
Huobi |
20% |
How do we handle abnormal situations:
1. The price of a single exchange deviates greatly from other exchanges
When the price of a certain exchange deviates more than ±10% from the median price of other exchanges, such exchange's price will be calculated as ±10% of the median price of other exchanges:
Example 1: Let's say the BTC price of Bitfinex is USD560, and the prices of other exchanges are 500, 501, 502, 503, 504 (USD).
The median price of other exchanges is (502 + 503) /2 = 502.5, so the price of Bitfinex deviates from others by (560-502.5)/502.5=11.44%, which is more than 10%.
Instead of USD560, system will take 502.5*(1+10%)=552.75 instead as Bitfinex's price.
Therefore, the final index will be (552.75+500+501+502+503+504)/6=USD510.46
When the price of a certain exchange deviates more than ±10% from the median price of other exchanges, and only data of two exchanges can be retrieved, such exchange's price will be calculated as ±10% of the average price of the two exchanges:
Example 2: Let's say the BTC price of Bitfinex is USD560. If data of three of the exchanges cannot be retrieved and the prices of other two exchanges are 503 and 504 (USD).
The average of the two exchanges is (503 + 504) /2=503.5USDT. (560-503.5）/503.5=11.2%>10%.
Instead of USD560, system will take 503.5*(1+10%)=553.85 instead as Bitfinex's price.
Therefore, the final index will be (553.85+503+504)/3=USD520.28
2. Data lost or large price deviation of a single exchange
2.1 If the valid data available from a single exchange in the last 24 hours is lower than 10%
Solution: We will remove the exchange's price from the computation until the valid data available in 24 hours is larger than 90%.
2.2 If the valid data available from a single exchange in the last 24 hours is larger than 10%, but it is not retrievable for a certain period (due to exchange closed, market suspended, attacked or other reasons).
Solution: We will take the latest valid price retrieved into computation and adopt the same rule mentioned in situation (1).
Comments
0 comments
Please sign in to leave a comment.