Post
Topic
Board Announcements (Altcoins)
Re: [ANN][LISK] Lisk | ICO | Decentralized Application & Sidechain Platform
by
thandie
on 05/03/2016, 23:50:01 UTC
- snip -

I agree. I think it's only "good" for all the people who asking every 10 posts, what the current price is. Maybe It's possible to add "some math" into the script, so it will show nearly the same as your sheet?

Two changes would go a long way (1) use a constant 13 BTC per 1M XCR as the conversion factor instead of the current market price for Crypti;  (2) applying a 15% escalation factor for the first 1350 BTC collected, and 10% escalation factor on BTC collected thereafter.  This mod could be changed to 5% in the third week and 0% in the last week.

Nuno, Max - you OK with such mods?

Code updated to include first week bonus and XCR fixed priced.

Also grabbing amounts from exchange.json now.

1 Lisk = 3308 satoshi Smiley

Source code
Code:
//GET AMOUNTS FROM EXCHANGE.JSON
$liskJSON json_decode(file_get_contents("https://ico.lisk.io/exchanges.json"), true);

//GET BITCOIN PRICE
$priceBTC json_decode(file_get_contents("http://coinmarketcap-nexuist.rhcloud.com/api/btc/price"), true)["usd"];

//SETUP PRICE VARS
$bitcoinICO 0;

//GRAB AMOUNTS FROM ICO.LISK.IO
$bitcoinICO $liskJSON["bitcoin"]+$liskJSON["shapeshift"];
$cryptiICO $liskJSON["crypti"];

//CONVERT CRYPTI AMOUNT TO BTC
$bitcoinICO+=($cryptiICO*13)/1000000;

//GET REMAINING BTC
$remainingBTC $bitcoinICO-1350;

//FIRST WEEK = 1350+15%
$firstWeekBTC 1552.5;

//PUT IT ALL TOGHETER
$bitcoinICO $firstWeekBTC+($remainingBTC*1.1);

//CALCULATE LISK PRICE AND CONVERT TO SATOSHI
$liskPriceBTC = ($bitcoinICO/85000000);
$liskPriceBTCRound round($liskPriceBTC*100000000);

//CONVERT LISK PRICE TO USD AND FORMAT TO 5 DECIMAL PLACES
$liskPriceUSD number_format((float)($liskPriceBTC*$priceBTC), 5'.''');

header("Content-Type: image/png");
//OPEN LISK LOGO
$im imageCreateFromPng("/var/www/html/lisk/lisk.png");
//DEAL WITH OPACITY
imageAlphaBlending($imtrue);
imageSaveAlpha($imtrue);

//SETUP TEXT COLOR
$text_color imagecolorallocate($im000);

//ADD TEXT TO LISK LOGO
imagestring($im312095,  "1 Lisk = " $liskPriceBTCRound " Satoshi"$text_color);
imagestring($im3120110,  "1 Lisk = " $liskPriceUSD " USD"$text_color);

//SAVE IMAGE
imagepng($im"/var/www/html/lisk/lisk_price.png");

//CLEAN BUFFER
imagedestroy($im);

?>

Ahhh... that's interesting.