This repository was archived by the owner on Feb 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 84
This repository was archived by the owner on Feb 17, 2022. It is now read-only.
Price graph #2
Copy link
Copy link
Closed
Description
Here is Python Jupyter notebook I used to plot the crowdsale 1ST:ETH price to verify it matches given terms and conditions by emulating price() function in Python:
Note that there is slight duration in the end block numbers, as hour exact dates.
It matches what you claim here https://firstblood.io/sale/index.html#
Code:
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
blocks_per_second = 12/60
startBlock = 1000
endBlock = startBlock + 24*3600*30 * blocks_per_second # 30 days, 12/60 blocks per
print(endBlock, int(endBlock))
endBlock = int(endBlock)
def price(block_number):
if (block_number>=startBlock and block_number<startBlock+250):
return 170 #power hour
if (block_number<startBlock or block_number>endBlock):
return 100 #default price
return 100 + 4*(endBlock - block_number)//(endBlock - startBlock + 1)*67//4 #crowdsale price
print("Start block {}, end block {}".format(startBlock, endBlock))
# Step one day at a time
x = range(startBlock - 10000, endBlock + 10000, 249)
y = []
for xx in x:
p = price(xx)
assert type(p) == int
y.append(p)
if xx % 100 == 0:
minutes = (xx-startBlock*60/12)
print("Price at {} ({} minutes) is {} ETH".format(xx, minutes, p))
line, = plt.plot(x, y, "--", linewidth=2)
plt.ylim(0,200)
plt.show()
Metadata
Metadata
Assignees
Labels
No labels
