Load dataset card
Browse files
README.md
CHANGED
@@ -1,3 +1,394 @@
|
|
1 |
-
---
|
2 |
-
license: mit
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
tags:
|
4 |
+
- finance
|
5 |
+
size_categories:
|
6 |
+
- 1M<n<10M
|
7 |
+
---
|
8 |
+
# DeFi Protocol Data on Ethereum 2023-2024
|
9 |
+
This section outlines the steps involved in preparing the dataset for analyzing decentralized finance (DeFi) protocols and transactions. The process includes selecting DeFi protocols, extracting relevant contract data, collecting transaction information, and analyzing market trends.
|
10 |
+
The dataset enables a comprehensive analysis of user behavior, protocol usage, transaction dynamics, and market performance on ethereum blockchain.
|
11 |
+
|
12 |
+
## Dataset
|
13 |
+
```
|
14 |
+
├── protocols.parquet # Contains protocols details for selected DeFi protocols.
|
15 |
+
├── contracts.parquet # Contains contract details for selected DeFi protocols.
|
16 |
+
├── transactions.parquet # Contains transaction data for Ethereum-based contracts.
|
17 |
+
├── market.parquet # Contains enriched market data with aggregated transaction metrics.
|
18 |
+
└── users.parquet # User profiles based on transaction data.
|
19 |
+
```
|
20 |
+
---
|
21 |
+
## Table of Contents
|
22 |
+
1. [Selection of DeFi Protocols](#1-selection-of-defi-protocols)
|
23 |
+
2. [Collection of Contract Data for Selected DeFi Protocols *(CoinGecko API)*](#2-collection-of-contract-data-for-selected-defi-protocols-coingecko-api)
|
24 |
+
3. [Collection of Transactions for Ethereum-Based Contracts *(Etherscan API)*](#3-collection-of-transactions-for-ethereum-based-contracts-etherscan-api)
|
25 |
+
4. [Generation of User Profiles Based on Transaction Data](#4-generation-of-user-profiles-based-on-transaction-data)
|
26 |
+
5. [Collection of Market OHLC Data for Tokens *(YahooFinance API)*](#5-collection-of-market-ohlc-data-for-tokens-yahoofinance-api)
|
27 |
+
6. [Enrichment of Market Data via Transaction Aggregation](#6-enrichment-of-market-data-via-transaction-aggregation)
|
28 |
+
---
|
29 |
+
## 1. Selection of DeFi Protocols
|
30 |
+
In this first step, we select multiple DeFi protocols that represent different categories of financial services in the decentralized ecosystem. This includes protocols for decentralized exchanges (DEX), lending platforms, stablecoins, and NFT-based finance.
|
31 |
+
|
32 |
+
### Protocols type: `('DEX': 3, 'Lending': 2, 'Yield Farming': 2, 'Stablecoin': 3, 'NFT-Fi': 1)`
|
33 |
+
|
34 |
+
```python
|
35 |
+
KEY_PROTOCOLS = [
|
36 |
+
"uniswap", # DEX
|
37 |
+
"curve-dao-token", # DEX
|
38 |
+
"balancer", # DEX
|
39 |
+
"aave", # Lending
|
40 |
+
"maker", # Lending
|
41 |
+
"yearn-finance", # Yield Farming
|
42 |
+
"harvest-finance", # Yield Farming
|
43 |
+
"dai", # Stablecoin
|
44 |
+
"usd-coin", # Stablecoin
|
45 |
+
"tether", # Stablecoin
|
46 |
+
"nftfi", # NFT-Fi (optionnel)
|
47 |
+
]
|
48 |
+
```
|
49 |
+
### Objective
|
50 |
+
To define a set of popular and diverse DeFi protocols that will serve as the basis for data collection and analysis.
|
51 |
+
|
52 |
+
---
|
53 |
+
## 2. Collection of Contract Data for Selected DeFi Protocols *(CoinGecko API)*
|
54 |
+
### Collection name: `protocols` - *(11 documents)*
|
55 |
+
For each selected protocol, we extract contract information from *CoinGecko’s API*. This data contains the contract addresses on the blockchain, the type of protocol, and additional details like market capitalization rank and protocol description.
|
56 |
+
|
57 |
+
### Fields
|
58 |
+
#### 1. `_id` *(ObjectId)* - The unique identifier for this document in the database.
|
59 |
+
#### 2. `protocol_id` *(String)* - A unique identifier for the protocol (in this case, for Uniswap).
|
60 |
+
#### 3. `blockchain_contracts` *(Array of Objects)* - Contains a list of blockchain contracts associated with the asset.
|
61 |
+
- `blockchain` *(String)* - The name of the blockchain.
|
62 |
+
- `contract` *(String)* - The address of the protocol contract on the blockchain.
|
63 |
+
#### 4. `description` *(String)* - A brief description of the protocol.
|
64 |
+
#### 5. `market_cap_rank` *(Integer)* - The rank of the protocol based on market capitalization.
|
65 |
+
#### 6. `name` *(String)* - The name of the protocol.
|
66 |
+
#### 7. `symbol` *(String)* - The symbol of the protocol.
|
67 |
+
#### 8. `type` *(String)* - The type of protocol (e.g., DEX, Lending).
|
68 |
+
#### 9. `website_url` *(String)* - The URL of the protocol's official website.
|
69 |
+
|
70 |
+
### Exemple
|
71 |
+
```json
|
72 |
+
{
|
73 |
+
"_id": {
|
74 |
+
"$oid": "678a6dbb7824a40cf5948a3a"
|
75 |
+
},
|
76 |
+
"protocol_id": "a32977262a1f49ca460aa0f158e86b03",
|
77 |
+
"blockchain_contracts": [
|
78 |
+
{
|
79 |
+
"blockchain": "ethereum",
|
80 |
+
"contract": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"
|
81 |
+
}
|
82 |
+
],
|
83 |
+
"description": "UNI is the governance token for Uniswap, an Automated Market Marker DEX on the Ethereum blockchain. The UNI token allows token holders to participate in the governance of the protocol. Key decisions such as usage of the treasury or future upgrades ca",
|
84 |
+
"market_cap_rank": 26,
|
85 |
+
"name": "Uniswap",
|
86 |
+
"symbol": "uni",
|
87 |
+
"type": "DEX",
|
88 |
+
"website_url": "https://uniswap.org/"
|
89 |
+
}
|
90 |
+
```
|
91 |
+
### Objective
|
92 |
+
To retrieve the smart contract details associated with each protocol, enabling further analysis of transactions and interactions with the protocol on the blockchain.
|
93 |
+
|
94 |
+
---
|
95 |
+
## 3. Collection of Transactions for Ethereum-Based Contracts *(Etherscan API)*
|
96 |
+
### Collection name: `transactions` - *(22 682 739 documents)*
|
97 |
+
We use an API such as Etherscan to gather transaction data related to the selected Ethereum-based contracts. The data includes transaction hashes, sender and receiver addresses, gas usage, and transaction values.
|
98 |
+
|
99 |
+
#### Timeframe:
|
100 |
+
* Start: `2022-12-31T22:59:59.000Z`
|
101 |
+
* End: `2024-12-30T23:00:11.000Z`
|
102 |
+
|
103 |
+
### Fields
|
104 |
+
#### 1. `_id` *(ObjectId)* - The unique identifier for this document in the database.
|
105 |
+
#### 2. `transaction_hash` *(String)* - The hash of the transaction.
|
106 |
+
#### 3. `error_code` *(String)* - The error code for the transaction, if any.
|
107 |
+
#### 4. `from` *(String)* - The address of the sender.
|
108 |
+
#### 5. `gas` *(Integer)* - The amount of gas proposed for the transaction.
|
109 |
+
#### 6. `gas_used` *(Integer)* - The amount of gas actually used in the transaction.
|
110 |
+
#### 7. `is_error` *(String)* - Indicates if there was an error during the transaction ("0" for no error, "1" for error).
|
111 |
+
#### 8. `metadata` *(Object)* - Contains additional details about the protocol.
|
112 |
+
- `protocol_name` *(String)* - The name of the protocol associated with the transaction.
|
113 |
+
- `type` *(String)* - The type of the protocol (e.g., DEX, Lending).
|
114 |
+
- `blockchain` *(String)* - The name of the blockchain (in this case, Ethereum).
|
115 |
+
- `contract_id` *(String)* - The unique identifier of the contract involved in the transaction.
|
116 |
+
#### 9. `timestamp` *(Date)* - The timestamp when the transaction occurred.
|
117 |
+
#### 10. `to` *(String)* - The address of the recipient.
|
118 |
+
#### 11. `trace_id` *(String)* - The trace identifier for tracking the transaction.
|
119 |
+
#### 12. `tx_hash` *(String)* - A duplicate of the `transaction_hash` field.
|
120 |
+
#### 13. `value (ETH)` *(Float)* - The amount of ETH transferred in the transaction.
|
121 |
+
|
122 |
+
### Example
|
123 |
+
```json
|
124 |
+
{
|
125 |
+
"_id": {
|
126 |
+
"$oid": "678bf7cf9ebf7cf7c1a3a88e"
|
127 |
+
},
|
128 |
+
"transaction_hash": "0x50edd2873907a3454a9c8cc8d242b6d0e365ec71263e4fb8cb9e935e151fcbaa",
|
129 |
+
"error_code": "",
|
130 |
+
"from": "0xbe6e45661c633fd1a1825389dec680e62c1c7d51",
|
131 |
+
"gas": 57218,
|
132 |
+
"gas_used": 52418,
|
133 |
+
"is_error": "0",
|
134 |
+
"metadata": {
|
135 |
+
"protocol_name": "Uniswap",
|
136 |
+
"type": "DEX",
|
137 |
+
"blockchain": "ethereum",
|
138 |
+
"contract_id": "c944b5855a3b2d8cbe4367a3f7561854"
|
139 |
+
},
|
140 |
+
"timestamp": {
|
141 |
+
"$date": "2023-12-31T23:00:23.000Z"
|
142 |
+
},
|
143 |
+
"to": "0x0231b537b8f1c46b6cb4f7d9ec6d56951a66ff41",
|
144 |
+
"trace_id": "",
|
145 |
+
"tx_hash": "0x50edd2873907a3454a9c8cc8d242b6d0e365ec71263e4fb8cb9e935e151fcbaa",
|
146 |
+
"value (ETH)": 12.201526377331376
|
147 |
+
}
|
148 |
+
```
|
149 |
+
### Objective
|
150 |
+
To collect transaction data associated with the Ethereum smart contracts, allowing for an analysis of activity, user behavior, and protocol usage over time.
|
151 |
+
|
152 |
+
---
|
153 |
+
## 4. Generation of User Profiles Based on Transaction Data
|
154 |
+
### Collection name: `users` - *(6 876 845 documents)*
|
155 |
+
By analyzing transaction data, we identify and create user profiles based on the Ethereum addresses involved in transactions. This step allows for tracking users’ activities across different protocols and their total received and sent amounts.
|
156 |
+
|
157 |
+
### Fields
|
158 |
+
#### 1. `_id` *(ObjectId)* - The unique identifier for this document in the database.
|
159 |
+
#### 2. `address` *(String)* - The Ethereum address of the user.
|
160 |
+
#### 3. `first_seen` *(Date)* - The timestamp when the address was first observed in the dataset.
|
161 |
+
#### 4. `last_seen` *(Date)* - The timestamp when the address was last observed in the dataset.
|
162 |
+
#### 5. `protocol_types` *(Object)* - A count of the types of protocols the user has interacted with, grouped by protocol type (e.g., DEX, Lending).
|
163 |
+
#### 6. `protocols_used` *(Object)* - A breakdown of protocols the user interacted with, containing:
|
164 |
+
- **Protocol name** *(String)* - The name of the protocol (e.g., Curve DAO, Aave).
|
165 |
+
- `count` *(Integer)* - The number of interactions with the protocol.
|
166 |
+
- `blockchain` *(String)* - The blockchain on which the protocol operates.
|
167 |
+
- `contract_id` *(String)* - The unique identifier of the protocol's contract.
|
168 |
+
#### 7. `received_count` *(Integer)* - The number of transactions in which the user received assets.
|
169 |
+
#### 8. `sent_count` *(Integer)* - The number of transactions in which the user sent assets.
|
170 |
+
#### 9. `total_received (ETH)` *(Float)* - The total amount of ETH received by the user.
|
171 |
+
#### 10. `total_sent (ETH)` *(Float)* - The total amount of ETH sent by the user.
|
172 |
+
#### 11. `transactions` *(Array of Objects)* - Details of individual transactions involving the user.
|
173 |
+
- `transaction_hash` *(String)* - The hash of the transaction.
|
174 |
+
- `timestamp` *(Date)* - The timestamp of the transaction.
|
175 |
+
- `value (ETH)` *(Float)* - The amount of ETH transferred in the transaction.
|
176 |
+
- `is_sender` *(Boolean)* - Indicates whether the user was the sender in the transaction.
|
177 |
+
- `gas_used` *(Integer)* - The amount of gas used in the transaction.
|
178 |
+
- `protocol_name` *(String)* - The name of the protocol associated with the transaction.
|
179 |
+
- `protocol_type` *(String)* - The type of protocol (e.g., DEX, Lending).
|
180 |
+
- `blockchain` *(String)* - The name of the blockchain (e.g., Ethereum).
|
181 |
+
- `contract_id` *(String)* - The unique identifier of the protocol's contract involved in the transaction.
|
182 |
+
|
183 |
+
### Example
|
184 |
+
```json
|
185 |
+
{
|
186 |
+
"_id": {
|
187 |
+
"$oid": "678cf88798ededf702ec1766"
|
188 |
+
},
|
189 |
+
"address": "0x2deacac3a34ace696d3fe214a07882949311e81b",
|
190 |
+
"first_seen": {
|
191 |
+
"$date": "2023-01-07T22:05:35.000Z"
|
192 |
+
},
|
193 |
+
"last_seen": {
|
194 |
+
"$date": "2023-01-21T12:46:35.000Z"
|
195 |
+
},
|
196 |
+
"protocol_types": {
|
197 |
+
"DEX": 1,
|
198 |
+
"Lending": 1
|
199 |
+
},
|
200 |
+
"protocols_used": {
|
201 |
+
"Curve DAO": {
|
202 |
+
"count": 1,
|
203 |
+
"blockchain": "ethereum",
|
204 |
+
"contract_id": "6c78ebb89739952c2d1b03a051f79287"
|
205 |
+
},
|
206 |
+
"Aave": {
|
207 |
+
"count": 1,
|
208 |
+
"blockchain": "ethereum",
|
209 |
+
"contract_id": "e82fc843c812403d08dca5ab89b772d5"
|
210 |
+
}
|
211 |
+
},
|
212 |
+
"received_count": 2,
|
213 |
+
"sent_count": 0,
|
214 |
+
"total_received (ETH)": 23.00372511606387,
|
215 |
+
"total_sent (ETH)": 0,
|
216 |
+
"transactions": [
|
217 |
+
{
|
218 |
+
"transaction_hash": "0x7de2510bd9efdb0fcbb358aac92473361026ad6cc8a49cbfcef5d88856eb1fe5",
|
219 |
+
"timestamp": {
|
220 |
+
"$date": "2023-01-07T22:05:35.000Z"
|
221 |
+
},
|
222 |
+
"value (ETH)": 23,
|
223 |
+
"is_sender": false,
|
224 |
+
"gas_used": 34225,
|
225 |
+
"protocol_name": "Curve DAO",
|
226 |
+
"protocol_type": "DEX",
|
227 |
+
"blockchain": "ethereum",
|
228 |
+
"contract_id": "6c78ebb89739952c2d1b03a051f79287"
|
229 |
+
},
|
230 |
+
{
|
231 |
+
"transaction_hash": "0xb355bdf9cf819810d09ed6041358d3dd4bfc45b0a55ea9555b5e8360f68c3a98",
|
232 |
+
"timestamp": {
|
233 |
+
"$date": "2023-01-21T12:46:35.000Z"
|
234 |
+
},
|
235 |
+
"value (ETH)": 0.003725116063867235,
|
236 |
+
"is_sender": false,
|
237 |
+
"gas_used": 237828,
|
238 |
+
"protocol_name": "Aave",
|
239 |
+
"protocol_type": "Lending",
|
240 |
+
"blockchain": "ethereum",
|
241 |
+
"contract_id": "e82fc843c812403d08dca5ab89b772d5"
|
242 |
+
}
|
243 |
+
]
|
244 |
+
}
|
245 |
+
```
|
246 |
+
### Objective
|
247 |
+
To track user behavior across different DeFi protocols, focusing on received and sent transaction counts and totals. This will help in understanding user engagement with various protocols.
|
248 |
+
|
249 |
+
---
|
250 |
+
## 5. Collection of Market OHLC Data for Tokens *(YahooFinance API)*
|
251 |
+
### Collection name: `market` - *(177 955 documents)*
|
252 |
+
We then enrich the transaction data by extracting market data for the associated tokens using sources like YahooFinance API. This includes Open, High, Low, and Close (OHLC) values for the token in USD.
|
253 |
+
|
254 |
+
### Fields
|
255 |
+
#### 1. `_id` *(ObjectId)* - The unique identifier for this document in the database.
|
256 |
+
#### 2. `timestamp` *(Date)* - The date and time when the market data was recorded.
|
257 |
+
#### 3. `contract_address` *(String)* - The address of the token contract associated with the market data.
|
258 |
+
#### 4. `symbol` *(String)* - The symbol of the token (e.g., UNI for Uniswap).
|
259 |
+
#### 5. `blockchain` *(String)* - The blockchain where the token operates (e.g., Ethereum).
|
260 |
+
#### 6. `close (usd)` *(Float)* - The closing price of the token in USD for the specified timestamp.
|
261 |
+
#### 7. `high (usd)` *(Float)* - The highest price of the token in USD during the specified period.
|
262 |
+
#### 8. `low (usd)` *(Float)* - The lowest price of the token in USD during the specified period.
|
263 |
+
#### 9. `open (usd)` *(Float)* - The opening price of the token in USD for the specified timestamp.
|
264 |
+
#### 10. `protocol_name` *(String)* - The name of the protocol associated with the token (e.g., Uniswap).
|
265 |
+
#### 11. `type` *(String)* - The type of the protocol (e.g., DEX, Lending).
|
266 |
+
#### 12. `volume` *(Float)* - The trading volume for the token during the specified period.
|
267 |
+
|
268 |
+
### Example
|
269 |
+
```json
|
270 |
+
{
|
271 |
+
"_id": {
|
272 |
+
"$oid": "678e7d11a552daf8aeb188c3"
|
273 |
+
},
|
274 |
+
"timestamp": {
|
275 |
+
"$date": "2023-01-22T00:00:00.000Z"
|
276 |
+
},
|
277 |
+
"contract_address": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984",
|
278 |
+
"symbol": "uni",
|
279 |
+
"blockchain": "ethereum",
|
280 |
+
"close (usd)": 0.0002288398682139814,
|
281 |
+
"high (usd)": 0.00022923298820387572,
|
282 |
+
"low (usd)": 0.00022784991597291082,
|
283 |
+
"open (usd)": 0.00022784991597291082,
|
284 |
+
"protocol_name": "Uniswap",
|
285 |
+
"type": "DEX",
|
286 |
+
"volume": 0
|
287 |
+
}
|
288 |
+
```
|
289 |
+
### Objective
|
290 |
+
To integrate market data into the transaction dataset, enabling the analysis of token price movements and their correlation with transaction activity over time.
|
291 |
+
|
292 |
+
---
|
293 |
+
## 6. Enrichment of Market Data via Transaction Aggregation
|
294 |
+
### Collection name: `market_enriched` - *(177 955 documents)*
|
295 |
+
We aggregate transaction data to calculate key metrics like average gas used, transaction value, and unique participants over specified time frames. This enriched data allows for better insights into transaction trends and protocol usage.
|
296 |
+
|
297 |
+
### Fields
|
298 |
+
#### 1. `_id` *(ObjectId)* - The unique identifier for this document in the database.
|
299 |
+
#### 2. `avg_gas_used` *(Float)* - The average gas used in transactions over the last hour and 24 hours.
|
300 |
+
#### 3. `avg_value_eth_per_tx` *(Float)* - The average transaction value in ETH over the last hour and 24 hours.
|
301 |
+
#### 4. `blockchain` *(String)* - The blockchain where the protocol operates (e.g., Ethereum).
|
302 |
+
#### 5. `close (usd)` *(Float)* - The closing price of the token in USD for the specified timestamp.
|
303 |
+
#### 6. `contract_address` *(String)* - The address of the token contract associated with the data.
|
304 |
+
#### 7. `error_rate` *(Float)* - The percentage of transactions with errors over the last hour and 24 hours.
|
305 |
+
#### 8. `high (usd)` *(Float)* - The highest price of the token in USD during the specified period.
|
306 |
+
#### 9. `low (usd)` *(Float)* - The lowest price of the token in USD during the specified period.
|
307 |
+
#### 10. `max_gas_used` *(Integer)* - The maximum gas used in a transaction over the last hour and 24 hours.
|
308 |
+
#### 11. `max_value_eth` *(Float)* - The maximum transaction value in ETH over the last hour and 24 hours.
|
309 |
+
#### 12. `median_value_eth` *(Float)* - The median transaction value in ETH over the last hour and 24 hours.
|
310 |
+
#### 13. `min_gas_used` *(Integer)* - The minimum gas used in a transaction over the last hour and 24 hours.
|
311 |
+
#### 14. `min_value_eth` *(Float)* - The minimum transaction value in ETH over the last hour and 24 hours.
|
312 |
+
#### 15. `nb_tx` *(Integer)* - The total number of transactions over the last hour and 24 hours.
|
313 |
+
#### 16. `nb_unique_receivers` *(Integer)* - The number of unique receiver addresses over the last hour and 24 hours.
|
314 |
+
#### 17. `nb_unique_senders` *(Integer)* - The number of unique sender addresses over the last hour and 24 hours.
|
315 |
+
#### 18. `num_errors` *(Integer)* - The total number of transactions with errors over the last hour and 24 hours.
|
316 |
+
#### 19. `open (usd)` *(Float)* - The opening price of the token in USD for the specified timestamp.
|
317 |
+
#### 20. `protocol_name` *(String)* - The name of the protocol associated with the token.
|
318 |
+
#### 21. `std_gas_used` *(Float)* - The standard deviation of gas used in transactions over the last hour and 24 hours.
|
319 |
+
#### 22. `std_value_eth` *(Float)* - The standard deviation of transaction values in ETH over the last hour and 24 hours.
|
320 |
+
#### 23. `symbol` *(String)* - The symbol of the token (e.g., NFTFI).
|
321 |
+
#### 24. `timestamp` *(Date)* - The date and time of the aggregated data.
|
322 |
+
#### 25. `total_gas_used` *(Integer)* - The total gas used in transactions over the last hour and 24 hours.
|
323 |
+
#### 26. `total_value_eth` *(Float)* - The total transaction value in ETH over the last hour and 24 hours.
|
324 |
+
#### 27. `type` *(String)* - The type of the protocol (e.g., NFT-Fi).
|
325 |
+
#### 28. `volume` *(Float)* - The trading volume for the token during the specified period.
|
326 |
+
|
327 |
+
### Example
|
328 |
+
```json
|
329 |
+
{
|
330 |
+
"_id": {
|
331 |
+
"$oid": "678e7d1ca552daf8aeb42f81"
|
332 |
+
},
|
333 |
+
"avg_gas_used_1h": 0,
|
334 |
+
"avg_gas_used_24h": 88387.36363636363,
|
335 |
+
"avg_value_eth_per_tx_1h": 0,
|
336 |
+
"avg_value_eth_per_tx_24h": 98435.44979489372,
|
337 |
+
"blockchain": "ethereum",
|
338 |
+
"close (usd)": 0.0033522879239171743,
|
339 |
+
"contract_address": "0x09d6f0f5a21f5be4f59e209747e2d07f50bc694c",
|
340 |
+
"error_rate_1h": 0,
|
341 |
+
"error_rate_24h": 0,
|
342 |
+
"high (usd)": 0.003360767150297761,
|
343 |
+
"low (usd)": 0.003341925796121359,
|
344 |
+
"max_gas_used_1h": 0,
|
345 |
+
"max_gas_used_24h": 128672,
|
346 |
+
"max_value_eth_1h": 0,
|
347 |
+
"max_value_eth_24h": 173027.368086,
|
348 |
+
"median_value_eth_1h": 0,
|
349 |
+
"median_value_eth_24h": 20308,
|
350 |
+
"min_gas_used_1h": 0,
|
351 |
+
"min_gas_used_24h": 46674,
|
352 |
+
"min_value_eth_1h": 0,
|
353 |
+
"min_value_eth_24h": 8627,
|
354 |
+
"nb_tx_1h": 0,
|
355 |
+
"nb_tx_24h": 11,
|
356 |
+
"nb_unique_receivers_1h": 0,
|
357 |
+
"nb_unique_receivers_24h": 6,
|
358 |
+
"nb_unique_senders_1h": 0,
|
359 |
+
"nb_unique_senders_24h": 6,
|
360 |
+
"num_errors_1h": 0,
|
361 |
+
"num_errors_24h": 0,
|
362 |
+
"open (usd)": 0.003341925796121359,
|
363 |
+
"protocol_name": "NFTFI",
|
364 |
+
"std_gas_used_1h": 0,
|
365 |
+
"std_gas_used_24h": 27197.175038036337,
|
366 |
+
"std_value_eth_1h": 0,
|
367 |
+
"std_value_eth_24h": 61448.22032504086,
|
368 |
+
"symbol": "nftfi",
|
369 |
+
"timestamp": {
|
370 |
+
"$date": "2024-08-10T06:00:00.000Z"
|
371 |
+
},
|
372 |
+
"total_gas_used_1h": 0,
|
373 |
+
"total_gas_used_24h": 972261,
|
374 |
+
"total_value_eth_1h": 0,
|
375 |
+
"total_value_eth_24h": 1082789.947743831,
|
376 |
+
"type": "NFT-Fi",
|
377 |
+
"volume": 0
|
378 |
+
}
|
379 |
+
```
|
380 |
+
### Objective
|
381 |
+
To aggregate transaction and market data into meaningful metrics that represent the overall health and activity of the protocols, facilitating trend analysis.
|
382 |
+
|
383 |
+
---
|
384 |
+
## Credits
|
385 |
+
This dataset preparation process establishes the foundation for analysis of user behavior, market trends, and protocol performance within the DeFi space. Each step builds upon the previous one, ensuring that the final dataset is rich and well-structured for deeper insights. It includes various technical steps for data extraction, user profiling, and market data aggregation, based on a combination of APIs and data sources. Special thanks to the following sources and tools used in this process:
|
386 |
+
1. **CoinGecko API** - For contract data related to DeFi protocols and their market details.
|
387 |
+
2. **Etherscan API** - For transaction data extraction on Ethereum smart contracts.
|
388 |
+
3. **Yahoo Finance API** - For market data including OHLC values of tokens and trading volume.
|
389 |
+
4. **MongoDB** - For managing and storing large volumes of transaction and protocol data in a structured format.
|
390 |
+
5. **Ethereum Blockchain** - For the decentralized financial infrastructure that powers these protocols and transactions.
|
391 |
+
|
392 |
+
---
|
393 |
+
license: mit
|
394 |
+
---
|