Index Details

APX V2 MADBTCUSD Index Details

How does it work?

drift=(btcCurrentPricebtcLastSecondPriceβˆ’1οΌ‰βˆ—3drift = (\frac{\mathrm{btcCurrentPrice}}{\mathrm{btcLastSecondPrice}} - 1οΌ‰*3
Οƒ=expectedvol3600βˆ—24βˆ—365\sigma = \frac{expected vol}{\sqrt{3600*24*365}}
norm=norminv(Random,0,1) norm = \text{norminv}\left(Random, 0, 1\right)
Sn+1=Snβˆ—e[(driftβˆ’Οƒ22)βˆ—dt+Οƒβˆ—dtβˆ—norm]S_{n+1} =S_{n} * e^{\left[\left({drift} - \frac{\sigma^2}{2}\right) * dt + \sigma * \sqrt{dt} * norm\right]}

where:

  • Initial Sn=1000

  • dt=1

  • expected vol:100%(expected vol is the expected time volatility of the MADBTC)

  • the "Random number" is calculated based on the current BTC price with 8 decimal places of precision

Calculative process of random number:

import hashlib
from decimal import Decimal

# Assume the current price of Bitcoin is 48923.56789101
bitcoin_price = Decimal("48923.56789101")

# Calculate the SHA-256 hash of the Bitcoin price
price_hash = hashlib.sha256(str(bitcoin_price).encode('utf-8')).hexdigest()

# Extract the first 8 hexadecimal numbers from the hash
hash_substring = price_hash[:8]

# Converts a hexadecimal string to an integer
hash_integer = int(hash_substring, 16)

# Divide the integer by 4294967296 (the decimal number corresponding to the hexadecimal number FFFFFFFF) to get a number between 0 and 1,
random_number = hash_integer / 4294967296
# Print the random number
print(random_number)

If the random number is counted as 0, MADBTC price will stay the same

Data interface in second (Returns the most recent 1800 data):

Historical backtest data of BTC & MADBTC:

Last updated