cryptodatapy 0.2.8__py3-none-any.whl → 0.2.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,747 +0,0 @@
1
- {
2
- "cells": [
3
- {
4
- "cell_type": "code",
5
- "execution_count": 17,
6
- "id": "282304eb-92f6-43e8-be3a-6e31e26a8315",
7
- "metadata": {},
8
- "outputs": [],
9
- "source": [
10
- "from datetime import datetime\n",
11
- "import pandas as pd\n",
12
- "import requests\n",
13
- "\n",
14
- "from cryptodatapy.extract.data_vendors.coinmetrics_api import CoinMetrics\n",
15
- "from cryptodatapy.extract.datarequest import DataRequest\n",
16
- "from cryptodatapy.transform.convertparams import ConvertParams"
17
- ]
18
- },
19
- {
20
- "cell_type": "code",
21
- "execution_count": 18,
22
- "id": "703eb00b-7d1d-43f5-a608-0dae2a2faba9",
23
- "metadata": {},
24
- "outputs": [],
25
- "source": [
26
- "cm = CoinMetrics()"
27
- ]
28
- },
29
- {
30
- "cell_type": "code",
31
- "execution_count": 19,
32
- "id": "b179708e-6b2f-46e8-9e19-d4e6c9d17bca",
33
- "metadata": {},
34
- "outputs": [],
35
- "source": [
36
- "cm_fields = ['add_act',\n",
37
- " 'add_act_sent',\n",
38
- " 'add_act_rec',\n",
39
- " 'add_pos_bal',\n",
40
- " 'tx_count',\n",
41
- " 'tx_rate',\n",
42
- " 'tx_bytes_mean',\n",
43
- " 'tx_fee_mean',\n",
44
- " 'tx_fee_mean_usd',\n",
45
- " 'tfr_count',\n",
46
- " 'tfr_val',\n",
47
- " 'tfr_val_usd',\n",
48
- " 'tfr_val_mean',\n",
49
- " 'tfr_val_mean_usd',\n",
50
- " 'nvt_ratio_adj',\n",
51
- " 'nvt_ratio_90dma',\n",
52
- " 'nvt_ratio_ff',\n",
53
- " 'nvt_ratio_ff_90dma',\n",
54
- " 'velocity_1y',\n",
55
- " 'utxo',\n",
56
- " 'hashrate',\n",
57
- " 'diff_last',\n",
58
- " 'diff_mean',\n",
59
- " 'block_height',\n",
60
- " 'block_size_mean',\n",
61
- " 'block_time_mean',\n",
62
- " 'miner_rev',\n",
63
- " 'miner_rev_usd',\n",
64
- " 'miner_rev_fees ',\n",
65
- " 'miner_rev_fees_usd',\n",
66
- " 'miner_rev_total_usd',\n",
67
- " 'supply_circ',\n",
68
- " 'supply_ff',\n",
69
- " 'issuance',\n",
70
- " 'supply_act_pct_1y',\n",
71
- " 'sopr']"
72
- ]
73
- },
74
- {
75
- "cell_type": "code",
76
- "execution_count": 20,
77
- "id": "6e674d24-988d-43da-bfa1-681293944ea1",
78
- "metadata": {},
79
- "outputs": [],
80
- "source": [
81
- "data_req = DataRequest(tickers=['btc', 'eth', 'sol'], fields=cm_fields)"
82
- ]
83
- },
84
- {
85
- "cell_type": "code",
86
- "execution_count": 21,
87
- "id": "a3a22516-a990-43ae-a742-4dae6df797cd",
88
- "metadata": {},
89
- "outputs": [],
90
- "source": [
91
- "cm_data_req = ConvertParams(data_req).to_coinmetrics()"
92
- ]
93
- },
94
- {
95
- "cell_type": "code",
96
- "execution_count": 22,
97
- "id": "822f4804-5daa-431a-a90b-b5fa9bb6f2b3",
98
- "metadata": {},
99
- "outputs": [
100
- {
101
- "data": {
102
- "text/plain": [
103
- "{'tickers': ['btc', 'eth', 'sol'],\n",
104
- " 'freq': '1d',\n",
105
- " 'quote_ccy': 'usdt',\n",
106
- " 'exch': 'binance',\n",
107
- " 'ctys': None,\n",
108
- " 'mkt_type': 'spot',\n",
109
- " 'mkts': ['binance-btc-usdt-spot',\n",
110
- " 'binance-eth-usdt-spot',\n",
111
- " 'binance-sol-usdt-spot'],\n",
112
- " 'start_date': None,\n",
113
- " 'end_date': None,\n",
114
- " 'fields': ['AdrActCnt',\n",
115
- " 'AdrActSentCnt',\n",
116
- " 'AdrActRecCnt',\n",
117
- " 'AdrBalCnt',\n",
118
- " 'TxCnt',\n",
119
- " 'TxCntSec',\n",
120
- " 'TxMeanByte',\n",
121
- " 'FeeMeanNtv',\n",
122
- " 'FeeMeanUSD',\n",
123
- " 'TxTfrCnt',\n",
124
- " 'TxTfrValNtv',\n",
125
- " 'TxTfrValUSD',\n",
126
- " 'TxTfrValMeanNtv',\n",
127
- " 'TxTfrValMeanUSD',\n",
128
- " 'NVTAdj',\n",
129
- " 'NVTAdj90',\n",
130
- " 'NVTAdjFF',\n",
131
- " 'NVTAdjFF90',\n",
132
- " 'VelCur1yr',\n",
133
- " 'UTXOCnt',\n",
134
- " 'HashRate',\n",
135
- " 'DiffLast',\n",
136
- " 'DiffMean',\n",
137
- " 'BlkHgt',\n",
138
- " 'BlkSizeMeanByte',\n",
139
- " 'BlkIntMean',\n",
140
- " 'RevNtv',\n",
141
- " 'RevUSD',\n",
142
- " 'FeeTotNtv',\n",
143
- " 'FeeTotUSD',\n",
144
- " 'RevAllTimeUSD',\n",
145
- " 'SplyCur',\n",
146
- " 'SplyFF',\n",
147
- " 'IssTotNtv',\n",
148
- " 'SplyActPct1yr',\n",
149
- " 'SOPR'],\n",
150
- " 'tz': 'UTC',\n",
151
- " 'inst': 'grayscale',\n",
152
- " 'cat': 'crypto',\n",
153
- " 'trials': 3,\n",
154
- " 'pause': 0.1,\n",
155
- " 'source_tickers': None,\n",
156
- " 'source_freq': None,\n",
157
- " 'source_fields': None}"
158
- ]
159
- },
160
- "execution_count": 22,
161
- "metadata": {},
162
- "output_type": "execute_result"
163
- }
164
- ],
165
- "source": [
166
- "cm_data_req"
167
- ]
168
- },
169
- {
170
- "cell_type": "code",
171
- "execution_count": 23,
172
- "id": "59da43fe-39fa-468c-a98a-e62d2a0a36df",
173
- "metadata": {},
174
- "outputs": [
175
- {
176
- "data": {
177
- "text/html": [
178
- "<div>\n",
179
- "<style scoped>\n",
180
- " .dataframe tbody tr th:only-of-type {\n",
181
- " vertical-align: middle;\n",
182
- " }\n",
183
- "\n",
184
- " .dataframe tbody tr th {\n",
185
- " vertical-align: top;\n",
186
- " }\n",
187
- "\n",
188
- " .dataframe thead th {\n",
189
- " text-align: right;\n",
190
- " }\n",
191
- "</style>\n",
192
- "<table border=\"1\" class=\"dataframe\">\n",
193
- " <thead>\n",
194
- " <tr style=\"text-align: right;\">\n",
195
- " <th></th>\n",
196
- " <th>full_name</th>\n",
197
- " <th>description</th>\n",
198
- " <th>category</th>\n",
199
- " <th>subcategory</th>\n",
200
- " <th>unit</th>\n",
201
- " <th>data_type</th>\n",
202
- " <th>type</th>\n",
203
- " <th>frequencies</th>\n",
204
- " <th>display_name</th>\n",
205
- " <th>reviewable</th>\n",
206
- " </tr>\n",
207
- " <tr>\n",
208
- " <th>fields</th>\n",
209
- " <th></th>\n",
210
- " <th></th>\n",
211
- " <th></th>\n",
212
- " <th></th>\n",
213
- " <th></th>\n",
214
- " <th></th>\n",
215
- " <th></th>\n",
216
- " <th></th>\n",
217
- " <th></th>\n",
218
- " <th></th>\n",
219
- " </tr>\n",
220
- " </thead>\n",
221
- " <tbody>\n",
222
- " <tr>\n",
223
- " <th>AdrActCnt</th>\n",
224
- " <td>Addresses, active, count</td>\n",
225
- " <td>The sum count of unique addresses that were ac...</td>\n",
226
- " <td>Addresses</td>\n",
227
- " <td>Active</td>\n",
228
- " <td>Addresses</td>\n",
229
- " <td>bigint</td>\n",
230
- " <td>Sum</td>\n",
231
- " <td>[{'frequency': '1d', 'assets': ['1inch', 'aave...</td>\n",
232
- " <td>Active Addr Cnt</td>\n",
233
- " <td>NaN</td>\n",
234
- " </tr>\n",
235
- " <tr>\n",
236
- " <th>AdrBal1in100KCnt</th>\n",
237
- " <td>Addresses, with balance, greater than 1in100K,...</td>\n",
238
- " <td>The sum count of unique addresses holding at l...</td>\n",
239
- " <td>Addresses</td>\n",
240
- " <td>Balance</td>\n",
241
- " <td>Addresses</td>\n",
242
- " <td>bigint</td>\n",
243
- " <td>Sum</td>\n",
244
- " <td>[{'frequency': '1d', 'assets': ['1inch', 'aave...</td>\n",
245
- " <td>Addr Cnt with ≥ .001% Supply</td>\n",
246
- " <td>NaN</td>\n",
247
- " </tr>\n",
248
- " <tr>\n",
249
- " <th>AdrBal1in100MCnt</th>\n",
250
- " <td>Addresses, with balance, greater than 1in100M,...</td>\n",
251
- " <td>The sum count of unique addresses holding at l...</td>\n",
252
- " <td>Addresses</td>\n",
253
- " <td>Balance</td>\n",
254
- " <td>Addresses</td>\n",
255
- " <td>bigint</td>\n",
256
- " <td>Sum</td>\n",
257
- " <td>[{'frequency': '1d', 'assets': ['1inch', 'aave...</td>\n",
258
- " <td>Addr Cnt with ≥ .000001% Supply</td>\n",
259
- " <td>NaN</td>\n",
260
- " </tr>\n",
261
- " <tr>\n",
262
- " <th>AdrBal1in10BCnt</th>\n",
263
- " <td>Addresses, with balance, greater than 1in10B, ...</td>\n",
264
- " <td>The sum count of unique addresses holding at l...</td>\n",
265
- " <td>Addresses</td>\n",
266
- " <td>Balance</td>\n",
267
- " <td>Addresses</td>\n",
268
- " <td>bigint</td>\n",
269
- " <td>Sum</td>\n",
270
- " <td>[{'frequency': '1d', 'assets': ['1inch', 'aave...</td>\n",
271
- " <td>Addr Cnt with ≥ .00000001% Supply</td>\n",
272
- " <td>NaN</td>\n",
273
- " </tr>\n",
274
- " <tr>\n",
275
- " <th>AdrBal1in10KCnt</th>\n",
276
- " <td>Addresses, with balance, greater than 1in10K, ...</td>\n",
277
- " <td>The sum count of unique addresses holding at l...</td>\n",
278
- " <td>Addresses</td>\n",
279
- " <td>Balance</td>\n",
280
- " <td>Addresses</td>\n",
281
- " <td>bigint</td>\n",
282
- " <td>Sum</td>\n",
283
- " <td>[{'frequency': '1d', 'assets': ['1inch', 'aave...</td>\n",
284
- " <td>Addr Cnt with ≥ .01% Supply</td>\n",
285
- " <td>NaN</td>\n",
286
- " </tr>\n",
287
- " <tr>\n",
288
- " <th>...</th>\n",
289
- " <td>...</td>\n",
290
- " <td>...</td>\n",
291
- " <td>...</td>\n",
292
- " <td>...</td>\n",
293
- " <td>...</td>\n",
294
- " <td>...</td>\n",
295
- " <td>...</td>\n",
296
- " <td>...</td>\n",
297
- " <td>...</td>\n",
298
- " <td>...</td>\n",
299
- " </tr>\n",
300
- " <tr>\n",
301
- " <th>VelCur1yr</th>\n",
302
- " <td>Velocity, current supply, 1yr</td>\n",
303
- " <td>The ratio of the value transferred (i.e., the ...</td>\n",
304
- " <td>Transactions</td>\n",
305
- " <td>Velocity</td>\n",
306
- " <td>Dimensionless</td>\n",
307
- " <td>decimal</td>\n",
308
- " <td>Ratio</td>\n",
309
- " <td>[{'frequency': '1d', 'assets': ['1inch', 'aave...</td>\n",
310
- " <td>1 Year Current Supply Velocity</td>\n",
311
- " <td>NaN</td>\n",
312
- " </tr>\n",
313
- " <tr>\n",
314
- " <th>VtyDayRet180d</th>\n",
315
- " <td>Volatility, daily returns, 180d</td>\n",
316
- " <td>The 180D volatility, measured as the standard ...</td>\n",
317
- " <td>Market</td>\n",
318
- " <td>Volatility</td>\n",
319
- " <td>Dimensionless</td>\n",
320
- " <td>decimal</td>\n",
321
- " <td>Ratio</td>\n",
322
- " <td>[{'frequency': '1d', 'assets': ['1inch', 'aave...</td>\n",
323
- " <td>180 Day Volatility</td>\n",
324
- " <td>NaN</td>\n",
325
- " </tr>\n",
326
- " <tr>\n",
327
- " <th>VtyDayRet30d</th>\n",
328
- " <td>Volatility, daily returns, 30d</td>\n",
329
- " <td>The 30D volatility, measured as the standard d...</td>\n",
330
- " <td>Market</td>\n",
331
- " <td>Volatility</td>\n",
332
- " <td>Dimensionless</td>\n",
333
- " <td>decimal</td>\n",
334
- " <td>Ratio</td>\n",
335
- " <td>[{'frequency': '1d', 'assets': ['1inch', 'aave...</td>\n",
336
- " <td>30 Day Volatility</td>\n",
337
- " <td>NaN</td>\n",
338
- " </tr>\n",
339
- " <tr>\n",
340
- " <th>principal_market_price_usd</th>\n",
341
- " <td>Principal Market Price, USD</td>\n",
342
- " <td>The price of an asset quoted in U.S. dollars d...</td>\n",
343
- " <td>Market</td>\n",
344
- " <td>Price</td>\n",
345
- " <td>USD</td>\n",
346
- " <td>decimal</td>\n",
347
- " <td>N/A</td>\n",
348
- " <td>[{'frequency': '1s', 'assets': ['1cat', '1inch...</td>\n",
349
- " <td>Principal Market Price</td>\n",
350
- " <td>NaN</td>\n",
351
- " </tr>\n",
352
- " <tr>\n",
353
- " <th>principal_market_usd</th>\n",
354
- " <td>Principal Market, USD</td>\n",
355
- " <td>The asset's principal market, the market with ...</td>\n",
356
- " <td>Market</td>\n",
357
- " <td>Price</td>\n",
358
- " <td>USD</td>\n",
359
- " <td>text</td>\n",
360
- " <td>N/A</td>\n",
361
- " <td>[{'frequency': '1s', 'assets': ['1cat', '1inch...</td>\n",
362
- " <td>Principal Market</td>\n",
363
- " <td>NaN</td>\n",
364
- " </tr>\n",
365
- " </tbody>\n",
366
- "</table>\n",
367
- "<p>154 rows × 10 columns</p>\n",
368
- "</div>"
369
- ],
370
- "text/plain": [
371
- " full_name \\\n",
372
- "fields \n",
373
- "AdrActCnt Addresses, active, count \n",
374
- "AdrBal1in100KCnt Addresses, with balance, greater than 1in100K,... \n",
375
- "AdrBal1in100MCnt Addresses, with balance, greater than 1in100M,... \n",
376
- "AdrBal1in10BCnt Addresses, with balance, greater than 1in10B, ... \n",
377
- "AdrBal1in10KCnt Addresses, with balance, greater than 1in10K, ... \n",
378
- "... ... \n",
379
- "VelCur1yr Velocity, current supply, 1yr \n",
380
- "VtyDayRet180d Volatility, daily returns, 180d \n",
381
- "VtyDayRet30d Volatility, daily returns, 30d \n",
382
- "principal_market_price_usd Principal Market Price, USD \n",
383
- "principal_market_usd Principal Market, USD \n",
384
- "\n",
385
- " description \\\n",
386
- "fields \n",
387
- "AdrActCnt The sum count of unique addresses that were ac... \n",
388
- "AdrBal1in100KCnt The sum count of unique addresses holding at l... \n",
389
- "AdrBal1in100MCnt The sum count of unique addresses holding at l... \n",
390
- "AdrBal1in10BCnt The sum count of unique addresses holding at l... \n",
391
- "AdrBal1in10KCnt The sum count of unique addresses holding at l... \n",
392
- "... ... \n",
393
- "VelCur1yr The ratio of the value transferred (i.e., the ... \n",
394
- "VtyDayRet180d The 180D volatility, measured as the standard ... \n",
395
- "VtyDayRet30d The 30D volatility, measured as the standard d... \n",
396
- "principal_market_price_usd The price of an asset quoted in U.S. dollars d... \n",
397
- "principal_market_usd The asset's principal market, the market with ... \n",
398
- "\n",
399
- " category subcategory unit data_type \\\n",
400
- "fields \n",
401
- "AdrActCnt Addresses Active Addresses bigint \n",
402
- "AdrBal1in100KCnt Addresses Balance Addresses bigint \n",
403
- "AdrBal1in100MCnt Addresses Balance Addresses bigint \n",
404
- "AdrBal1in10BCnt Addresses Balance Addresses bigint \n",
405
- "AdrBal1in10KCnt Addresses Balance Addresses bigint \n",
406
- "... ... ... ... ... \n",
407
- "VelCur1yr Transactions Velocity Dimensionless decimal \n",
408
- "VtyDayRet180d Market Volatility Dimensionless decimal \n",
409
- "VtyDayRet30d Market Volatility Dimensionless decimal \n",
410
- "principal_market_price_usd Market Price USD decimal \n",
411
- "principal_market_usd Market Price USD text \n",
412
- "\n",
413
- " type \\\n",
414
- "fields \n",
415
- "AdrActCnt Sum \n",
416
- "AdrBal1in100KCnt Sum \n",
417
- "AdrBal1in100MCnt Sum \n",
418
- "AdrBal1in10BCnt Sum \n",
419
- "AdrBal1in10KCnt Sum \n",
420
- "... ... \n",
421
- "VelCur1yr Ratio \n",
422
- "VtyDayRet180d Ratio \n",
423
- "VtyDayRet30d Ratio \n",
424
- "principal_market_price_usd N/A \n",
425
- "principal_market_usd N/A \n",
426
- "\n",
427
- " frequencies \\\n",
428
- "fields \n",
429
- "AdrActCnt [{'frequency': '1d', 'assets': ['1inch', 'aave... \n",
430
- "AdrBal1in100KCnt [{'frequency': '1d', 'assets': ['1inch', 'aave... \n",
431
- "AdrBal1in100MCnt [{'frequency': '1d', 'assets': ['1inch', 'aave... \n",
432
- "AdrBal1in10BCnt [{'frequency': '1d', 'assets': ['1inch', 'aave... \n",
433
- "AdrBal1in10KCnt [{'frequency': '1d', 'assets': ['1inch', 'aave... \n",
434
- "... ... \n",
435
- "VelCur1yr [{'frequency': '1d', 'assets': ['1inch', 'aave... \n",
436
- "VtyDayRet180d [{'frequency': '1d', 'assets': ['1inch', 'aave... \n",
437
- "VtyDayRet30d [{'frequency': '1d', 'assets': ['1inch', 'aave... \n",
438
- "principal_market_price_usd [{'frequency': '1s', 'assets': ['1cat', '1inch... \n",
439
- "principal_market_usd [{'frequency': '1s', 'assets': ['1cat', '1inch... \n",
440
- "\n",
441
- " display_name reviewable \n",
442
- "fields \n",
443
- "AdrActCnt Active Addr Cnt NaN \n",
444
- "AdrBal1in100KCnt Addr Cnt with ≥ .001% Supply NaN \n",
445
- "AdrBal1in100MCnt Addr Cnt with ≥ .000001% Supply NaN \n",
446
- "AdrBal1in10BCnt Addr Cnt with ≥ .00000001% Supply NaN \n",
447
- "AdrBal1in10KCnt Addr Cnt with ≥ .01% Supply NaN \n",
448
- "... ... ... \n",
449
- "VelCur1yr 1 Year Current Supply Velocity NaN \n",
450
- "VtyDayRet180d 180 Day Volatility NaN \n",
451
- "VtyDayRet30d 30 Day Volatility NaN \n",
452
- "principal_market_price_usd Principal Market Price NaN \n",
453
- "principal_market_usd Principal Market NaN \n",
454
- "\n",
455
- "[154 rows x 10 columns]"
456
- ]
457
- },
458
- "execution_count": 23,
459
- "metadata": {},
460
- "output_type": "execute_result"
461
- }
462
- ],
463
- "source": [
464
- "cm.get_fields_info()"
465
- ]
466
- },
467
- {
468
- "cell_type": "code",
469
- "execution_count": 24,
470
- "id": "ca1d4fae-2227-4cae-a4ac-174b0a0ceb14",
471
- "metadata": {},
472
- "outputs": [],
473
- "source": [
474
- "# fields dict\n",
475
- "fields_dict = {}\n",
476
- "for field in cm_data_req['fields']:\n",
477
- " if field in cm.fields.index:\n",
478
- " df = cm.fields.loc[field] # get fields metadata\n",
479
- " # add to dict\n",
480
- " fields_dict[field] = df[\"frequencies\"][0][\"assets\"]"
481
- ]
482
- },
483
- {
484
- "cell_type": "code",
485
- "execution_count": 26,
486
- "id": "a94e5537-e847-4f58-aabf-4604ee08d1fe",
487
- "metadata": {},
488
- "outputs": [],
489
- "source": [
490
- "# asset list\n",
491
- "asset_list = list(set.intersection(*(set(val) for val in fields_dict.values())))"
492
- ]
493
- },
494
- {
495
- "cell_type": "code",
496
- "execution_count": 27,
497
- "id": "191bf3dd-b766-40d9-8c52-900ac7233d44",
498
- "metadata": {},
499
- "outputs": [
500
- {
501
- "data": {
502
- "text/plain": [
503
- "['doge', 'dash', 'ltc', 'btg', 'bsv', 'vtc', 'etc', 'bch', 'zec', 'eth', 'btc']"
504
- ]
505
- },
506
- "execution_count": 27,
507
- "metadata": {},
508
- "output_type": "execute_result"
509
- }
510
- ],
511
- "source": [
512
- "asset_list"
513
- ]
514
- },
515
- {
516
- "cell_type": "code",
517
- "execution_count": 28,
518
- "id": "5acd527a-5113-411e-bc25-a3c33b24724a",
519
- "metadata": {},
520
- "outputs": [
521
- {
522
- "data": {
523
- "text/plain": [
524
- "['doge', 'dash', 'ltc', 'btg', 'bsv', 'vtc', 'etc', 'bch', 'zec', 'eth', 'btc']"
525
- ]
526
- },
527
- "execution_count": 28,
528
- "metadata": {},
529
- "output_type": "execute_result"
530
- }
531
- ],
532
- "source": [
533
- "cm.get_onchain_tickers_list(data_req)"
534
- ]
535
- },
536
- {
537
- "cell_type": "code",
538
- "execution_count": null,
539
- "id": "7f6309f8-690f-45ae-a41a-a9c5cc82f809",
540
- "metadata": {},
541
- "outputs": [],
542
- "source": []
543
- },
544
- {
545
- "cell_type": "code",
546
- "execution_count": null,
547
- "id": "53468fdc-5d37-4c48-acbd-f8bb25c7a1f9",
548
- "metadata": {},
549
- "outputs": [],
550
- "source": []
551
- },
552
- {
553
- "cell_type": "code",
554
- "execution_count": null,
555
- "id": "d117171b-f7b2-4369-a2cc-b451a5520dee",
556
- "metadata": {},
557
- "outputs": [],
558
- "source": []
559
- },
560
- {
561
- "cell_type": "code",
562
- "execution_count": null,
563
- "id": "d37dbda3-e270-445a-9880-515defc5bc89",
564
- "metadata": {},
565
- "outputs": [],
566
- "source": [
567
- "cm.get_onchain(data_req)"
568
- ]
569
- },
570
- {
571
- "cell_type": "code",
572
- "execution_count": null,
573
- "id": "43882b56-d405-42cd-b4bd-dc1b5b86c74d",
574
- "metadata": {},
575
- "outputs": [],
576
- "source": [
577
- "params = {\n",
578
- " 'assets': 'sol',\n",
579
- " # 'metrics': ','.join(cm_fields),\n",
580
- " 'metrics': ['AdrActCnt'],\n",
581
- " # 'frequency': cm_data_req['freq'],\n",
582
- " # 'start_time': cm_data_req[\"start_date\"],\n",
583
- " # 'end_time': cm_data_req[\"end_date\"],\n",
584
- " 'pretty': True,\n",
585
- " 'page_size': 10000,\n",
586
- " 'ignore_forbidden_errors': False,\n",
587
- " 'ignore_unsupported_errors': False\n",
588
- "}\n"
589
- ]
590
- },
591
- {
592
- "cell_type": "code",
593
- "execution_count": null,
594
- "id": "d82baeab-53eb-4e82-b0b6-937d2832de39",
595
- "metadata": {},
596
- "outputs": [],
597
- "source": [
598
- "test = cm.req_data(data_type='/timeseries/asset-metrics', params=params)"
599
- ]
600
- },
601
- {
602
- "cell_type": "code",
603
- "execution_count": null,
604
- "id": "4ec273ff-4c92-499f-be68-58f5efe6c083",
605
- "metadata": {},
606
- "outputs": [],
607
- "source": [
608
- "test"
609
- ]
610
- },
611
- {
612
- "cell_type": "code",
613
- "execution_count": null,
614
- "id": "d5819a1e-c516-485a-8ee2-8b47a8285cf2",
615
- "metadata": {},
616
- "outputs": [],
617
- "source": [
618
- "url = cm.base_url + '/timeseries/asset-metrics'"
619
- ]
620
- },
621
- {
622
- "cell_type": "code",
623
- "execution_count": null,
624
- "id": "1de1c783-03f3-46f2-85a5-b3ad15158994",
625
- "metadata": {},
626
- "outputs": [],
627
- "source": [
628
- "response = requests.get(url, params=params)"
629
- ]
630
- },
631
- {
632
- "cell_type": "code",
633
- "execution_count": null,
634
- "id": "ad3e9ecc-ab04-4c78-8348-a6fcef7c028d",
635
- "metadata": {},
636
- "outputs": [],
637
- "source": [
638
- "response.status_code"
639
- ]
640
- },
641
- {
642
- "cell_type": "code",
643
- "execution_count": null,
644
- "id": "bd2715bb-f41c-41ad-8d0b-f69f99f28413",
645
- "metadata": {},
646
- "outputs": [],
647
- "source": []
648
- },
649
- {
650
- "cell_type": "code",
651
- "execution_count": null,
652
- "id": "f98462f3-2165-49b7-913a-41b52e3a0a61",
653
- "metadata": {},
654
- "outputs": [],
655
- "source": []
656
- },
657
- {
658
- "cell_type": "code",
659
- "execution_count": null,
660
- "id": "a9d46f95-262d-4c78-9743-6c9a89546457",
661
- "metadata": {},
662
- "outputs": [],
663
- "source": [
664
- "test = cm.get_onchain(data_req)"
665
- ]
666
- },
667
- {
668
- "cell_type": "code",
669
- "execution_count": null,
670
- "id": "383a2d6b-8b09-492a-9d36-d022ae59e50a",
671
- "metadata": {},
672
- "outputs": [],
673
- "source": [
674
- "test"
675
- ]
676
- },
677
- {
678
- "cell_type": "code",
679
- "execution_count": null,
680
- "id": "f1277788-5678-47ac-94ec-77cabcdd42c1",
681
- "metadata": {},
682
- "outputs": [],
683
- "source": []
684
- },
685
- {
686
- "cell_type": "code",
687
- "execution_count": null,
688
- "id": "766a3491-bb09-47d7-8aa5-40cc3725de71",
689
- "metadata": {},
690
- "outputs": [],
691
- "source": []
692
- },
693
- {
694
- "cell_type": "code",
695
- "execution_count": null,
696
- "id": "565ab686-2df2-4b0f-8717-a72fe60192f4",
697
- "metadata": {},
698
- "outputs": [],
699
- "source": []
700
- },
701
- {
702
- "cell_type": "code",
703
- "execution_count": null,
704
- "id": "cfe69a68-899c-4369-9cc3-191025d74fde",
705
- "metadata": {},
706
- "outputs": [],
707
- "source": []
708
- },
709
- {
710
- "cell_type": "code",
711
- "execution_count": null,
712
- "id": "fbe2ff25-8f9c-48f2-a683-8f7254963b1c",
713
- "metadata": {},
714
- "outputs": [],
715
- "source": []
716
- },
717
- {
718
- "cell_type": "code",
719
- "execution_count": null,
720
- "id": "5e158ea0-b0e4-4be0-80d2-c0afc2bf650b",
721
- "metadata": {},
722
- "outputs": [],
723
- "source": []
724
- }
725
- ],
726
- "metadata": {
727
- "kernelspec": {
728
- "display_name": "Python [conda env:cryptodatapy]",
729
- "language": "python",
730
- "name": "conda-env-cryptodatapy-py"
731
- },
732
- "language_info": {
733
- "codemirror_mode": {
734
- "name": "ipython",
735
- "version": 3
736
- },
737
- "file_extension": ".py",
738
- "mimetype": "text/x-python",
739
- "name": "python",
740
- "nbconvert_exporter": "python",
741
- "pygments_lexer": "ipython3",
742
- "version": "3.9.12"
743
- }
744
- },
745
- "nbformat": 4,
746
- "nbformat_minor": 5
747
- }