File size: 27,757 Bytes
a25c420
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DMIM Yield Farming | Bitcoin Cash Blockchain</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .price-up {
            color: #10b981;
            animation: pulse-up 0.5s ease-in-out;
        }
        .price-down {
            color: #ef4444;
            animation: pulse-down 0.5s ease-in-out;
        }
        @keyframes pulse-up {
            0% { transform: scale(1); }
            50% { transform: scale(1.1); }
            100% { transform: scale(1); }
        }
        @keyframes pulse-down {
            0% { transform: scale(1); }
            50% { transform: scale(0.9); }
            100% { transform: scale(1); }
        }
        .chart-container {
            height: 250px;
            position: relative;
        }
        .chart-line {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 100%;
            stroke-width: 2;
            fill: none;
        }
        .institutional-panel {
            background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
            border: 1px solid #334155;
        }
        .tokenomics-card {
            background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
            border-left: 4px solid #8b5cf6;
        }
        .token-badge {
            background-color: rgba(139, 92, 246, 0.1);
            border: 1px solid rgba(139, 92, 246, 0.3);
        }
        .blink {
            animation: blink-animation 1s steps(5, start) infinite;
        }
        @keyframes blink-animation {
            to { opacity: 0.5; }
        }
        .yield-card {
            background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
            border: 1px solid #334155;
        }
        .yield-highlight {
            background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%);
        }
    </style>
</head>
<body class="bg-gray-900 text-gray-100 min-h-screen">
    <div class="container mx-auto px-4 py-8">
        <header class="flex flex-col md:flex-row justify-between items-start md:items-center mb-8 gap-4">
            <div class="flex items-center">
                <div class="relative">
                    <i class="fas fa-coins text-3xl text-purple-500 mr-3"></i>
                    <span class="absolute -top-1 -right-1 bg-purple-500 text-white text-xs rounded-full w-4 h-4 flex items-center justify-center blink"></span>
                </div>
                <div>
                    <h1 class="text-2xl font-bold">DMIM Yield Farming</h1>
                    <div class="flex items-center mt-1 space-x-2">
                        <span class="token-badge px-2 py-1 rounded-md text-xs flex items-center">
                            <i class="fab fa-bitcoin text-orange-400 mr-1"></i>
                            Bitcoin Cash Blockchain
                        </span>
                        <span class="token-badge px-2 py-1 rounded-md text-xs">Fungible Token</span>
                    </div>
                </div>
            </div>
            <div class="flex flex-col md:flex-row items-start md:items-center space-y-2 md:space-y-0 md:space-x-4">
                <div class="bg-gray-800 px-4 py-2 rounded-lg">
                    <span class="text-gray-400">Balance:</span>
                    <span class="font-bold ml-2" id="balance">1,250.00 DMIM</span>
                </div>
                <div class="bg-gray-800 px-4 py-2 rounded-lg">
                    <span class="text-gray-400">BCH Balance:</span>
                    <span class="font-bold ml-2">5.42 BCH</span>
                </div>
            </div>
        </header>

        <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6">
            <!-- Token Info -->
            <div class="bg-gray-800 rounded-xl p-6">
                <h2 class="text-xl font-bold mb-4 flex items-center">
                    <i class="fas fa-info-circle text-purple-400 mr-2"></i>
                    Token Information
                </h2>
                <div class="space-y-4">
                    <div>
                        <div class="text-gray-400 text-sm">Token Name</div>
                        <div class="text-lg font-bold">DMIM</div>
                    </div>
                    <div>
                        <div class="text-gray-400 text-sm">Token ID</div>
                        <div class="text-sm font-mono break-all">81fd176d7e3769aad00bc21539082cc3345f9cd613623fa281e6726f451f32f9</div>
                    </div>
                    <div>
                        <div class="text-gray-400 text-sm">Total Supply</div>
                        <div class="text-lg font-bold">1,000,000 DMIM</div>
                    </div>
                    <div>
                        <div class="text-gray-400 text-sm">Current Price</div>
                        <div class="text-2xl font-bold" id="current-price">0.052 BCH</div>
                        <div class="text-sm" id="price-change">+1.24% <i class="fas fa-arrow-up ml-1"></i></div>
                    </div>
                    <div>
                        <div class="text-gray-400 text-sm">Creation TX</div>
                        <a href="https://blockchair.com/bitcoin-cash/transaction/81fd176d7e3769aad00bc21539082cc3345f9cd613623fa281e6726f451f32f9" target="_blank" class="text-purple-400 hover:underline text-sm font-mono break-all">81fd176d7e3769...f451f32f9</a>
                    </div>
                </div>
            </div>

            <!-- Market Data -->
            <div class="bg-gray-800 rounded-xl p-6">
                <div class="flex justify-between items-center mb-4">
                    <h2 class="text-xl font-bold flex items-center">
                        <i class="fas fa-chart-line text-purple-400 mr-2"></i>
                        Market Data
                    </h2>
                    <div class="flex space-x-2">
                        <select class="bg-gray-700 text-white rounded px-3 py-1 text-sm">
                            <option>1h</option>
                            <option>4h</option>
                            <option>1d</option>
                            <option>1w</option>
                        </select>
                    </div>
                </div>

                <div class="chart-container mb-4">
                    <svg id="price-chart" width="100%" height="100%" viewBox="0 0 500 250" preserveAspectRatio="none">
                        <path class="chart-line", stroke="#8b5cf6" d="M0,250 L50,220 L100,240 L150,210 L200,230 L250,200 L300,220 L350,190 L400,180 L450,170 L500,160" />
                    </svg>
                </div>

                <div class="grid grid-cols-2 gap-4">
                    <div class="bg-gray-700 p-3 rounded-lg">
                        <div class="text-gray-400 text-sm">24h Volume</div>
                        <div class="text-lg font-bold">12,450 DMIM</div>
                    </div>
                    <div class="bg-gray-700 p-3 rounded-lg">
                        <div class="text-gray-400 text-sm">Liquidity</div>
                        <div class="text-lg font-bold">24,000 BCH</div>
                    </div>
                </div>
            </div>

            <!-- Tokenomics -->
            <div class="tokenomics-card rounded-xl p-6">
                <h2 class="text-xl font-bold mb-4 flex items-center">
                    <i class="fas fa-pie-chart text-purple-400 mr-2"></i>
                    Tokenomics
                </h2>
                <div class="flex items-center justify-center mb-4">
                    <div class="w-32 h-32 rounded-full border-4 border-purple-500 flex items-center justify-center">
                        <div class="text-center">
                            <div class="text-2xl font-bold">1M</div>
                            <div class="text-xs text-gray-400">Total Supply</div>
                        </div>
                    </div>
                </div>
                <div class="space-y-3">
                    <div class="flex justify-between">
                        <span class="text-gray-400">Circulating</span>
                        <span class="font-medium">650,000 DMIM (65%)</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-400">Reserves</span>
                        <span class="font-medium">200,000 DMIM (20%)</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-400">Team</span>
                        <span class="font-medium">100,000 DMIM (10%)</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-400">Ecosystem</span>
                        <span class="font-medium">50,000 DMIM (5%)</span>
                    </div>
                </div>
            </div>
        </div>

        <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
            <!-- Yield Farming Panel -->
            <div class="yield-card rounded-xl p-6">
                <h2 class="text-xl font-bold mb-4 flex items-center">
                    <i class="fas fa-seedling text-purple-400 mr-2"></i>
                    Yield Farming
                </h2>
                
                <div class="mb-4">
                    <label class="text-gray-400 block mb-2">Select Pool</label>
                    <select class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 focus:outline-none focus:ring-2 focus:ring-purple-500" id="pool-select">
                        <option value="0.03">DMIM/BCH Pool (0.03% APY)</option>
                        <option value="0.05">DMIM/USDC Pool (0.05% APY)</option>
                        <option value="0.07">DMIM/ETH Pool (0.07% APY)</option>
                    </select>
                </div>

                <div class="mb-4">
                    <div class="flex justify-between mb-2">
                        <label class="text-gray-400">DMIM Amount</label>
                        <span class="text-gray-400">Available: 1,250.00 DMIM</span>
                    </div>
                    <input type="number" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="0.00" id="farm-amount">
                </div>

                <div class="mb-4">
                    <div class="flex justify-between mb-2">
                        <label class="text-gray-400">BCH Amount</label>
                        <span class="text-gray-400">Available: 5.42 BCH</span>
                    </div>
                    <input type="number", class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="0.00" id="bch-amount">
                </div>

                <div class="mb-4">
                    <label class="flex items-center">
                        <input type="checkbox" class="form-checkbox h-5 w-5 text-purple-600 rounded" checked>
                        <span class="ml-2">Auto-compound rewards</span>
                    </label>
                </div>

                <button class="w-full bg-purple-600 hover:bg-purple-700 py-3 rounded-lg font-bold transition mb-4">
                    Add Liquidity
                </button>

                <div class="text-center text-sm text-gray-400">
                    Current TVL: <span class="text-purple-400">$1,240,000</span>
                </div>
            </div>

            <!-- Profit Calculator -->
            <div class="yield-highlight rounded-xl p-6">
                <h2 class="text-xl font-bold mb-4 flex items-center">
                    <i class="fas fa-calculator mr-2"></i>
                    Profit Calculator
                </h2>
                
                <div class="mb-4">
                    <label class="text-gray-200 block mb-2">Investment Amount (DMIM)</label>
                    <input type="number" class="w-full bg-purple-800 border border-purple-700 rounded-lg px-4 py-3 focus:outline-none focus:ring-2 focus:ring-purple-400" placeholder="1000" id="investment-amount">
                </div>

                <div class="mb-4">
                    <label class="text-gray-200 block mb-2">APY (%)</label>
                    <input type="number" class="w-full bg-purple-800 border border-purple-700 rounded-lg px-4 py-3 focus:outline-none focus:ring-2 focus:ring-purple-400" value="0.03" step="0.01" id="apy-input">
                </div>

                <div class="grid grid-cols-4 gap-2 mb-4">
                    <button class="bg-purple-700 hover:bg-purple-800 py-2 rounded-lg text-sm" onclick="calculateProfit('week')">Week</button>
                    <button class="bg-purple-700 hover:bg-purple-800 py-2 rounded-lg text-sm" onclick="calculateProfit('month')">Month</button>
                    <button class="bg-purple-700 hover:bg-purple-800 py-2 rounded-lg text-sm" onclick="calculateProfit('quarter')">Quarter</button>
                    <button class="bg-purple-700 hover:bg-purple-800 py-2 rounded-lg text-sm" onclick="calculateProfit('year')">Year</button>
                </div>

                <div class="bg-purple-800 rounded-lg p-4 mb-4">
                    <div class="flex justify-between mb-2">
                        <span class="text-gray-300">Estimated Rewards:</span>
                        <span class="font-bold" id="estimated-rewards">0 DMIM</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-300">Value in BCH:</span>
                        <span class="font-bold" id="estimated-value">0 BCH</span>
                    </div>
                </div>

                <div class="text-center text-sm text-gray-200">
                    Calculations based on current price: <span class="font-bold">0.052 BCH/DMIM</span>
                </div>
            </div>

            <!-- Institutional Trading -->
            <div class="institutional-panel rounded-xl p-6">
                <h2 class="text-xl font-bold mb-4 flex items-center">
                    <i class="fas fa-building text-purple-400 mr-2"></i>
                    Institutional Trading
                </h2>
                
                <div class="mb-4">
                    <div class="flex justify-between items-center mb-2">
                        <label class="text-gray-400">OTC Order Size</label>
                        <span class="text-xs text-gray-400">Min: 10,000 DMIM</span>
                    </div>
                    <input type="number" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="10,000+ DMIM">
                </div>

                <div class="mb-4">
                    <label class="text-gray-400 block mb-2">Settlement Period</label>
                    <div class="grid grid-cols-3 gap-2">
                        <button class="bg-gray-800 hover:bg-gray-700 py-2 rounded-lg text-sm">T+1</button>
                        <button class="bg-gray-800 hover:bg-gray-700 py-2 rounded-lg text-sm">T+2</button>
                        <button class="bg-purple-600 py-2 rounded-lg text-sm">T+0</button>
                    </div>
                </div>

                <div class="mb-4">
                    <label class="flex items-center">
                        <input type="checkbox" class="form-checkbox h-5 w-5 text-purple-600 rounded" checked>
                        <span class="ml-2">Block Trade</span>
                    </label>
                </div>

                <div class="mb-4">
                    <label class="text-gray-400 block mb-1">Counterparty</label>
                    <select class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
                        <option>Select Institution</option>
                        <option>BCH Foundation</option>
                        <option>Digital Asset Fund</option>
                        <option>Crypto Market Makers</option>
                    </select>
                </div>

                <button class="w-full bg-purple-600 hover:bg-purple-700 py-3 rounded-lg font-bold transition">
                    Request OTC Quote
                </button>
            </div>
        </div>

        <!-- Trade History -->
        <div class="bg-gray-800 rounded-xl p-6 mt-6">
            <div class="flex justify-between items-center mb-6">
                <h2 class="text-xl font-bold flex items-center">
                    <i class="fas fa-history text-purple-400 mr-2"></i>
                    Recent Transactions
                </h2>
                <div class="flex space-x-2">
                    <button class="bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm">All</button>
                    <button class="bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm">Swaps</button>
                    <button class="bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm">Adds</button>
                    <button class="bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm">Removes</button>
                </div>
            </div>
            <div class="overflow-x-auto">
                <table class="w-full">
                    <thead>
                        <tr class="text-gray-400 border-b border-gray-700">
                            <th class="pb-3 text-left">Date</th>
                            <th class="pb-3 text-left">Type</th>
                            <th class="pb-3 text-left">Amount (DMIM)</th>
                            <th class="pb-3 text-left">Amount (BCH)</th>
                            <th class="pb-3 text-left">Status</th>
                            <th class="pb-3 text-left">TX ID</th>
                        </tr>
                    </thead>
                    <tbody id="trades-table">
                        <tr class="border-b border-gray-700 hover:bg-gray-700">
                            <td class="py-3">2023-11-15 14:32</td>
                            <td class="text-green-400">Add Liquidity</td>
                            <td>250.00</td>
                            <td>13.00</td>
                            <td class="text-green-400">Confirmed</td>
                            <td class="text-xs font-mono">a1b2c3...e4f5</td>
                        </tr>
                        <tr class="border-b border-gray-700 hover:bg-gray-700">
                            <td class="py-3">2023-11-15 11:18</td>
                            <td class="text-blue-400">Swap</td>
                            <td>180.50</td>
                            <td>9.42</td>
                            <td class="text-green-400">Confirmed</td>
                            <td class="text-xs font-mono">d4e5f6...g7h8</td>
                        </tr>
                        <tr class="border-b border-gray-700 hover:bg-gray-700">
                            <td class="py-3">2023-11-14 16:45</td>
                            <td class="text-green-400">Add Liquidity</td>
                            <td>420.00</td>
                            <td>21.63</td>
                            <td class="text-green-400">Confirmed</td>
                            <td class="text-xs font-mono">i9j0k1...l2m3</td>
                        </tr>
                        <tr class="border-b border-gray-700 hover:bg-gray-700">
                            <td class="py-3">2023-11-14 09:12</td>
                            <td class="text-yellow-400">Remove Liquidity</td>
                            <td>75.25</td>
                            <td>3.95</td>
                            <td class="text-green-400">Confirmed</td>
                            <td class="text-xs font-mono">n4o5p6...q7r8</td>
                        </tr>
                        <tr class="hover:bg-gray-700">
                            <td class="py-3">2023-11-13 22:08</td>
                            <td class="text-blue-400">Swap</td>
                            <td>324.75</td>
                            <td>16.63</td>
                            <td class="text-green-400">Confirmed</td>
                            <td class="text-xs font-mono">s9t0u1...v2w3</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <script>
        // Simulate price changes for DMIM/BCH pair
        let currentPrice = 0.0520;
        let priceDirection = 1; // 1 for up, -1 for down
        let balance = 1250.00;
        let transactions = [];

        // DOM elements
        const currentPriceEl = document.getElementById('current-price');
        const priceChangeEl = document.getElementById('price-change');
        const balanceEl = document.getElementById('balance');
        const farmAmountEl = document.getElementById('farm-amount');
        const bchAmountEl = document.getElementById('bch-amount');
        const poolSelectEl = document.getElementById('pool-select');
        const investmentAmountEl = document.getElementById('investment-amount');
        const apyInputEl = document.getElementById('apy-input');
        const estimatedRewardsEl = document.getElementById('estimated-rewards');
        const estimatedValueEl = document.getElementById('estimated-value');
        const tradesTableEl = document.getElementById('trades-table');
        const priceChartEl = document.getElementById('price-chart');

        // Format currency
        const formatCurrency = (amount) => {
            return amount.toFixed(4) + ' BCH';
        };

        // Format DMIM
        const formatDMIM = (amount) => {
            return amount.toFixed(2) + ' DMIM';
        };

        // Generate random price data for chart
        const generateChartData = () => {
            let points = [];
            let y = 250;
            for (let x = 0; x <= 500; x += 50) {
                y = Math.max(100, Math.min(250, y + (Math.random() * 40 - 20)));
                points.push(`${x},${y}`);
            }
            return points.join(' ');
        };

        // Update chart
        const updateChart = () => {
            const path = priceChartEl.querySelector('.chart-line');
            path.setAttribute('d', `M${generateChartData()}`);
        };

        // Update price
        const updatePrice = () => {
            // Random price change
            const change = (Math.random() * 0.002 - 0.001) * priceDirection;
            currentPrice = Math.max(0.0500, Math.min(0.0540, currentPrice + change));
            
            // Occasionally reverse direction
            if (Math.random() < 0.2) {
                priceDirection *= -1;
            }

            // Update UI
            currentPriceEl.textContent = formatCurrency(currentPrice);
            
            // Calculate percentage change
            const changePercent = (change / (currentPrice - change) * 100).toFixed(2);
            if (change >= 0) {
                priceChangeEl.innerHTML = `+${changePercent}% <i class="fas fa-arrow-up ml-1"></i>`;
                priceChangeEl.className = 'text-sm price-up';
                currentPriceEl.className = 'text-2xl font-bold price-up';
            } else {
                priceChangeEl.innerHTML = `${changePercent}% <i class="fas fa-arrow-down ml-1"></i>`;
                priceChangeEl.className = 'text-sm price-down';
                currentPriceEl.className = 'text-2xl font-bold price-down';
            }
            
            // Update chart
            updateChart();
        };

        // Calculate farming profits
        const calculateProfit = (period) => {
            const amount = parseFloat(investmentAmountEl.value) || 0;
            const apy = parseFloat(apyInputEl.value) || 0;
            
            if (amount <= 0 || apy <= 0) {
                estimatedRewardsEl.textContent = "0 DMIM";
                estimatedValueEl.textContent = "0 BCH";
                return;
            }
            
            let days;
            switch (period) {
                case 'week':
                    days = 7;
                    break;
                case 'month':
                    days = 30;
                    break;
                case 'quarter':
                    days = 90;
                    break;
                case 'year':
                    days = 365;
                    break;
                default:
                    days = 365;
            }
            
            // Simple interest calculation
            const rewards = amount * (apy / 100) * (days / 365);
            const value = rewards * currentPrice;
            
            estimatedRewardsEl.textContent = formatDMIM(rewards);
            estimatedValueEl.textContent = formatCurrency(value);
        };

        // Sync BCH amount when DMIM amount changes
        farmAmountEl.addEventListener('input', () => {
            const dmimAmount = parseFloat(farmAmountEl.value) || 0;
            const bchAmount = dmimAmount * currentPrice;
            bchAmountEl.value = bchAmount.toFixed(4);
        });

        // Sync DMIM amount when BCH amount changes
        bchAmountEl.addEventListener('input', () => {
            const bchAmount = parseFloat(bchAmountEl.value) || 0;
            const dmimAmount = bchAmount / currentPrice;
            farmAmountEl.value = dmimAmount.toFixed(2);
        });

        // Update APY when pool changes
        poolSelectEl.addEventListener('change', () => {
            const selectedPool = poolSelectEl.options[poolSelectEl.selectedIndex];
            const apy = selectedPool.value;
            apyInputEl.value = apy;
        });

        // Initialize
        updatePrice();
        updateChart();
        
        // Simulate price changes every 3 seconds
        setInterval(updatePrice, 3000);
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - <a href="https://enzostvs-deepsite.hf.space?remix=tonymontana2064/simple-trading" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p><p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=privateuserh/privdmi-vbeta1-02" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>