forked from anthonygraignic/ethereum-mining-calculator
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
400 lines (377 loc) · 16.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
<!DOCTYPE html>
<html lang="en">
<head>
<title>Mining Calculator</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"/>
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Roboto:400,500,700,400italic'>
<!-- build:css({.tmp/serve,src}) styles/vendor.css -->
<!-- bower:css -->
<!-- run `gulp inject` to automatically populate bower styles dependencies -->
<!-- endbower -->
<!-- endbuild -->
<!-- build:css({.tmp/serve,src}) styles/app.css -->
<!-- inject:css -->
<!-- css files will be automatically insert here -->
<!-- endinject -->
<!-- endbuild -->
</head>
<body ng-app="calculatorApp" layout="column" ng-controller="HomeCtrl as home"
data-ng-init="init()">
<!--[if lt IE 10]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade
your browser</a> to improve your experience.</p>
<![endif]-->
<!--Header-->
<md-toolbar layout="row" layout-sm="column" class="md-whiteframe-z1"
layout-align="center center">
<div flex layout-fill>
<h1>Mining Calculator</h1>
</div>
<div flex layout="row" layout-align="end center">
<md-select ng-model="currency" aria-label="Local Currency">
<md-option ng-repeat="cur in currencies" aria-label="{{cur.name}}"
value="{{cur.sym}}">{{cur.name}} ({{cur.sym}})</md-option>
</md-select>
<md-button href="https://github.com/findkiko/ethereum-mining-calculator"
class="md-icon-button"
aria-label="About">
<md-icon md-svg-icon="help"></md-icon>
</md-button>
</div>
</md-toolbar>
<!--Main-->
<div layout="column" tabIndex="-1" role="main" class="md-whiteframe-z2">
<form name="calculatorForm">
<md-content id="content">
<md-card>
<md-card-content>
<md-subheader>Load Scenario</md-subheader>
<!-- Scenario choice-->
<md-input-container flex>
<md-select placeholder="Load a Scenario" ng-model="user.scenario"
md-on-open="loadScenarios()"
ng-change="selectScenario()">
<md-optgroup label="Example Scenarios">
<md-option ng-value="scenario"
ng-repeat="scenario in scenarios | filter: {type: 'vendor' }">
{{scenario.title}}
</md-option>
</md-optgroup>
<md-optgroup label="Saved Scenarios">
<md-option ng-value="scenario"
ng-repeat="scenario in scenarios | filter: {type: 'user' }">
{{scenario.title}}
</md-option>
</md-optgroup>
</md-select>
</md-input-container>
<div class="md-actions" layout="row" layout-align="end center">
<md-button class="md-raised"
ng-click="saveScenario()">Save Scenario</md-button>
</div>
</md-card-content>
</md-card>
<md-card>
<md-card-content>
<md-subheader>Miner Performance</md-subheader>
<div layout="row" layout-sm="column" layout-align="start center">
<!-- GPU choice-->
<md-input-container flex>
<md-select placeholder="Select your Miner" ng-model="user.gpu"
md-on-open="loadGPUs()"
ng-change="selectGPU()">
<md-optgroup label="BitMain">
<md-option ng-value="gpu"
ng-repeat="gpu in gpus | filter: {vendor: 'BitMain' }">
{{gpu.name}}
</md-option>
</md-optgroup>
<md-optgroup label="Spondoolies">
<md-option ng-value="gpu"
ng-repeat="gpu in gpus | filter: {vendor: 'Spondoolies' }">
{{gpu.name}}
</md-option>
</md-optgroup>
<md-optgroup label="Avalon">
<md-option ng-value="gpu"
ng-repeat="gpu in gpus | filter: {vendor: 'Avalon' }">
{{gpu.name}}
</md-option>
</md-optgroup>
<md-optgroup label="Cloud">
<md-option ng-value="gpu"
ng-repeat="gpu in gpus | filter: {vendor: 'Cloud' }">
{{gpu.name}}
</md-option>
</md-optgroup>
</md-select>
</md-input-container>
<!-- Number of units-->
<md-input-container flex>
<label>Number of units</label>
<input type="number" min="0" step="20" ng-model="roi.quantity"
ng-model-options="{ debounce: 500 }"
ng-change="computeEnergyCosts(); computeProfits()">
</md-input-container>
<md-input-container flex>
<label>XBT Price ({{facts.market.price.usd | currency:undefined:2}})</label>
<input type="number" step="20" ng-disabled="!user.gpu"
ng-model="user.price.usd"
ng-model-options="{ debounce: 500 }"
ng-change="computeProfits()">
<!--<md-select ng-model="currency">-->
<!--</md-select>-->
</md-input-container>
</div>
<div layout="row" layout-sm="column" layout-align="start center">
<!-- Hashrate-->
<md-input-container flex>
<label>Hashrate per unit (GH)</label>
<input type="number" min="0" max="1000000" step="50" name="hashrate"
ng-model="user.gpu.hashrate"
ng-model-options="{ debounce: 500 }"
required ng-change="computeEnergyCosts(); computeProfits();">
<!-- <div ng-messages="calculatorForm.hashrate.$error" -->
<!-- ng-show="calculatorForm.hashrate.$dirty && calculatorForm.hashrate.$invalid"> -->
<!-- <div ng-message="min">Error: Non positive hashrate.</div> -->
<!-- <div ng-message="max">Error: Maximum rate exceeded.</div> -->
<!-- </div> -->
</md-input-container>
<!-- Power-->
<md-input-container flex>
<label>Power per Unit (W)</label>
<input type="number" step="50" ng-model="user.gpu.power"
ng-model-options="{ debounce: 500 }"
aria-controls="power-supply"
ng-change="computeEnergyCosts()">
</md-input-container>
<md-slider flex hide-sm hide-md min="0" step="50" max="5000"
ng-model="user.gpu.power"
ng-model-options="{ debounce: 500 }"
aria-label="Power supply"
id="power-supply" class="md-primary"
ng-change="computeEnergyCosts()">
</md-slider>
<!-- Cloud pricing-->
<md-input-container ng-show="user.gpu.vendor ==='Cloud'">
<label>Instance hourly price in {{ currency }}</label>
<input type="number" step="0.01" ng-model="user.gpu.costs"
ng-model-options="{ debounce: 500 }"
ng-change="computeProfits()">
</md-input-container>
</div>
<div layout="row" layout-sm="column" flex>
<md-input-container flex>
<label>Difficulty Inc. (% per cycle)</label>
<input type="number" min="0" max="10" step="0.1"
ng-model="network.diffIncrease"
ng-model-options="{ debounce: 500 }"
ng-change="computeProfits()">
</md-input-container>
<md-input-container flex>
<md-checkbox ng-model="network.linearDiff"
ng-model-options="{ debounce: 500 }"
aria-label="Linear or exponential diff increase"
ng-change="computeEnergyCosts()">
Linear Diff (not Exp.)
</md-checkbox>
</md-input-container>
<md-input-container>
<label>Start date</label>
<md-datepicker ng-model="roi.startDate" md-placeholder="Start date"
ng-model-options="{ debounce: 500 }"
ng-change="computeProfits()"></md-datepicker>
</md-input-container>
</div>
<div layout="row" layout-sm="column" layout-align="start center">
<md-checkbox ng-model="user.electricity"
ng-model-options="{ debounce: 500 }"
aria-label="Electricity costs"
ng-disabled="!user.gpu || user.gpu.vendor ==='Cloud'"
ng-change="computeEnergyCosts()">
Power costs
</md-checkbox>
<div layout="row" layout-sm="column"
ng-if="user.electricity && user.gpu"
ng-hide="!user.gpu || user.gpu.vendor ==='Cloud'">
<md-input-container>
<label>{{ currency }} per KWh</label>
<input type="number" step="0.005" ng-model="electricity.price"
ng-model-options="{ debounce: 500 }"
ng-change="computeEnergyCosts()">
</md-input-container>
</div>
</div>
</md-card-content>
<div class="md-actions" layout="row" layout-align="end center">
<md-button class="md-raised md-warn" ng-click="reset()">Reset</md-button>
</div>
</md-card>
<md-card>
<md-card-content>
<md-subheader>Calendar ROI</md-subheader>
<div class="md-actions" layout="row" layout-align="end center">
<rickshaw
rickshaw-options="options"
rickshaw-features="features"
rickshaw-series="series">
</rickshaw>
</div>
</md-card-content>
</md-card>
<md-card>
<md-card-content>
<md-subheader>Profit-Price Convexity</md-subheader>
<div class="md-actions" layout="row" layout-align="end center">
<rickshaw
rickshaw-options="options2"
rickshaw-features="features2"
rickshaw-series="series2">
</rickshaw>
</div>
</md-card-content>
</md-card>
<md-card>
<md-card-content>
<md-subheader>Cost Base</md-subheader>
<!-- Start Diff-->
<p ng-show="user.gpu && user.gpu.vendor ==='Cloud'">Nothing to calculate !</p>
<div layout="row" layout-sm="column"
ng-hide="!user.gpu || user.gpu.vendor ==='Cloud'">
<!--<div layout="column">-->
<md-input-container>
<label>Per Unit cost in {{ currency }}</label>
<input type="number" step="1" ng-model="earnings.capitalPerUnit"
aria-controls="capitalPerUnit"
ng-change="computeProfits()">
</md-input-container>
<md-input-container>
<label>Fixed Startup cost in {{ currency }}</label>
<input type="number" step="200" ng-model="roi.startupFixed"
aria-controls="startupFixed"
ng-change="computeProfits()">
</md-input-container>
<md-input-container>
<label>Per unit startup cost in {{ currency }}</label>
<input type="number" step="1" ng-model="roi.startupPerUnit"
aria-controls="startupPerUnit"
ng-change="computeProfits()">
</md-input-container>
<!--</div>-->
</div>
</md-card-content>
</md-card>
<md-card>
<md-card-content>
<md-subheader>Earnings Summary</md-subheader>
<div layout="row" layout-sm="column">
<div flex>
Initial Capital: {{earnings.tab[0].roi | currency:undefined:0}}
</div>
<div flex>
Break-even: {{earnings.roiDate}}
</div>
<div flex>
Total Profit:<span ng-style="earnings.totalProfit < 0 && {'color': 'red'}">
{{earnings.totalProfit | currency:undefined:0}}</span>
</div>
<div flex>
Annualized ROI:<span ng-style="earnings.annProfit < 0 && {'color': 'red'}">
{{earnings.annProfit | number:1}}%</span>
</div>
<div flex>
Total ROI:<span ng-style="earnings.percentProfit < 0 && {'color': 'red'}">
{{earnings.percentProfit | number:1}}%</span>
</div>
<div flex>
Unplug Date: {{earnings.tab[earnings.tab.length -1].label}}
</div>
</div>
</md-card-content>
</md-card>
<md-card>
<md-card-content>
<md-subheader>Earnings Breakdown</md-subheader>
<md-list-item>
<p>Period</p>
<p>XBT Income</p>
<p>Profit</p>
<p>ROI</p>
</md-list-item>
<md-divider></md-divider>
<md-list ng-repeat="earning in earnings.tab">
<md-list-item>
<p>{{earning.label}}</p>
<p>{{earning.eth|number:3}} XBT</p>
<p ng-style="earning.price < 0 && {'color': 'red'}">
{{earning.price | currency:undefined:2}}
</p>
<p ng-style="earning.roi < 0 && {'color': 'red'}">
{{earning.roi | currency:undefined:2}}
</p>
</md-list-item>
<md-divider ng-hide="earning.last"></md-divider>
</md-list>
</md-card-content>
</md-card>
<md-card>
<md-card-content>
<h1 class="md-title">Notes</h1>
<p><i>Average block time</i> is calculated over the 64 last blocks.<br>
</p>
<p>References :
<ul>
<li>
<a href="https://forum.ethereum.org/discussion/2134/gpu-mining-is-out-come-and-let-us-know-of-your-bench-scores">GPU
Mining score</a>
</li>
<li>
Bitcoin Charts & data on <a href="http://coinmarketcap.com/currencies/bitcoin/">CoinMarketCap</a>
</li>
<li>
KWh price (Residential June 2015) from <a
href="http://www.eia.gov/electricity/monthly/epm_table_grapher.cfm?t=epmt_5_6_a">eia.gov</a>
</li>
</ul>
Source code can be found <a href="https://github.com/anthonygraignic/ethereum-mining-calculator">here</a>.
</p>
</md-card-content>
<md-card-footer>
Donate to the creator: <a
href="https://etherchain.org/account/0x1d4f6afc0e305048ae0a9be9f76b4b89d4a360a5">
0x1d4f6afc0e305048ae0a9be9f76b4b89d4a360a5</a>
</md-card-footer>
</md-card>
</md-content>
</form>
</div>
<!-- build:js(src) scripts/vendor.js -->
<!-- bower:js -->
<!-- run `gulp inject` to automatically populate bower script dependencies -->
<!-- endbower -->
<!-- endbuild -->
<!-- build:js({.tmp/serve,.tmp/partials,src}) scripts/app.js -->
<!-- inject:js -->
<!-- js files will be automatically insert here -->
<!-- endinject -->
<!-- inject:partials -->
<!-- angular templates will be automatically converted in js and inserted here -->
<!-- endinject -->
<!-- endbuild -->
<!--<script src="./bower_components/material-design-icons/action/svg/production/ic_help_48px.svg"></script>-->
<script type="text/javascript">
angular
.module('calculatorApp', ['ngMaterial', 'angular-rickshaw', 'calculator'])
.config(function ($mdThemingProvider, $mdIconProvider) {
// https://www.google.com/design/icons/
$mdIconProvider.icon("help", "./assets/svg/ic_help_48px.svg", 48)
.icon("power", "./assets/svg/ic_power_48px.svg", 48)
;
$mdThemingProvider.theme('default');
});
</script>
</body>
</html>