-- Added shortcuts for rooms when a room is already open -- added current data for bitcoin bonds and bob's fund
345 lines
23 KiB
HTML
345 lines
23 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Bitcoin Bonds</title>
|
|
<link rel="shortcut icon" href="assets/RM logo.png" type="image/png">
|
|
<link rel="stylesheet" href="css/main.min.css">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com">
|
|
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400..900&display=swap" rel="stylesheet">
|
|
</head>
|
|
|
|
<body>
|
|
<sm-notifications id="notification_drawer"></sm-notifications>
|
|
|
|
<section id="elevator_popup" class="grid hide-completely">
|
|
<header class="elevator__header">
|
|
<button class="close-button justify-self-start" onclick="hideSiteMap()">
|
|
<svg class="icon icon-only close-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24"
|
|
height="24">
|
|
<path fill="none" d="M0 0h24v24H0z" />
|
|
<path
|
|
d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z" />
|
|
</svg>
|
|
</button>
|
|
</header>
|
|
<ul id="floor_list" class="grid"></ul>
|
|
</section>
|
|
<header id="main_header" class="grid align-center full-bleed">
|
|
<button id="elevator_button" class="button" onclick="showSiteMap()">
|
|
<svg class="icon button__icon--left" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 3L16.3301 10.5H7.66987L12 3Z"/><path d="M12 21L7.66987 13.5L16.3301 13.5L12 21Z"/></svg>
|
|
<span class="button__label">
|
|
Elevator
|
|
</span>
|
|
</button>
|
|
<a href="index.html" class="main-logo flex align-center page-link justify-self-center" data-target="home_page">
|
|
<svg id="main_header__logo" class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.46,21.32C20,19.78,18.6,18.59,15.3,17a12.67,12.67,0,0,1-2.64-1.56,4.27,4.27,0,0,1-.79-1,2.6,2.6,0,0,1,0-1.41c.24-.68.49-1,2.43-2.85a7.18,7.18,0,0,0,2.09-2.92,4.25,4.25,0,0,0,0-1.77,6.52,6.52,0,0,0-2.85-3.11c-.56-.36-.81-.4-.81-.15a2.33,2.33,0,0,1-.18.45L12.4,3l-.53-.36c-.28-.21-.64-.41-.77-.49s-.46-.11-.46,0a6.21,6.21,0,0,1-.37.83s-.08,0-.17-.08c-1.15-.83-1.64-1-1.64-.73A7.33,7.33,0,0,1,7.7,3.65C6.48,5.68,5.24,6.7,4,6.7c-.56,0-.54,0-.37.64s.2.58.68.43a3.37,3.37,0,0,0,1.09-.54.86.86,0,0,1,.3-.17,1.34,1.34,0,0,1,.13.39.79.79,0,0,0,.17.4A3.5,3.5,0,0,0,7.37,7.3L7.8,7l.09.34c.12.45.19.51.62.39a4.25,4.25,0,0,0,2.17-1.54l.38-.45,0,.39A5.92,5.92,0,0,1,8.89,9.54L7.67,10.71c-2,1.93-1.89,3.51.37,5a27.41,27.41,0,0,0,2.89,1.51c.17.07.62.32,1,.54C14,19,15,20.23,15,21.48a2,2,0,0,0,0,.49h0c0,.05,0,.05.56-.1a1.89,1.89,0,0,0,.53-.21,2.41,2.41,0,0,0-.34-1.15,7.05,7.05,0,0,0-1.68-1.77,21.91,21.91,0,0,0-3.2-1.83A9.53,9.53,0,0,1,8.16,15.2a2.18,2.18,0,0,1-.74-1.55C7.42,12.79,7.86,12,9,11c1.77-1.64,2.45-2.45,2.92-3.55a2.28,2.28,0,0,0,.26-1.26A2,2,0,0,0,12,5.06l-.2-.45L12,4.3l.28-.49.09-.18L12.6,4a3.69,3.69,0,0,1,.61,1.76A3.47,3.47,0,0,1,12.94,7l-.09.25s-.21.37-.41.69A17.78,17.78,0,0,1,9.91,10.6c-1.07,1-1.43,1.62-1.47,2.47a2.05,2.05,0,0,0,.7,1.73,10.47,10.47,0,0,0,3.28,2.08c2.28,1.13,3.26,1.81,4,2.73a2.94,2.94,0,0,1,.74,1.75,1.26,1.26,0,0,0,.09.57.48.48,0,0,0,.26,0l.51-.13.29-.08,0-.28c-.13-1-1-2-2.47-3a25.52,25.52,0,0,0-3.26-1.77,8.59,8.59,0,0,1-2.23-1.43,2.09,2.09,0,0,1-.5-2.62c.26-.53.5-.83,2.35-2.6,1.51-1.45,2.15-2.58,2.15-3.79A3.67,3.67,0,0,0,13,3.48a3,3,0,0,1-.4-.42A1.85,1.85,0,0,1,13,2.33a6.74,6.74,0,0,1,1.83,1.73,2.62,2.62,0,0,1,.47,1.68,3,3,0,0,1-.55,1.84c-.45.78-.79,1.14-2.67,2.93a5.56,5.56,0,0,0-1.3,1.64,1.77,1.77,0,0,0-.21,1,1.76,1.76,0,0,0,.19.92,6.28,6.28,0,0,0,2.9,2.34,21.6,21.6,0,0,1,3.66,2c1.35,1,2,2,2,3a1.06,1.06,0,0,0,.05.47,2.83,2.83,0,0,0,1-.24C20.56,21.68,20.56,21.66,20.46,21.32ZM7.29,6.4h0a2.23,2.23,0,0,1-.9.28L6,6.72l.43-.53a15.22,15.22,0,0,0,1.89-3,3.52,3.52,0,0,1,.38-.67c.07-.08.49.2,1,.64l.39.35L9.66,4A6.7,6.7,0,0,1,7.29,6.4Zm3.58-1.11A5.8,5.8,0,0,1,9.25,6.51h0a3.3,3.3,0,0,1-.74.17l-.35,0,.39-.49a15.64,15.64,0,0,0,1.32-2,4.63,4.63,0,0,1,.28-.49c.06-.08.33.26.57.77l.28.57Zm1-1.4a1.63,1.63,0,0,1-.28.4A6.63,6.63,0,0,1,11,3.72l-.53-.56.12-.29c.2-.49.24-.51.64-.19a5.57,5.57,0,0,1,.85.78A2.78,2.78,0,0,1,11.87,3.89Z"/></svg>
|
|
<h4 class="h4 header__company-name">RanchiMall</h4>
|
|
</a>
|
|
<label class="theme-switcher" title="Change theme">
|
|
<input id="theme_switcher" class="theme-switcher__checkbox" type="checkbox">
|
|
<svg class="icon moon-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 6a8 8 0 0 0 11.955 6.956C21.474 18.03 17.2 22 12 22 6.477 22 2 17.523 2 12c0-5.2 3.97-9.474 9.044-9.955A7.963 7.963 0 0 0 10 6zm-6 6a8 8 0 0 0 8 8 8.006 8.006 0 0 0 6.957-4.045c-.316.03-.636.045-.957.045-5.523 0-10-4.477-10-10 0-.321.015-.64.045-.957A8.006 8.006 0 0 0 4 12zm14.164-9.709L19 2.5v1l-.836.209a2 2 0 0 0-1.455 1.455L16.5 6h-1l-.209-.836a2 2 0 0 0-1.455-1.455L13 3.5v-1l.836-.209A2 2 0 0 0 15.29.836L15.5 0h1l.209.836a2 2 0 0 0 1.455 1.455zm5 5L24 7.5v1l-.836.209a2 2 0 0 0-1.455 1.455L21.5 11h-1l-.209-.836a2 2 0 0 0-1.455-1.455L18 8.5v-1l.836-.209a2 2 0 0 0 1.455-1.455L20.5 5h1l.209.836a2 2 0 0 0 1.455 1.455z"/></svg>
|
|
<svg class="icon sun-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></svg>
|
|
</label>
|
|
</header>
|
|
<div id="outlet_switcher" class="grid gap-1-5 hide">
|
|
<div class="flex align-center">
|
|
<svg class="icon button__icon--left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24"
|
|
height="24">
|
|
<path fill="none" d="M0 0h24v24H0z" />
|
|
<path
|
|
d="M21 13.242V20h1v2H2v-2h1v-6.758A4.496 4.496 0 0 1 1 9.5c0-.827.224-1.624.633-2.303L4.345 2.5a1 1 0 0 1 .866-.5H18.79a1 1 0 0 1 .866.5l2.702 4.682A4.496 4.496 0 0 1 21 13.242zm-2 .73a4.496 4.496 0 0 1-3.75-1.36A4.496 4.496 0 0 1 12 14.001a4.496 4.496 0 0 1-3.25-1.387A4.496 4.496 0 0 1 5 13.973V20h14v-6.027zM5.789 4L3.356 8.213a2.5 2.5 0 0 0 4.466 2.216c.335-.837 1.52-.837 1.856 0a2.5 2.5 0 0 0 4.644 0c.335-.837 1.52-.837 1.856 0a2.5 2.5 0 1 0 4.457-2.232L18.21 4H5.79z" />
|
|
</svg>
|
|
<span id="outlet_switcher__floor_num" class="weight-500 color-0-8"></span>
|
|
<button class="justify-right" onclick="hideOutletSwitcher()">
|
|
<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
|
<path fill="none" d="M0 0h24v24H0z" />
|
|
<path
|
|
d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-11.414L9.172 7.757 7.757 9.172 10.586 12l-2.829 2.828 1.415 1.415L12 13.414l2.828 2.829 1.415-1.415L13.414 12l2.829-2.828-1.415-1.415L12 10.586z" />
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
<section id="outlet_switcher__outlet_container" class="outlet_switcher__floor flex align-center"></section>
|
|
</div>
|
|
<main class="page">
|
|
<section class="outlet-hero-section margin-bottom-3r">
|
|
<button class="outlet-label">
|
|
<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
|
<path fill="none" d="M0 0h24v24H0z" />
|
|
<path
|
|
d="M21 13.242V20h1v2H2v-2h1v-6.758A4.496 4.496 0 0 1 1 9.5c0-.827.224-1.624.633-2.303L4.345 2.5a1 1 0 0 1 .866-.5H18.79a1 1 0 0 1 .866.5l2.702 4.682A4.496 4.496 0 0 1 21 13.242zm-2 .73a4.496 4.496 0 0 1-3.75-1.36A4.496 4.496 0 0 1 12 14.001a4.496 4.496 0 0 1-3.25-1.387A4.496 4.496 0 0 1 5 13.973V20h14v-6.027zM5.789 4L3.356 8.213a2.5 2.5 0 0 0 4.466 2.216c.335-.837 1.52-.837 1.856 0a2.5 2.5 0 0 0 4.644 0c.335-.837 1.52-.837 1.856 0a2.5 2.5 0 1 0 4.457-2.232L18.21 4H5.79z" />
|
|
</svg>
|
|
<span class="outlet-label__name">Outlet</span>
|
|
<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
|
<path fill="none" d="M0 0h24v24H0z" />
|
|
<path d="M12 13.172l4.95-4.95 1.414 1.414L12 16 5.636 9.636 7.05 8.222z" />
|
|
</svg>
|
|
</button>
|
|
<h2 class="h2 weight-700 margin-bottom-1r">Bitcoin Bonds</h2>
|
|
<p class="margin-bottom-1-5r">
|
|
<!-- What is a Bitcoin Bond? -->
|
|
A Bitcoin Bond is an investment package whereby the investor <Rohit sir has to complete this sentence>
|
|
|
|
</p>
|
|
<h4>How does it work?</h4>
|
|
<p class="margin-bottom-3r">
|
|
Bondholders get a minimum guarantee of 13% interest per annum during the lock-in period or 50% of all Bitcoin price gains whichever is higher.
|
|
It offers full capital protection if Bitcoin prices fall below acquisition price.
|
|
</p>
|
|
</section>
|
|
<header class="rooms__header">
|
|
<h4 class="room__label">Rooms</h4>
|
|
</header>
|
|
<section class="rooms-layout">
|
|
<div id="expanding_tile" class="hide-completely"></div>
|
|
<a class="room-tile room-tile--main" href="#performance_room">
|
|
<div class="tile-content">
|
|
<h4 class="room-tile__title">Performance</h4>
|
|
</div>
|
|
</a>
|
|
<a class="room-tile" href="#product_room">
|
|
<div class="tile-content">
|
|
<h4 class="room-tile__title">Product</h4>
|
|
</div>
|
|
</a>
|
|
<a class="room-tile" href="#purchase_room">
|
|
<div class="tile-content">
|
|
<h4 class="room-tile__title">Purchase</h4>
|
|
</div>
|
|
</a>
|
|
</section>
|
|
<section class="room-container hide-completely page-layout">
|
|
<header class="room-container__header">
|
|
<button class="grid flow-column gap-1 align-center" onclick="hideRoom()">
|
|
<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M7.828 11H20v2H7.828l5.364 5.364-1.414 1.414L4 12l7.778-7.778 1.414 1.414z"/></svg>
|
|
<h3 class="room-title"></h3>
|
|
</button>
|
|
</header>
|
|
<section id="performance_room" class="grid room">
|
|
<div id="bit_bond_series__container" class="grid series-container"></div>
|
|
</section>
|
|
<section id="product_room" class="grid room">
|
|
<h4 class="h4 margin-bottom-1r">Description of different bonds</h4>
|
|
<ol type="1" class="margin-bottom-3r">
|
|
<li>
|
|
<p>
|
|
Bitcoin Bonds is a Bitcoin price linked product of RanchiMall in which the customer will never
|
|
see value of his asset go down even if the prices of Bitcoin falls. Its been targeted to first time
|
|
Bitcoin enthusiasts who are afraid of losing money with Bitcoins. RanchiMall absorbs all the potential
|
|
losses of the customer. It also guarantees the customer a minimum rate of annual appreciation. If the
|
|
price of Bitcoin appreciates, the customer is entitled to 50% of all the gains.
|
|
</p>
|
|
</li>
|
|
<li>
|
|
<p>
|
|
RanchiMall has released two types of Bitcoin Bonds as per the price of Bitcoin as on issue date. In the
|
|
first type, the customer is guaranteed first 12% per gains per annum for 3 years, and 50% of all gains
|
|
there after. Customer must hold the bond for 3 years since bond issue date. In second type, the
|
|
customer is guaranteed 13% per annum for 5 years, and the customer is entitled to 50% of all gains.
|
|
Customer must hold the bond for at least 3 years since date of issue.
|
|
</p>
|
|
</li>
|
|
<li>
|
|
<p>
|
|
Example of Type 1 Bitcoin Bond is Bitcoin Bonds USD 975 Series issued on 2nd February 2017.
|
|
Customer funds are invested at Bitcoin prices of 975 USD as on 2nd February 2017. If the prices of
|
|
Bitcoins fall below 975 USD, the customer bond value will continue to be 975 USD, and will get an
|
|
increment of 12% per annum. If the prices of Bitcoin go beyond 975 USD, the customer will getat
|
|
least 12% per annum, and 50% of all price gains beyond it. The customer must hold thebond for 3
|
|
years.
|
|
</p>
|
|
</li>
|
|
<li>
|
|
<p>
|
|
Example of Type 2 Bitcoin Bond is Bitcoin Bonds USD 1205 Series issued on 2nd March 2017.
|
|
Customer funds are invested at Bitcoin prices of 1205 USD as on 2nd March 2017. If the prices of
|
|
Bitcoins fall below 1205 USD, the customer bond value will continue to be 1205 USD will full loss
|
|
protection, and will get an increment of 13% per annum for 5 years on top. If the price gains is more
|
|
than 13% in any year for first 5 years, the customer will be entitled to 50% of the gains. The customer
|
|
must hold the bond for 3 years.
|
|
</p>
|
|
</li>
|
|
<li>
|
|
<p>
|
|
Bond 1 Bondholders entitlement for Bitcoin Bonds ($975, $1057 and $1064 series) - Bondholders have a
|
|
3 year lock-in period. In the lockin period they are guaranteed 12 percent per annum. If the price
|
|
appreciates more than 12 percent, they will be paid 50 percent of additional return over and above
|
|
12 percent. After 3 years, bondholders can cash out anytime they like. Bond 2 Bondholder entitlement
|
|
($1205 series)Bondholders are entitled to 50% of Bitcoin and Bitcoin Cash price gains at all times with
|
|
a minimum guarantee of 13 percent per annum for 5 years from date of issue. There is a 3 year lockin
|
|
period. After 3 years, bondholders can cash out anytime they like.
|
|
</p>
|
|
</li>
|
|
<li>
|
|
<p>
|
|
Bond 3 Bondholders Entitlement ($1285 series) - Bondholders are entitled to 50% of Bitcoinand Bitcoin
|
|
Cash price gains at all times with a minimum guarantee of 13 percent per annum for 5 years from
|
|
date of issue. There is a 3 year lockin period. After 3 years, bondholders can cash out anytime they
|
|
like.Bond 4Bondholder Entitlement ($2513 series)Bondholders are entitled to 50% of Bitcoin and
|
|
Bitcoin Cash price gains at all times with a minimum guarantee of 13 percent per annum for 5 years
|
|
from date of issue. There is a 3 year lockin period. After 3 years, bondholders can cash out anytime
|
|
they like.
|
|
</p>
|
|
</li>
|
|
</ol>
|
|
<h4 class="h4 margin-bottom-1r">Risk Management</h4>
|
|
<p class="margin-bottom-3r">
|
|
This is a high risk product for RanchiMall. We guarantee protection from losses
|
|
and a minimum rate of return.To control our risks, we limit the total aggregate amount of guarantee
|
|
we give to a comfortable level. We also limit maximum amount of Bitcoin Bonds aperson can buy so
|
|
that we do not have sudden redemption pressure.RanchiMall needs to have long term confidence
|
|
in asset price growth, which we do have for Bitcoin scurrently. We cannot offer these guarantees on
|
|
any other crypto or non-crypto asset other than Bitcoin as we cannot make definite predictions on
|
|
their long term prices.The maximum amount of aggregate guarantee amount for this product should
|
|
be lower than 20 percent of RanchiMall assets to protect against catastrophic Bitcoin price fall.
|
|
</p>
|
|
<h4 class="h4 margin-bottom-1r">Founder Notes</h4>
|
|
<ol type="1">
|
|
<li>
|
|
<p>
|
|
RanchiMall Bitcoin Bonds was the first product that met our 2 fundamental criteria that we have for
|
|
RanchiMall products. First every product must beinnovative and absolutely new. Secondly it should
|
|
be created, marketedand delivered purely on Internet withoutany physical elements.
|
|
</p>
|
|
</li>
|
|
<li>
|
|
<p>
|
|
This product also reflects our philosophy that we should have impactful products,fewer number of customers, and very deep relationship with those customers.
|
|
</p>
|
|
</li>
|
|
<li>
|
|
<p>
|
|
This product is a compounding product which means both our customers and us will see higher returns as wheels of time move forward.
|
|
</p>
|
|
</li>
|
|
<li>
|
|
<p>
|
|
Since RanchiMall gets roughly 50 percent of price gains and our costs of operations are very low on
|
|
this product, RanchiMall Bitcoin Bonds has helped RanchiMall to become self sufficient without
|
|
needing large capital investment. Doing good risk management is a very important dimension here.
|
|
And that will be our challenge in the continued offerings of this product.
|
|
</p>
|
|
</li>
|
|
</ol>
|
|
</section>
|
|
<section id="purchase_room" class="grid room">
|
|
<p>
|
|
The purchase of this product is open only during specified time when we are confident we can
|
|
give guarantees. It was last open from February 2017 to June 2017.Currently we are doing blockchain
|
|
version of the product in test mode.If you are interested, please generate your FLO ID while keeping
|
|
your private key very safe.FLO ID can be generated <a href="https://ranchimall.github.io/flo-webwallet/">here</a> in a single click.We can message
|
|
directly on that FLO ID. Please drop your name and phone number along with FLO ID.
|
|
</p>
|
|
</section>
|
|
<footer class="room-container__footer">
|
|
<h4>Related rooms</h4>
|
|
<div id="room_switcher"></div>
|
|
</footer>
|
|
</section>
|
|
</main>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.6.1/gsap.min.js"></script>
|
|
<script src="js/components.js"></script>
|
|
<script src="js/index.js"></script>
|
|
<script>
|
|
const bitBondSerieses = [
|
|
{
|
|
series: 975,
|
|
startDate: 1485993600000
|
|
},
|
|
{
|
|
series: 1057,
|
|
startDate: 1486425600000
|
|
},
|
|
{
|
|
series: 1064,
|
|
startDate: 1487289600000
|
|
},
|
|
{
|
|
series: 1205,
|
|
startDate: 1488412800000
|
|
},
|
|
{
|
|
series: 1285,
|
|
startDate: 1488585600000
|
|
},
|
|
{
|
|
series: 2513,
|
|
startDate: 1496880000000
|
|
}
|
|
]
|
|
|
|
function getCurrentRates() {
|
|
let fetchData = api => new Promise((resolve, reject) => {
|
|
fetch(api).then(response => {
|
|
if (response.ok)
|
|
response.json().then(data => resolve(data))
|
|
else
|
|
reject(response)
|
|
}).catch(error => reject(error))
|
|
})
|
|
return new Promise((resolve, reject) => {
|
|
fetchData(`https://bitpay.com/api/rates`).then(result => {
|
|
let BTC_USD, BTC_INR, USD_INR
|
|
for (let i of result)
|
|
i.code == "USD" ? BTC_USD = i.rate : i.code == "INR" ? BTC_INR = i.rate : null;
|
|
USD_INR = BTC_INR / BTC_USD;
|
|
resolve({
|
|
BTC_USD,
|
|
BTC_INR,
|
|
USD_INR
|
|
})
|
|
}).catch(error => reject(error))
|
|
})
|
|
}
|
|
let USD_current, BTC_current
|
|
|
|
getCurrentRates().then(async (rates) => {
|
|
USD_current = rates.USD_INR;
|
|
BTC_current = rates.BTC_USD;
|
|
renderAllSeries()
|
|
}).catch(error => console.error(error))
|
|
|
|
function yrDiff(d1 = null, d2 = null) {
|
|
d1 = d1 ? new Date(d1) : new Date();
|
|
d2 = d2 ? new Date(d2) : new Date();
|
|
let tmp = Math.abs(d2 - d1)
|
|
tmp = Math.floor(tmp / (1000 * 60 * 60 * 24)); // find number of days
|
|
tmp = tmp / 365
|
|
//need to implement leap yr
|
|
return tmp
|
|
}
|
|
|
|
function calcNetValue(BTC_base, startDate, minIpa, maxPeriod, cut, amount, USD_base) {
|
|
console.log(BTC_base, startDate, minIpa, maxPeriod, cut, amount, USD_base)
|
|
let gain, interest, net;
|
|
gain = (BTC_current - BTC_base) / BTC_base;
|
|
interest = Math.max(cut * gain, minIpa * Math.min(yrDiff(startDate), maxPeriod));
|
|
net = amount / USD_base;
|
|
net += net * interest;
|
|
const percentGain = (((net * USD_current) - amount) / amount) * 100
|
|
//console.info(gain, interest, net)
|
|
return [net * USD_current, percentGain];
|
|
}
|
|
|
|
function renderAllSeries(){
|
|
const frag = document.createDocumentFragment()
|
|
getRef('bit_bond_series__container').innerHTML = ''
|
|
bitBondSerieses.forEach((series, index) => {
|
|
const [currentValue, percentGain] = calcNetValue(series.series, series.startDate, 0.13, 5, 0.5, 6400, 64)
|
|
const obj = {
|
|
series: series.series,
|
|
percentGain,
|
|
timeElapsed: new Date().getFullYear() - new Date(series.startDate).getFullYear(),
|
|
currentValue,
|
|
percentGain: percentGain.toFixed(0)
|
|
}
|
|
frag.append(render.bitBondRow(obj))
|
|
})
|
|
getRef('bit_bond_series__container').append(frag)
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |