rosacastillo commited on
Commit
e2b8c08
·
1 Parent(s): 0b75f04

cleaning notebooks folder

Browse files
notebooks/markets_analysis.ipynb CHANGED
@@ -15,13 +15,75 @@
15
  },
16
  {
17
  "cell_type": "code",
18
- "execution_count": 5,
19
  "metadata": {},
20
  "outputs": [],
21
  "source": [
22
  "fpmms = pd.read_parquet('../data/all_fpmms.parquet')"
23
  ]
24
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  {
26
  "cell_type": "code",
27
  "execution_count": 6,
@@ -1308,7 +1370,7 @@
1308
  "name": "python",
1309
  "nbconvert_exporter": "python",
1310
  "pygments_lexer": "ipython3",
1311
- "version": "3.12.3"
1312
  }
1313
  },
1314
  "nbformat": 4,
 
15
  },
16
  {
17
  "cell_type": "code",
18
+ "execution_count": 2,
19
  "metadata": {},
20
  "outputs": [],
21
  "source": [
22
  "fpmms = pd.read_parquet('../data/all_fpmms.parquet')"
23
  ]
24
  },
25
+ {
26
+ "cell_type": "code",
27
+ "execution_count": 3,
28
+ "metadata": {},
29
+ "outputs": [],
30
+ "source": [
31
+ "markets = pd.read_parquet('../data/fpmms.parquet')"
32
+ ]
33
+ },
34
+ {
35
+ "cell_type": "code",
36
+ "execution_count": 4,
37
+ "metadata": {},
38
+ "outputs": [
39
+ {
40
+ "name": "stdout",
41
+ "output_type": "stream",
42
+ "text": [
43
+ "<class 'pandas.core.frame.DataFrame'>\n",
44
+ "RangeIndex: 4688 entries, 0 to 4687\n",
45
+ "Data columns (total 4 columns):\n",
46
+ " # Column Non-Null Count Dtype \n",
47
+ "--- ------ -------------- ----- \n",
48
+ " 0 currentAnswer 4688 non-null object\n",
49
+ " 1 id 4688 non-null object\n",
50
+ " 2 title 4688 non-null object\n",
51
+ " 3 market_creator 4688 non-null object\n",
52
+ "dtypes: object(4)\n",
53
+ "memory usage: 146.6+ KB\n"
54
+ ]
55
+ }
56
+ ],
57
+ "source": [
58
+ "markets.info()"
59
+ ]
60
+ },
61
+ {
62
+ "cell_type": "code",
63
+ "execution_count": 5,
64
+ "metadata": {},
65
+ "outputs": [
66
+ {
67
+ "data": {
68
+ "text/plain": [
69
+ "currentAnswer\n",
70
+ "No 2771\n",
71
+ "Yes 1914\n",
72
+ "no 1\n",
73
+ "False 1\n",
74
+ "IND 1\n",
75
+ "Name: count, dtype: int64"
76
+ ]
77
+ },
78
+ "execution_count": 5,
79
+ "metadata": {},
80
+ "output_type": "execute_result"
81
+ }
82
+ ],
83
+ "source": [
84
+ "markets.currentAnswer.value_counts()"
85
+ ]
86
+ },
87
  {
88
  "cell_type": "code",
89
  "execution_count": 6,
 
1370
  "name": "python",
1371
  "nbconvert_exporter": "python",
1372
  "pygments_lexer": "ipython3",
1373
+ "version": "3.12.2"
1374
  }
1375
  },
1376
  "nbformat": 4,
notebooks/tools_accuracy.ipynb ADDED
@@ -0,0 +1,1130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 29,
6
+ "metadata": {},
7
+ "outputs": [],
8
+ "source": [
9
+ "import pandas as pd\n",
10
+ "import matplotlib.pyplot as plt\n",
11
+ "import seaborn as sns\n",
12
+ "import json\n",
13
+ "sns.set_style(\"darkgrid\")"
14
+ ]
15
+ },
16
+ {
17
+ "cell_type": "code",
18
+ "execution_count": 41,
19
+ "metadata": {},
20
+ "outputs": [],
21
+ "source": [
22
+ "tools = pd.read_parquet('../data/tools.parquet')"
23
+ ]
24
+ },
25
+ {
26
+ "cell_type": "code",
27
+ "execution_count": 42,
28
+ "metadata": {},
29
+ "outputs": [
30
+ {
31
+ "name": "stdout",
32
+ "output_type": "stream",
33
+ "text": [
34
+ "<class 'pandas.core.frame.DataFrame'>\n",
35
+ "RangeIndex: 133835 entries, 0 to 133834\n",
36
+ "Data columns (total 23 columns):\n",
37
+ " # Column Non-Null Count Dtype \n",
38
+ "--- ------ -------------- ----- \n",
39
+ " 0 request_id 133835 non-null object \n",
40
+ " 1 request_block 133835 non-null object \n",
41
+ " 2 prompt_request 133835 non-null object \n",
42
+ " 3 tool 133835 non-null object \n",
43
+ " 4 nonce 133835 non-null object \n",
44
+ " 5 trader_address 133835 non-null object \n",
45
+ " 6 deliver_block 133835 non-null object \n",
46
+ " 7 error 133835 non-null int64 \n",
47
+ " 8 error_message 1873 non-null object \n",
48
+ " 9 prompt_response 133664 non-null object \n",
49
+ " 10 mech_address 133664 non-null object \n",
50
+ " 11 p_yes 131962 non-null float64\n",
51
+ " 12 p_no 131962 non-null float64\n",
52
+ " 13 confidence 131962 non-null float64\n",
53
+ " 14 info_utility 131962 non-null float64\n",
54
+ " 15 vote 104902 non-null object \n",
55
+ " 16 win_probability 131962 non-null float64\n",
56
+ " 17 title 133835 non-null object \n",
57
+ " 18 currentAnswer 107007 non-null object \n",
58
+ " 19 request_time 133835 non-null object \n",
59
+ " 20 request_month_year 133835 non-null object \n",
60
+ " 21 request_month_year_week 133835 non-null object \n",
61
+ " 22 market_creator 133835 non-null object \n",
62
+ "dtypes: float64(5), int64(1), object(17)\n",
63
+ "memory usage: 23.5+ MB\n"
64
+ ]
65
+ }
66
+ ],
67
+ "source": [
68
+ "tools.info()"
69
+ ]
70
+ },
71
+ {
72
+ "cell_type": "code",
73
+ "execution_count": 23,
74
+ "metadata": {},
75
+ "outputs": [
76
+ {
77
+ "data": {
78
+ "text/plain": [
79
+ "dict"
80
+ ]
81
+ },
82
+ "execution_count": 23,
83
+ "metadata": {},
84
+ "output_type": "execute_result"
85
+ }
86
+ ],
87
+ "source": [
88
+ "import pickle\n",
89
+ "t_map = pickle.load(open(\"../data/t_map.pkl\", \"rb\"))\n",
90
+ "type(t_map)"
91
+ ]
92
+ },
93
+ {
94
+ "cell_type": "code",
95
+ "execution_count": 24,
96
+ "metadata": {},
97
+ "outputs": [
98
+ {
99
+ "data": {
100
+ "text/plain": [
101
+ "475329"
102
+ ]
103
+ },
104
+ "execution_count": 24,
105
+ "metadata": {},
106
+ "output_type": "execute_result"
107
+ }
108
+ ],
109
+ "source": [
110
+ "len(t_map)"
111
+ ]
112
+ },
113
+ {
114
+ "cell_type": "code",
115
+ "execution_count": 25,
116
+ "metadata": {},
117
+ "outputs": [
118
+ {
119
+ "name": "stdout",
120
+ "output_type": "stream",
121
+ "text": [
122
+ "29624577\n"
123
+ ]
124
+ }
125
+ ],
126
+ "source": [
127
+ "for item in t_map:\n",
128
+ " print(item)\n",
129
+ " break"
130
+ ]
131
+ },
132
+ {
133
+ "cell_type": "code",
134
+ "execution_count": 27,
135
+ "metadata": {},
136
+ "outputs": [
137
+ {
138
+ "data": {
139
+ "text/plain": [
140
+ "'2023-07-12 11:58:40'"
141
+ ]
142
+ },
143
+ "execution_count": 27,
144
+ "metadata": {},
145
+ "output_type": "execute_result"
146
+ }
147
+ ],
148
+ "source": [
149
+ "min(t_map.values())"
150
+ ]
151
+ },
152
+ {
153
+ "cell_type": "code",
154
+ "execution_count": 26,
155
+ "metadata": {},
156
+ "outputs": [
157
+ {
158
+ "data": {
159
+ "text/plain": [
160
+ "'2023-08-24 16:04:50'"
161
+ ]
162
+ },
163
+ "execution_count": 26,
164
+ "metadata": {},
165
+ "output_type": "execute_result"
166
+ }
167
+ ],
168
+ "source": [
169
+ "t_map[29624577]"
170
+ ]
171
+ },
172
+ {
173
+ "cell_type": "code",
174
+ "execution_count": 28,
175
+ "metadata": {},
176
+ "outputs": [
177
+ {
178
+ "data": {
179
+ "text/plain": [
180
+ "'2024-09-04 07:32:15'"
181
+ ]
182
+ },
183
+ "execution_count": 28,
184
+ "metadata": {},
185
+ "output_type": "execute_result"
186
+ }
187
+ ],
188
+ "source": [
189
+ "max(t_map.values())"
190
+ ]
191
+ },
192
+ {
193
+ "cell_type": "code",
194
+ "execution_count": 21,
195
+ "metadata": {},
196
+ "outputs": [
197
+ {
198
+ "data": {
199
+ "text/plain": [
200
+ "request_id 1155886186807766696223563218518399229072982679...\n",
201
+ "request_block 35356121\n",
202
+ "prompt_request Please take over the role of a Data Scientist ...\n",
203
+ "tool prediction-request-rag-claude\n",
204
+ "nonce 2c4c8c5c-afcf-4e28-a09a-aa2bae3f5444\n",
205
+ "trader_address 0x22335c348afa4eae4cc6d2158c1ac259aaaecdfe\n",
206
+ "deliver_block 35356134\n",
207
+ "error 0\n",
208
+ "error_message None\n",
209
+ "prompt_response \\nYou will be evaluating the likelihood of an ...\n",
210
+ "mech_address 0x5e1d1eb61e1164d5a50b28c575da73a29595dff7\n",
211
+ "p_yes 0.6\n",
212
+ "p_no 0.4\n",
213
+ "confidence 0.7\n",
214
+ "info_utility 0.7\n",
215
+ "vote Yes\n",
216
+ "win_probability 0.6\n",
217
+ "title Will there be an increase in the wasp populati...\n",
218
+ "currentAnswer Yes\n",
219
+ "Name: 0, dtype: object"
220
+ ]
221
+ },
222
+ "execution_count": 21,
223
+ "metadata": {},
224
+ "output_type": "execute_result"
225
+ }
226
+ ],
227
+ "source": [
228
+ "tools.iloc[0]"
229
+ ]
230
+ },
231
+ {
232
+ "cell_type": "code",
233
+ "execution_count": 18,
234
+ "metadata": {},
235
+ "outputs": [
236
+ {
237
+ "data": {
238
+ "text/plain": [
239
+ "vote\n",
240
+ "Yes 55881\n",
241
+ "No 51741\n",
242
+ "Name: count, dtype: int64"
243
+ ]
244
+ },
245
+ "execution_count": 18,
246
+ "metadata": {},
247
+ "output_type": "execute_result"
248
+ }
249
+ ],
250
+ "source": [
251
+ "tools.vote.value_counts()"
252
+ ]
253
+ },
254
+ {
255
+ "cell_type": "code",
256
+ "execution_count": 25,
257
+ "metadata": {},
258
+ "outputs": [
259
+ {
260
+ "name": "stdout",
261
+ "output_type": "stream",
262
+ "text": [
263
+ "<class 'pandas.core.frame.DataFrame'>\n",
264
+ "RangeIndex: 132150 entries, 0 to 132149\n",
265
+ "Data columns (total 22 columns):\n",
266
+ " # Column Non-Null Count Dtype \n",
267
+ "--- ------ -------------- ----- \n",
268
+ " 0 request_id 132150 non-null object \n",
269
+ " 1 request_block 132150 non-null int64 \n",
270
+ " 2 prompt_request 132150 non-null object \n",
271
+ " 3 tool 132150 non-null object \n",
272
+ " 4 nonce 132150 non-null object \n",
273
+ " 5 trader_address 132150 non-null object \n",
274
+ " 6 deliver_block 132150 non-null int64 \n",
275
+ " 7 error 132149 non-null float64\n",
276
+ " 8 error_message 9702 non-null object \n",
277
+ " 9 prompt_response 132060 non-null object \n",
278
+ " 10 mech_address 132150 non-null object \n",
279
+ " 11 p_yes 122447 non-null float64\n",
280
+ " 12 p_no 122447 non-null float64\n",
281
+ " 13 confidence 122447 non-null float64\n",
282
+ " 14 info_utility 122447 non-null float64\n",
283
+ " 15 vote 102396 non-null object \n",
284
+ " 16 win_probability 122447 non-null float64\n",
285
+ " 17 title 124256 non-null object \n",
286
+ " 18 currentAnswer 85763 non-null object \n",
287
+ " 19 request_time 132150 non-null object \n",
288
+ " 20 request_month_year 132150 non-null object \n",
289
+ " 21 request_month_year_week 132150 non-null object \n",
290
+ "dtypes: float64(6), int64(2), object(14)\n",
291
+ "memory usage: 22.2+ MB\n"
292
+ ]
293
+ }
294
+ ],
295
+ "source": [
296
+ "tools.info()"
297
+ ]
298
+ },
299
+ {
300
+ "cell_type": "code",
301
+ "execution_count": 31,
302
+ "metadata": {},
303
+ "outputs": [],
304
+ "source": [
305
+ "fpmms = pd.read_parquet('../data/fpmms.parquet')"
306
+ ]
307
+ },
308
+ {
309
+ "cell_type": "code",
310
+ "execution_count": 6,
311
+ "metadata": {},
312
+ "outputs": [
313
+ {
314
+ "data": {
315
+ "text/html": [
316
+ "<div>\n",
317
+ "<style scoped>\n",
318
+ " .dataframe tbody tr th:only-of-type {\n",
319
+ " vertical-align: middle;\n",
320
+ " }\n",
321
+ "\n",
322
+ " .dataframe tbody tr th {\n",
323
+ " vertical-align: top;\n",
324
+ " }\n",
325
+ "\n",
326
+ " .dataframe thead th {\n",
327
+ " text-align: right;\n",
328
+ " }\n",
329
+ "</style>\n",
330
+ "<table border=\"1\" class=\"dataframe\">\n",
331
+ " <thead>\n",
332
+ " <tr style=\"text-align: right;\">\n",
333
+ " <th></th>\n",
334
+ " <th>currentAnswer</th>\n",
335
+ " <th>id</th>\n",
336
+ " <th>title</th>\n",
337
+ " </tr>\n",
338
+ " </thead>\n",
339
+ " <tbody>\n",
340
+ " <tr>\n",
341
+ " <th>0</th>\n",
342
+ " <td>No</td>\n",
343
+ " <td>0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5</td>\n",
344
+ " <td>Will the first floating offshore wind research...</td>\n",
345
+ " </tr>\n",
346
+ " <tr>\n",
347
+ " <th>1</th>\n",
348
+ " <td>No</td>\n",
349
+ " <td>0x0020d13c89140b47e10db54cbd53852b90bc1391</td>\n",
350
+ " <td>Will the Francis Scott Key Bridge in Baltimore...</td>\n",
351
+ " </tr>\n",
352
+ " <tr>\n",
353
+ " <th>2</th>\n",
354
+ " <td>No</td>\n",
355
+ " <td>0x003ae5e007cc38b3f86b0ed7c82f938a1285ac07</td>\n",
356
+ " <td>Will FC Saarbrucken reach the final of the Ger...</td>\n",
357
+ " </tr>\n",
358
+ " <tr>\n",
359
+ " <th>3</th>\n",
360
+ " <td>Yes</td>\n",
361
+ " <td>0x004c8d4c619dc6b9caa940f5ea7ef699ae85359c</td>\n",
362
+ " <td>Will the pro-life activists convicted for 'con...</td>\n",
363
+ " </tr>\n",
364
+ " <tr>\n",
365
+ " <th>4</th>\n",
366
+ " <td>Yes</td>\n",
367
+ " <td>0x005e3f7a90585acbec807425a750fbba1d0c2b5c</td>\n",
368
+ " <td>Will Apple announce the release of a new M4 ch...</td>\n",
369
+ " </tr>\n",
370
+ " </tbody>\n",
371
+ "</table>\n",
372
+ "</div>"
373
+ ],
374
+ "text/plain": [
375
+ " currentAnswer id \\\n",
376
+ "0 No 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5 \n",
377
+ "1 No 0x0020d13c89140b47e10db54cbd53852b90bc1391 \n",
378
+ "2 No 0x003ae5e007cc38b3f86b0ed7c82f938a1285ac07 \n",
379
+ "3 Yes 0x004c8d4c619dc6b9caa940f5ea7ef699ae85359c \n",
380
+ "4 Yes 0x005e3f7a90585acbec807425a750fbba1d0c2b5c \n",
381
+ "\n",
382
+ " title \n",
383
+ "0 Will the first floating offshore wind research... \n",
384
+ "1 Will the Francis Scott Key Bridge in Baltimore... \n",
385
+ "2 Will FC Saarbrucken reach the final of the Ger... \n",
386
+ "3 Will the pro-life activists convicted for 'con... \n",
387
+ "4 Will Apple announce the release of a new M4 ch... "
388
+ ]
389
+ },
390
+ "execution_count": 6,
391
+ "metadata": {},
392
+ "output_type": "execute_result"
393
+ }
394
+ ],
395
+ "source": [
396
+ "fpmms.head()"
397
+ ]
398
+ },
399
+ {
400
+ "cell_type": "code",
401
+ "execution_count": 7,
402
+ "metadata": {},
403
+ "outputs": [
404
+ {
405
+ "data": {
406
+ "text/plain": [
407
+ "4251"
408
+ ]
409
+ },
410
+ "execution_count": 7,
411
+ "metadata": {},
412
+ "output_type": "execute_result"
413
+ }
414
+ ],
415
+ "source": [
416
+ "len(fpmms)"
417
+ ]
418
+ },
419
+ {
420
+ "cell_type": "code",
421
+ "execution_count": 18,
422
+ "metadata": {},
423
+ "outputs": [
424
+ {
425
+ "name": "stdout",
426
+ "output_type": "stream",
427
+ "text": [
428
+ "<class 'pandas.core.frame.DataFrame'>\n",
429
+ "RangeIndex: 18035 entries, 0 to 18034\n",
430
+ "Data columns (total 20 columns):\n",
431
+ " # Column Non-Null Count Dtype \n",
432
+ "--- ------ -------------- ----- \n",
433
+ " 0 trader_address 18035 non-null object \n",
434
+ " 1 market_creator 18035 non-null object \n",
435
+ " 2 trade_id 18035 non-null object \n",
436
+ " 3 creation_timestamp 18035 non-null datetime64[ns, UTC]\n",
437
+ " 4 title 18035 non-null object \n",
438
+ " 5 market_status 18035 non-null object \n",
439
+ " 6 collateral_amount 18035 non-null float64 \n",
440
+ " 7 outcome_index 18035 non-null object \n",
441
+ " 8 trade_fee_amount 18035 non-null float64 \n",
442
+ " 9 outcomes_tokens_traded 18035 non-null float64 \n",
443
+ " 10 current_answer 18035 non-null int64 \n",
444
+ " 11 is_invalid 18035 non-null bool \n",
445
+ " 12 winning_trade 18035 non-null bool \n",
446
+ " 13 earnings 18035 non-null float64 \n",
447
+ " 14 redeemed 18035 non-null bool \n",
448
+ " 15 redeemed_amount 18035 non-null float64 \n",
449
+ " 16 num_mech_calls 18035 non-null int64 \n",
450
+ " 17 mech_fee_amount 18035 non-null float64 \n",
451
+ " 18 net_earnings 18035 non-null float64 \n",
452
+ " 19 roi 18035 non-null float64 \n",
453
+ "dtypes: bool(3), datetime64[ns, UTC](1), float64(8), int64(2), object(6)\n",
454
+ "memory usage: 2.4+ MB\n"
455
+ ]
456
+ }
457
+ ],
458
+ "source": [
459
+ "prof = pd.read_parquet('../data/all_trades_profitability.parquet')\n",
460
+ "prof.info()"
461
+ ]
462
+ },
463
+ {
464
+ "cell_type": "code",
465
+ "execution_count": 20,
466
+ "metadata": {},
467
+ "outputs": [
468
+ {
469
+ "data": {
470
+ "text/plain": [
471
+ "market_creator\n",
472
+ "quickstart 16775\n",
473
+ "pearl 1260\n",
474
+ "Name: count, dtype: int64"
475
+ ]
476
+ },
477
+ "execution_count": 20,
478
+ "metadata": {},
479
+ "output_type": "execute_result"
480
+ }
481
+ ],
482
+ "source": [
483
+ "prof.market_creator.value_counts()"
484
+ ]
485
+ },
486
+ {
487
+ "cell_type": "code",
488
+ "execution_count": 12,
489
+ "metadata": {},
490
+ "outputs": [],
491
+ "source": [
492
+ "trades = pd.read_parquet(\"../data/fpmmTrades.parquet\")"
493
+ ]
494
+ },
495
+ {
496
+ "cell_type": "code",
497
+ "execution_count": 22,
498
+ "metadata": {},
499
+ "outputs": [
500
+ {
501
+ "data": {
502
+ "text/html": [
503
+ "<div>\n",
504
+ "<style scoped>\n",
505
+ " .dataframe tbody tr th:only-of-type {\n",
506
+ " vertical-align: middle;\n",
507
+ " }\n",
508
+ "\n",
509
+ " .dataframe tbody tr th {\n",
510
+ " vertical-align: top;\n",
511
+ " }\n",
512
+ "\n",
513
+ " .dataframe thead th {\n",
514
+ " text-align: right;\n",
515
+ " }\n",
516
+ "</style>\n",
517
+ "<table border=\"1\" class=\"dataframe\">\n",
518
+ " <thead>\n",
519
+ " <tr style=\"text-align: right;\">\n",
520
+ " <th></th>\n",
521
+ " <th>request_id</th>\n",
522
+ " <th>request_block</th>\n",
523
+ " <th>prompt_request</th>\n",
524
+ " <th>tool</th>\n",
525
+ " <th>nonce</th>\n",
526
+ " <th>trader_address</th>\n",
527
+ " <th>deliver_block</th>\n",
528
+ " <th>error</th>\n",
529
+ " <th>error_message</th>\n",
530
+ " <th>prompt_response</th>\n",
531
+ " <th>mech_address</th>\n",
532
+ " <th>p_yes</th>\n",
533
+ " <th>p_no</th>\n",
534
+ " <th>confidence</th>\n",
535
+ " <th>info_utility</th>\n",
536
+ " <th>vote</th>\n",
537
+ " <th>win_probability</th>\n",
538
+ " </tr>\n",
539
+ " </thead>\n",
540
+ " <tbody>\n",
541
+ " </tbody>\n",
542
+ "</table>\n",
543
+ "</div>"
544
+ ],
545
+ "text/plain": [
546
+ "Empty DataFrame\n",
547
+ "Columns: [request_id, request_block, prompt_request, tool, nonce, trader_address, deliver_block, error, error_message, prompt_response, mech_address, p_yes, p_no, confidence, info_utility, vote, win_probability]\n",
548
+ "Index: []"
549
+ ]
550
+ },
551
+ "execution_count": 22,
552
+ "metadata": {},
553
+ "output_type": "execute_result"
554
+ }
555
+ ],
556
+ "source": [
557
+ "tools.head()"
558
+ ]
559
+ },
560
+ {
561
+ "cell_type": "code",
562
+ "execution_count": 13,
563
+ "metadata": {},
564
+ "outputs": [
565
+ {
566
+ "data": {
567
+ "text/html": [
568
+ "<div>\n",
569
+ "<style scoped>\n",
570
+ " .dataframe tbody tr th:only-of-type {\n",
571
+ " vertical-align: middle;\n",
572
+ " }\n",
573
+ "\n",
574
+ " .dataframe tbody tr th {\n",
575
+ " vertical-align: top;\n",
576
+ " }\n",
577
+ "\n",
578
+ " .dataframe thead th {\n",
579
+ " text-align: right;\n",
580
+ " }\n",
581
+ "</style>\n",
582
+ "<table border=\"1\" class=\"dataframe\">\n",
583
+ " <thead>\n",
584
+ " <tr style=\"text-align: right;\">\n",
585
+ " <th></th>\n",
586
+ " <th>collateralAmount</th>\n",
587
+ " <th>collateralAmountUSD</th>\n",
588
+ " <th>collateralToken</th>\n",
589
+ " <th>creationTimestamp</th>\n",
590
+ " <th>trader_address</th>\n",
591
+ " <th>feeAmount</th>\n",
592
+ " <th>id</th>\n",
593
+ " <th>oldOutcomeTokenMarginalPrice</th>\n",
594
+ " <th>outcomeIndex</th>\n",
595
+ " <th>outcomeTokenMarginalPrice</th>\n",
596
+ " <th>...</th>\n",
597
+ " <th>market_creator</th>\n",
598
+ " <th>fpmm.answerFinalizedTimestamp</th>\n",
599
+ " <th>fpmm.arbitrationOccurred</th>\n",
600
+ " <th>fpmm.currentAnswer</th>\n",
601
+ " <th>fpmm.id</th>\n",
602
+ " <th>fpmm.isPendingArbitration</th>\n",
603
+ " <th>fpmm.openingTimestamp</th>\n",
604
+ " <th>fpmm.outcomes</th>\n",
605
+ " <th>fpmm.title</th>\n",
606
+ " <th>fpmm.condition.id</th>\n",
607
+ " </tr>\n",
608
+ " </thead>\n",
609
+ " <tbody>\n",
610
+ " <tr>\n",
611
+ " <th>0</th>\n",
612
+ " <td>450426474650738688</td>\n",
613
+ " <td>0.4504269694034145716308073094168006</td>\n",
614
+ " <td>0xe91d153e0b41518a2ce8dd3d7944fa863463a97d</td>\n",
615
+ " <td>1724553455</td>\n",
616
+ " <td>0x022b36c50b85b8ae7addfb8a35d76c59d5814834</td>\n",
617
+ " <td>9008529493014773</td>\n",
618
+ " <td>0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x02...</td>\n",
619
+ " <td>0.592785210609610270634125335572129</td>\n",
620
+ " <td>1</td>\n",
621
+ " <td>0.6171295391012242250994586583534301</td>\n",
622
+ " <td>...</td>\n",
623
+ " <td>quickstart</td>\n",
624
+ " <td>1725071760</td>\n",
625
+ " <td>False</td>\n",
626
+ " <td>0x00000000000000000000000000000000000000000000...</td>\n",
627
+ " <td>0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5</td>\n",
628
+ " <td>False</td>\n",
629
+ " <td>1724976000</td>\n",
630
+ " <td>[Yes, No]</td>\n",
631
+ " <td>Will the first floating offshore wind research...</td>\n",
632
+ " <td>0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1...</td>\n",
633
+ " </tr>\n",
634
+ " <tr>\n",
635
+ " <th>1</th>\n",
636
+ " <td>610163214546941400</td>\n",
637
+ " <td>0.6101636232215150135654007337015298</td>\n",
638
+ " <td>0xe91d153e0b41518a2ce8dd3d7944fa863463a97d</td>\n",
639
+ " <td>1724811940</td>\n",
640
+ " <td>0x034c4ad84f7ac6638bf19300d5bbe7d9b981e736</td>\n",
641
+ " <td>12203264290938828</td>\n",
642
+ " <td>0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x03...</td>\n",
643
+ " <td>0.842992636523755061934822129394812</td>\n",
644
+ " <td>1</td>\n",
645
+ " <td>0.8523396372892128845826889719620915</td>\n",
646
+ " <td>...</td>\n",
647
+ " <td>quickstart</td>\n",
648
+ " <td>1725071760</td>\n",
649
+ " <td>False</td>\n",
650
+ " <td>0x00000000000000000000000000000000000000000000...</td>\n",
651
+ " <td>0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5</td>\n",
652
+ " <td>False</td>\n",
653
+ " <td>1724976000</td>\n",
654
+ " <td>[Yes, No]</td>\n",
655
+ " <td>Will the first floating offshore wind research...</td>\n",
656
+ " <td>0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1...</td>\n",
657
+ " </tr>\n",
658
+ " <tr>\n",
659
+ " <th>2</th>\n",
660
+ " <td>789065092332460672</td>\n",
661
+ " <td>0.7890644120527324071908793822796086</td>\n",
662
+ " <td>0xe91d153e0b41518a2ce8dd3d7944fa863463a97d</td>\n",
663
+ " <td>1724815755</td>\n",
664
+ " <td>0x09e9d42a029e8b0c2df3871709a762117a681d92</td>\n",
665
+ " <td>15781301846649213</td>\n",
666
+ " <td>0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x09...</td>\n",
667
+ " <td>0.7983775743712442891104598770339028</td>\n",
668
+ " <td>1</td>\n",
669
+ " <td>0.8152123711444691659642000374025623</td>\n",
670
+ " <td>...</td>\n",
671
+ " <td>quickstart</td>\n",
672
+ " <td>1725071760</td>\n",
673
+ " <td>False</td>\n",
674
+ " <td>0x00000000000000000000000000000000000000000000...</td>\n",
675
+ " <td>0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5</td>\n",
676
+ " <td>False</td>\n",
677
+ " <td>1724976000</td>\n",
678
+ " <td>[Yes, No]</td>\n",
679
+ " <td>Will the first floating offshore wind research...</td>\n",
680
+ " <td>0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1...</td>\n",
681
+ " </tr>\n",
682
+ " <tr>\n",
683
+ " <th>3</th>\n",
684
+ " <td>1000000000000000000</td>\n",
685
+ " <td>1.000000605383660329048491794939126</td>\n",
686
+ " <td>0xe91d153e0b41518a2ce8dd3d7944fa863463a97d</td>\n",
687
+ " <td>1724546620</td>\n",
688
+ " <td>0x09e9d42a029e8b0c2df3871709a762117a681d92</td>\n",
689
+ " <td>20000000000000000</td>\n",
690
+ " <td>0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x09...</td>\n",
691
+ " <td>0.5110745907733438805447072252622708</td>\n",
692
+ " <td>1</td>\n",
693
+ " <td>0.5746805204222762335911904727318937</td>\n",
694
+ " <td>...</td>\n",
695
+ " <td>quickstart</td>\n",
696
+ " <td>1725071760</td>\n",
697
+ " <td>False</td>\n",
698
+ " <td>0x00000000000000000000000000000000000000000000...</td>\n",
699
+ " <td>0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5</td>\n",
700
+ " <td>False</td>\n",
701
+ " <td>1724976000</td>\n",
702
+ " <td>[Yes, No]</td>\n",
703
+ " <td>Will the first floating offshore wind research...</td>\n",
704
+ " <td>0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1...</td>\n",
705
+ " </tr>\n",
706
+ " <tr>\n",
707
+ " <th>4</th>\n",
708
+ " <td>100000000000000000</td>\n",
709
+ " <td>0.1000004271262862419547394646567906</td>\n",
710
+ " <td>0xe91d153e0b41518a2ce8dd3d7944fa863463a97d</td>\n",
711
+ " <td>1724771260</td>\n",
712
+ " <td>0x0d049dcaece0ecb6fc81a460da7bcc2a4785d6e5</td>\n",
713
+ " <td>2000000000000000</td>\n",
714
+ " <td>0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x0d...</td>\n",
715
+ " <td>0.2713968218662319388988681987389408</td>\n",
716
+ " <td>0</td>\n",
717
+ " <td>0.2804586217805511523845593360379658</td>\n",
718
+ " <td>...</td>\n",
719
+ " <td>quickstart</td>\n",
720
+ " <td>1725071760</td>\n",
721
+ " <td>False</td>\n",
722
+ " <td>0x00000000000000000000000000000000000000000000...</td>\n",
723
+ " <td>0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5</td>\n",
724
+ " <td>False</td>\n",
725
+ " <td>1724976000</td>\n",
726
+ " <td>[Yes, No]</td>\n",
727
+ " <td>Will the first floating offshore wind research...</td>\n",
728
+ " <td>0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1...</td>\n",
729
+ " </tr>\n",
730
+ " </tbody>\n",
731
+ "</table>\n",
732
+ "<p>5 rows × 24 columns</p>\n",
733
+ "</div>"
734
+ ],
735
+ "text/plain": [
736
+ " collateralAmount collateralAmountUSD \\\n",
737
+ "0 450426474650738688 0.4504269694034145716308073094168006 \n",
738
+ "1 610163214546941400 0.6101636232215150135654007337015298 \n",
739
+ "2 789065092332460672 0.7890644120527324071908793822796086 \n",
740
+ "3 1000000000000000000 1.000000605383660329048491794939126 \n",
741
+ "4 100000000000000000 0.1000004271262862419547394646567906 \n",
742
+ "\n",
743
+ " collateralToken creationTimestamp \\\n",
744
+ "0 0xe91d153e0b41518a2ce8dd3d7944fa863463a97d 1724553455 \n",
745
+ "1 0xe91d153e0b41518a2ce8dd3d7944fa863463a97d 1724811940 \n",
746
+ "2 0xe91d153e0b41518a2ce8dd3d7944fa863463a97d 1724815755 \n",
747
+ "3 0xe91d153e0b41518a2ce8dd3d7944fa863463a97d 1724546620 \n",
748
+ "4 0xe91d153e0b41518a2ce8dd3d7944fa863463a97d 1724771260 \n",
749
+ "\n",
750
+ " trader_address feeAmount \\\n",
751
+ "0 0x022b36c50b85b8ae7addfb8a35d76c59d5814834 9008529493014773 \n",
752
+ "1 0x034c4ad84f7ac6638bf19300d5bbe7d9b981e736 12203264290938828 \n",
753
+ "2 0x09e9d42a029e8b0c2df3871709a762117a681d92 15781301846649213 \n",
754
+ "3 0x09e9d42a029e8b0c2df3871709a762117a681d92 20000000000000000 \n",
755
+ "4 0x0d049dcaece0ecb6fc81a460da7bcc2a4785d6e5 2000000000000000 \n",
756
+ "\n",
757
+ " id \\\n",
758
+ "0 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x02... \n",
759
+ "1 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x03... \n",
760
+ "2 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x09... \n",
761
+ "3 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x09... \n",
762
+ "4 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x0d... \n",
763
+ "\n",
764
+ " oldOutcomeTokenMarginalPrice outcomeIndex \\\n",
765
+ "0 0.592785210609610270634125335572129 1 \n",
766
+ "1 0.842992636523755061934822129394812 1 \n",
767
+ "2 0.7983775743712442891104598770339028 1 \n",
768
+ "3 0.5110745907733438805447072252622708 1 \n",
769
+ "4 0.2713968218662319388988681987389408 0 \n",
770
+ "\n",
771
+ " outcomeTokenMarginalPrice ... market_creator \\\n",
772
+ "0 0.6171295391012242250994586583534301 ... quickstart \n",
773
+ "1 0.8523396372892128845826889719620915 ... quickstart \n",
774
+ "2 0.8152123711444691659642000374025623 ... quickstart \n",
775
+ "3 0.5746805204222762335911904727318937 ... quickstart \n",
776
+ "4 0.2804586217805511523845593360379658 ... quickstart \n",
777
+ "\n",
778
+ " fpmm.answerFinalizedTimestamp fpmm.arbitrationOccurred \\\n",
779
+ "0 1725071760 False \n",
780
+ "1 1725071760 False \n",
781
+ "2 1725071760 False \n",
782
+ "3 1725071760 False \n",
783
+ "4 1725071760 False \n",
784
+ "\n",
785
+ " fpmm.currentAnswer \\\n",
786
+ "0 0x00000000000000000000000000000000000000000000... \n",
787
+ "1 0x00000000000000000000000000000000000000000000... \n",
788
+ "2 0x00000000000000000000000000000000000000000000... \n",
789
+ "3 0x00000000000000000000000000000000000000000000... \n",
790
+ "4 0x00000000000000000000000000000000000000000000... \n",
791
+ "\n",
792
+ " fpmm.id fpmm.isPendingArbitration \\\n",
793
+ "0 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5 False \n",
794
+ "1 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5 False \n",
795
+ "2 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5 False \n",
796
+ "3 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5 False \n",
797
+ "4 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5 False \n",
798
+ "\n",
799
+ " fpmm.openingTimestamp fpmm.outcomes \\\n",
800
+ "0 1724976000 [Yes, No] \n",
801
+ "1 1724976000 [Yes, No] \n",
802
+ "2 1724976000 [Yes, No] \n",
803
+ "3 1724976000 [Yes, No] \n",
804
+ "4 1724976000 [Yes, No] \n",
805
+ "\n",
806
+ " fpmm.title \\\n",
807
+ "0 Will the first floating offshore wind research... \n",
808
+ "1 Will the first floating offshore wind research... \n",
809
+ "2 Will the first floating offshore wind research... \n",
810
+ "3 Will the first floating offshore wind research... \n",
811
+ "4 Will the first floating offshore wind research... \n",
812
+ "\n",
813
+ " fpmm.condition.id \n",
814
+ "0 0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1... \n",
815
+ "1 0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1... \n",
816
+ "2 0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1... \n",
817
+ "3 0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1... \n",
818
+ "4 0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1... \n",
819
+ "\n",
820
+ "[5 rows x 24 columns]"
821
+ ]
822
+ },
823
+ "execution_count": 13,
824
+ "metadata": {},
825
+ "output_type": "execute_result"
826
+ }
827
+ ],
828
+ "source": [
829
+ "trades.head()"
830
+ ]
831
+ },
832
+ {
833
+ "cell_type": "code",
834
+ "execution_count": 14,
835
+ "metadata": {},
836
+ "outputs": [
837
+ {
838
+ "name": "stdout",
839
+ "output_type": "stream",
840
+ "text": [
841
+ "<class 'pandas.core.frame.DataFrame'>\n",
842
+ "RangeIndex: 23455 entries, 0 to 23454\n",
843
+ "Data columns (total 24 columns):\n",
844
+ " # Column Non-Null Count Dtype \n",
845
+ "--- ------ -------------- ----- \n",
846
+ " 0 collateralAmount 23455 non-null object\n",
847
+ " 1 collateralAmountUSD 23455 non-null object\n",
848
+ " 2 collateralToken 23455 non-null object\n",
849
+ " 3 creationTimestamp 23455 non-null object\n",
850
+ " 4 trader_address 23455 non-null object\n",
851
+ " 5 feeAmount 23455 non-null object\n",
852
+ " 6 id 23455 non-null object\n",
853
+ " 7 oldOutcomeTokenMarginalPrice 23455 non-null object\n",
854
+ " 8 outcomeIndex 23455 non-null object\n",
855
+ " 9 outcomeTokenMarginalPrice 23455 non-null object\n",
856
+ " 10 outcomeTokensTraded 23455 non-null object\n",
857
+ " 11 title 23455 non-null object\n",
858
+ " 12 transactionHash 23455 non-null object\n",
859
+ " 13 type 23455 non-null object\n",
860
+ " 14 market_creator 23455 non-null object\n",
861
+ " 15 fpmm.answerFinalizedTimestamp 21489 non-null object\n",
862
+ " 16 fpmm.arbitrationOccurred 23455 non-null bool \n",
863
+ " 17 fpmm.currentAnswer 21489 non-null object\n",
864
+ " 18 fpmm.id 23455 non-null object\n",
865
+ " 19 fpmm.isPendingArbitration 23455 non-null bool \n",
866
+ " 20 fpmm.openingTimestamp 23455 non-null object\n",
867
+ " 21 fpmm.outcomes 23455 non-null object\n",
868
+ " 22 fpmm.title 23455 non-null object\n",
869
+ " 23 fpmm.condition.id 23455 non-null object\n",
870
+ "dtypes: bool(2), object(22)\n",
871
+ "memory usage: 4.0+ MB\n"
872
+ ]
873
+ }
874
+ ],
875
+ "source": [
876
+ "trades.info()"
877
+ ]
878
+ },
879
+ {
880
+ "cell_type": "code",
881
+ "execution_count": 15,
882
+ "metadata": {},
883
+ "outputs": [
884
+ {
885
+ "data": {
886
+ "text/plain": [
887
+ "market_creator\n",
888
+ "quickstart 21852\n",
889
+ "pearl 1603\n",
890
+ "Name: count, dtype: int64"
891
+ ]
892
+ },
893
+ "execution_count": 15,
894
+ "metadata": {},
895
+ "output_type": "execute_result"
896
+ }
897
+ ],
898
+ "source": [
899
+ "trades.market_creator.value_counts()"
900
+ ]
901
+ },
902
+ {
903
+ "cell_type": "code",
904
+ "execution_count": 33,
905
+ "metadata": {},
906
+ "outputs": [],
907
+ "source": [
908
+ "fpmms_trades = pd.read_parquet('../data/fpmmTrades.parquet')"
909
+ ]
910
+ },
911
+ {
912
+ "cell_type": "markdown",
913
+ "metadata": {},
914
+ "source": [
915
+ "## Adding market creator info"
916
+ ]
917
+ },
918
+ {
919
+ "cell_type": "code",
920
+ "execution_count": 35,
921
+ "metadata": {},
922
+ "outputs": [
923
+ {
924
+ "name": "stdout",
925
+ "output_type": "stream",
926
+ "text": [
927
+ "ERROR getting the market creator of 0xae7b042059b179dcac3169657fac111d7925f8dd\n",
928
+ "ERROR getting the market creator of 0x347e4ef0ff34cf39d1c7e08bc07c68c41a4836d6\n",
929
+ "ERROR getting the market creator of 0x8e03d3a7a3dfd930f73577ba4204deadf12b33f3\n",
930
+ "ERROR getting the market creator of 0x2a0b461417fa0ae8bbeb28ed265fbe3944772435\n",
931
+ "ERROR getting the market creator of 0x8069ea45a18910fa493a6a736438971b0e59ec9b\n",
932
+ "ERROR getting the market creator of 0xdf91eac2a8573646c7e8e95c740877fe3d38f11f\n",
933
+ "ERROR getting the market creator of 0x87f0fcfe810502555f8d1439793155cbfa2eb583\n",
934
+ "ERROR getting the market creator of 0x7bcf0f480e52da1597d7437d5b4a4644b1e7ec23\n",
935
+ "ERROR getting the market creator of 0xcfef6a50bd9439d1e1a15fcfe99068a57e533d95\n",
936
+ "ERROR getting the market creator of 0xaeb8c31302361d42ec806faf406ef0c30b6eba5f\n",
937
+ "ERROR getting the market creator of 0x9db7e7a0c82a229a7f3bb15046ff0c3a778b7291\n",
938
+ "ERROR getting the market creator of 0x85c31bbeaab5468d97900e69d87a459aba997fa5\n",
939
+ "ERROR getting the market creator of 0x36660fec571bb4d5849a433f9ec64622416f1dbb\n",
940
+ "ERROR getting the market creator of 0x5ebe6dcb1ac4470bb71c89cf1e6b9abc48b637ba\n",
941
+ "ERROR getting the market creator of 0xa0acfecc55465870c9baa7c954a0e81165fb112c\n",
942
+ "ERROR getting the market creator of 0xd6d6951a8fa033f91a2227d75fb1eebc139e2e57\n",
943
+ "ERROR getting the market creator of 0x651d04044b780e68f3f952796fb7c06fb0928ad2\n",
944
+ "ERROR getting the market creator of 0xe271378e094db9d64e34c6c14a7492bcccd11dfb\n",
945
+ "ERROR getting the market creator of 0x37c241945001f6c26c886c8d551cc2e6cf34c214\n",
946
+ "ERROR getting the market creator of 0x20b9e32b17360310c633e5676f28430bd723f4bd\n",
947
+ "ERROR getting the market creator of 0x06d873e7465a6680f5487905d7b5daf7f2c6e299\n",
948
+ "ERROR getting the market creator of 0xd28b5e2f2ce950705354cd2ceaf4eab9d23db52b\n",
949
+ "ERROR getting the market creator of 0x4d70e1ac779094e9790c8b74954d15729371e6bc\n",
950
+ "ERROR getting the market creator of 0x81489c0eab196fb88704f08ef34b8a9ed7137c91\n",
951
+ "ERROR getting the market creator of 0x223c99787f25179d51a9934a426b6d1b252bb4bd\n",
952
+ "ERROR getting the market creator of 0xd61b2c4f70645c830bd5af76426d6b22af63c152\n",
953
+ "ERROR getting the market creator of 0xe66e931f7b065361f56e41d61f599adab3b167c2\n",
954
+ "ERROR getting the market creator of 0x5ccf21332df9af6195a5b1ba78d15562db915a35\n",
955
+ "ERROR getting the market creator of 0xf8e68d9f66d2534df36c23db6770467da1c1ff1b\n",
956
+ "ERROR getting the market creator of 0x2b9274ddf2213d8a6b2930a5b82801165df55017\n",
957
+ "ERROR getting the market creator of 0xf9349c5ea0b5559abd8dfa6cdd4e4d5d913e1e61\n",
958
+ "ERROR getting the market creator of 0xad8aa6f927bb6a38af8121418f1b64d4ed8be99c\n",
959
+ "ERROR getting the market creator of 0x3dcc00904249d796a89943de15c85ac11afc5d66\n",
960
+ "ERROR getting the market creator of 0x10ece1553b5017414388fe78f64720814d7f8799\n",
961
+ "ERROR getting the market creator of 0x0930bcc328a695419d596dae380dec7fb43cd715\n",
962
+ "ERROR getting the market creator of 0x956d8bbc930372482a361dec7e4707b15d8b02f4\n",
963
+ "ERROR getting the market creator of 0x14da1cc12b382142ac3e2422162f122a0a31ec45\n",
964
+ "ERROR getting the market creator of 0x28dd86a2c82ce02970eff7f4ea9ebde97750adc8\n",
965
+ "ERROR getting the market creator of 0xb997d5e2fddf39b8a197715c7b200df612d74360\n",
966
+ "ERROR getting the market creator of 0x2064ceecb78a382f4988d41f881abef89b6e785c\n",
967
+ "ERROR getting the market creator of 0xe715cc8f264ab48f75bb1b5c11d7dbaf949d73c5\n",
968
+ "ERROR getting the market creator of 0x5fc7213135962250147030c5dd30b84a80f2ad1e\n",
969
+ "ERROR getting the market creator of 0x10ccffdc8e801ab4fda98371723cda4e30e6d672\n",
970
+ "ERROR getting the market creator of 0x6e5d93fdcc14db02a58ace636c2dcff8db36039d\n",
971
+ "ERROR getting the market creator of 0xf792f6a308525b72b5d47f12798668c140f5968e\n",
972
+ "ERROR getting the market creator of 0x00897abcbbefe4f558956b7a9d1b7819677e4d90\n",
973
+ "ERROR getting the market creator of 0x29448445959cc5045c03b7f316fa3332cc2b37b7\n",
974
+ "ERROR getting the market creator of 0xdb8c2038cd17645216125f323048dcd4c9845826\n",
975
+ "ERROR getting the market creator of 0x32969cce1791f13dc5d500b9e701ffb931baae03\n",
976
+ "ERROR getting the market creator of 0x84aeb93d348c6da1ea4b0016c207aefc26edaa44\n",
977
+ "ERROR getting the market creator of 0xdda87f7ec43aab7080e9ac23ae1550e5bc89d6cc\n",
978
+ "ERROR getting the market creator of 0xafd80421ce35298d3698ca0f4008477a169c9ea2\n",
979
+ "ERROR getting the market creator of 0xffc47cb1ecd41daae58e39fd4193d6fe9a6f5d2e\n",
980
+ "ERROR getting the market creator of 0x351d430d229740f986ee240612c932c66188dd09\n",
981
+ "ERROR getting the market creator of 0xd72455c8d5398a2b3b822bbc7cc0de638ea35519\n",
982
+ "ERROR getting the market creator of 0x2c83cf4bb92e55e35b6e4af6eca6c0a85fb73650\n",
983
+ "ERROR getting the market creator of 0xf2baf410b7d42d7572fb2f39cf216ffae8d4cafe\n",
984
+ "ERROR getting the market creator of 0xb42a955a0e06b3e6bdf229c9abfd2fdad20688a7\n",
985
+ "ERROR getting the market creator of 0x35021fcc0d15c4e87fc1c7fb527f389829dde3d9\n",
986
+ "ERROR getting the market creator of 0xaa19120a9976c75dc569ab2cfcc087cd224db4e2\n",
987
+ "ERROR getting the market creator of 0x6e79766698f58a25d2548b76601de9535c5080d3\n",
988
+ "ERROR getting the market creator of 0x6915dcb7601802ea4a2dd840c44b6ed4473b5ce2\n",
989
+ "ERROR getting the market creator of 0x6957f7ac4a0a09f237a901749e518a678d1a614a\n",
990
+ "ERROR getting the market creator of 0x785a9d3329955ffd7cd24ca7a89ce2da21ac62da\n",
991
+ "ERROR getting the market creator of 0x1e738f7e82102e2f56fef62df473d3f1f1dc53b1\n",
992
+ "ERROR getting the market creator of 0x8e23b89649f22a6e8084b34a1a5de28d9ddf5a88\n",
993
+ "ERROR getting the market creator of 0x31c6b19cae793ba90ee9c70263af773c27df2774\n",
994
+ "ERROR getting the market creator of 0x3a2d7bf095988f30daf308b5484cd74903d82c22\n",
995
+ "ERROR getting the market creator of 0xde10d01d4315cf64d9feeb79e9a593d78da8a50b\n",
996
+ "ERROR getting the market creator of 0xa57b7f04bb813b5a6ded7cc92c5bd56586d8f7d4\n",
997
+ "ERROR getting the market creator of 0x97609769fddc72ea9f45f62cef1f7a9658dd1efe\n",
998
+ "ERROR getting the market creator of 0x7ddbfbebbec1635315f9217cbf9de8afd272c8de\n",
999
+ "ERROR getting the market creator of 0x37cdc93194dc7f46f3cc377cf4350f56455a4f85\n",
1000
+ "ERROR getting the market creator of 0x75c10935141d740b71e1763aa6a3139643754655\n",
1001
+ "ERROR getting the market creator of 0x0f98789650877b1928960490a5a19769ac1c84b3\n",
1002
+ "ERROR getting the market creator of 0x9f87c202db8b3270406a3084817909a9d4afc6ea\n",
1003
+ "ERROR getting the market creator of 0x8cfb5af2b0287b34a423755d0481478f0a8f1356\n",
1004
+ "ERROR getting the market creator of 0x09244905029648aca18830291bb62634b04d9a46\n",
1005
+ "ERROR getting the market creator of 0x4e9a5580ce24dd06ed8d6b1d75a7ccce7abf7361\n",
1006
+ "ERROR getting the market creator of 0x8bbeb8a3e1f6fdc9e95aa0d7e80ebc6dc1468b7a\n",
1007
+ "ERROR getting the market creator of 0xcb279a4ebb3f0d78cb15817e942cc7aea01b8545\n",
1008
+ "ERROR getting the market creator of 0xb36fa15e34dd50b8199c57305573dc48d1271b50\n",
1009
+ "ERROR getting the market creator of 0x2198981fc1d8b3c61e7df9a50cf240708c057dfa\n",
1010
+ "ERROR getting the market creator of 0x37bab68f9ae4f9c7ce915d9e1f3404e7cd1794cc\n",
1011
+ "ERROR getting the market creator of 0x97f59586921ebdcfc07694ba8376f59871db11f9\n",
1012
+ "ERROR getting the market creator of 0xc79bf3f6370e8a8002a3093c379752f395a3c291\n",
1013
+ "ERROR getting the market creator of 0x178021f40d4e1ed270f2d2125f9f80d3e78a1836\n",
1014
+ "ERROR getting the market creator of 0xcca6ccde20a551caec29d6c1318f4f2ec7e6063c\n"
1015
+ ]
1016
+ }
1017
+ ],
1018
+ "source": [
1019
+ "tools[\"market_creator\"] = \"\"\n",
1020
+ "# traverse the list of traders\n",
1021
+ "traders_list = list(tools.trader_address.unique())\n",
1022
+ "for trader_address in traders_list:\n",
1023
+ " market_creator = \"\"\n",
1024
+ " try:\n",
1025
+ " trades = fpmms_trades[fpmms_trades[\"trader_address\"] == trader_address]\n",
1026
+ " market_creator = trades.iloc[0][\"market_creator\"] # first value is enough\n",
1027
+ " except Exception:\n",
1028
+ " print(f\"ERROR getting the market creator of {trader_address}\")\n",
1029
+ " tools_of_the_trader = tools[tools[\"trader_address\"] == trader_address]\n",
1030
+ " # update\n",
1031
+ " tools.loc[tools[\"trader_address\"] == trader_address, \"market_creator\"] = market_creator"
1032
+ ]
1033
+ },
1034
+ {
1035
+ "cell_type": "code",
1036
+ "execution_count": 37,
1037
+ "metadata": {},
1038
+ "outputs": [
1039
+ {
1040
+ "data": {
1041
+ "text/plain": [
1042
+ "market_creator\n",
1043
+ "quickstart 121106\n",
1044
+ "pearl 12729\n",
1045
+ " 5182\n",
1046
+ "Name: count, dtype: int64"
1047
+ ]
1048
+ },
1049
+ "execution_count": 37,
1050
+ "metadata": {},
1051
+ "output_type": "execute_result"
1052
+ }
1053
+ ],
1054
+ "source": [
1055
+ "tools.market_creator.value_counts()"
1056
+ ]
1057
+ },
1058
+ {
1059
+ "cell_type": "code",
1060
+ "execution_count": 38,
1061
+ "metadata": {},
1062
+ "outputs": [
1063
+ {
1064
+ "data": {
1065
+ "text/plain": [
1066
+ "139017"
1067
+ ]
1068
+ },
1069
+ "execution_count": 38,
1070
+ "metadata": {},
1071
+ "output_type": "execute_result"
1072
+ }
1073
+ ],
1074
+ "source": [
1075
+ "len(tools)"
1076
+ ]
1077
+ },
1078
+ {
1079
+ "cell_type": "code",
1080
+ "execution_count": 39,
1081
+ "metadata": {},
1082
+ "outputs": [
1083
+ {
1084
+ "data": {
1085
+ "text/plain": [
1086
+ "0.03727601660228605"
1087
+ ]
1088
+ },
1089
+ "execution_count": 39,
1090
+ "metadata": {},
1091
+ "output_type": "execute_result"
1092
+ }
1093
+ ],
1094
+ "source": [
1095
+ "5182/139017"
1096
+ ]
1097
+ },
1098
+ {
1099
+ "cell_type": "code",
1100
+ "execution_count": 40,
1101
+ "metadata": {},
1102
+ "outputs": [],
1103
+ "source": [
1104
+ "tools = tools.loc[tools[\"market_creator\"] != \"\"]\n",
1105
+ "tools.to_parquet(\"../data/tools.parquet\", index=False)"
1106
+ ]
1107
+ }
1108
+ ],
1109
+ "metadata": {
1110
+ "kernelspec": {
1111
+ "display_name": "hf_dashboards",
1112
+ "language": "python",
1113
+ "name": "python3"
1114
+ },
1115
+ "language_info": {
1116
+ "codemirror_mode": {
1117
+ "name": "ipython",
1118
+ "version": 3
1119
+ },
1120
+ "file_extension": ".py",
1121
+ "mimetype": "text/x-python",
1122
+ "name": "python",
1123
+ "nbconvert_exporter": "python",
1124
+ "pygments_lexer": "ipython3",
1125
+ "version": "3.12.2"
1126
+ }
1127
+ },
1128
+ "nbformat": 4,
1129
+ "nbformat_minor": 2
1130
+ }
notebooks/weekly_analysis.ipynb CHANGED
@@ -40,7 +40,7 @@
40
  },
41
  {
42
  "cell_type": "code",
43
- "execution_count": 13,
44
  "metadata": {},
45
  "outputs": [],
46
  "source": [
@@ -51,7 +51,30 @@
51
  },
52
  {
53
  "cell_type": "code",
54
- "execution_count": 3,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  "metadata": {},
56
  "outputs": [],
57
  "source": [
@@ -60,230 +83,102 @@
60
  },
61
  {
62
  "cell_type": "code",
63
- "execution_count": 15,
 
 
 
 
 
 
 
 
 
64
  "metadata": {},
65
  "outputs": [
66
  {
67
  "data": {
68
- "text/html": [
69
- "<div>\n",
70
- "<style scoped>\n",
71
- " .dataframe tbody tr th:only-of-type {\n",
72
- " vertical-align: middle;\n",
73
- " }\n",
74
- "\n",
75
- " .dataframe tbody tr th {\n",
76
- " vertical-align: top;\n",
77
- " }\n",
78
- "\n",
79
- " .dataframe thead th {\n",
80
- " text-align: right;\n",
81
- " }\n",
82
- "</style>\n",
83
- "<table border=\"1\" class=\"dataframe\">\n",
84
- " <thead>\n",
85
- " <tr style=\"text-align: right;\">\n",
86
- " <th></th>\n",
87
- " <th>trader_address</th>\n",
88
- " <th>trade_id</th>\n",
89
- " <th>creation_timestamp</th>\n",
90
- " <th>title</th>\n",
91
- " <th>market_status</th>\n",
92
- " <th>collateral_amount</th>\n",
93
- " <th>outcome_index</th>\n",
94
- " <th>trade_fee_amount</th>\n",
95
- " <th>outcomes_tokens_traded</th>\n",
96
- " <th>current_answer</th>\n",
97
- " <th>is_invalid</th>\n",
98
- " <th>winning_trade</th>\n",
99
- " <th>earnings</th>\n",
100
- " <th>redeemed</th>\n",
101
- " <th>redeemed_amount</th>\n",
102
- " <th>num_mech_calls</th>\n",
103
- " <th>mech_fee_amount</th>\n",
104
- " <th>net_earnings</th>\n",
105
- " <th>roi</th>\n",
106
- " </tr>\n",
107
- " </thead>\n",
108
- " <tbody>\n",
109
- " <tr>\n",
110
- " <th>0</th>\n",
111
- " <td>0x022b36c50b85b8ae7addfb8a35d76c59d5814834</td>\n",
112
- " <td>0x017947579ab51313c31fe1cc562c0f1726ec09c90x02...</td>\n",
113
- " <td>2024-05-19 01:26:30+00:00</td>\n",
114
- " <td>Will Google's Pixel 9 lineup be officially rel...</td>\n",
115
- " <td>CLOSED</td>\n",
116
- " <td>0.638</td>\n",
117
- " <td>1</td>\n",
118
- " <td>0.013</td>\n",
119
- " <td>1.206</td>\n",
120
- " <td>1</td>\n",
121
- " <td>False</td>\n",
122
- " <td>True</td>\n",
123
- " <td>1.206</td>\n",
124
- " <td>True</td>\n",
125
- " <td>1.206</td>\n",
126
- " <td>0</td>\n",
127
- " <td>0.000</td>\n",
128
- " <td>0.556</td>\n",
129
- " <td>0.854</td>\n",
130
- " </tr>\n",
131
- " <tr>\n",
132
- " <th>1</th>\n",
133
- " <td>0x022b36c50b85b8ae7addfb8a35d76c59d5814834</td>\n",
134
- " <td>0x027f6bc849e273477f4a63085192714084917fcc0x02...</td>\n",
135
- " <td>2024-06-12 01:16:55+00:00</td>\n",
136
- " <td>Will the 2D-animated Paramount Plus show 'Tale...</td>\n",
137
- " <td>CLOSED</td>\n",
138
- " <td>1.000</td>\n",
139
- " <td>1</td>\n",
140
- " <td>0.020</td>\n",
141
- " <td>1.840</td>\n",
142
- " <td>1</td>\n",
143
- " <td>False</td>\n",
144
- " <td>True</td>\n",
145
- " <td>1.840</td>\n",
146
- " <td>True</td>\n",
147
- " <td>1.840</td>\n",
148
- " <td>3</td>\n",
149
- " <td>0.030</td>\n",
150
- " <td>0.790</td>\n",
151
- " <td>0.752</td>\n",
152
- " </tr>\n",
153
- " <tr>\n",
154
- " <th>2</th>\n",
155
- " <td>0x022b36c50b85b8ae7addfb8a35d76c59d5814834</td>\n",
156
- " <td>0x027f6bc849e273477f4a63085192714084917fcc0x02...</td>\n",
157
- " <td>2024-06-12 15:08:00+00:00</td>\n",
158
- " <td>Will the 2D-animated Paramount Plus show 'Tale...</td>\n",
159
- " <td>CLOSED</td>\n",
160
- " <td>0.800</td>\n",
161
- " <td>1</td>\n",
162
- " <td>0.016</td>\n",
163
- " <td>1.518</td>\n",
164
- " <td>1</td>\n",
165
- " <td>False</td>\n",
166
- " <td>True</td>\n",
167
- " <td>1.518</td>\n",
168
- " <td>True</td>\n",
169
- " <td>1.518</td>\n",
170
- " <td>3</td>\n",
171
- " <td>0.030</td>\n",
172
- " <td>0.672</td>\n",
173
- " <td>0.795</td>\n",
174
- " </tr>\n",
175
- " <tr>\n",
176
- " <th>3</th>\n",
177
- " <td>0x022b36c50b85b8ae7addfb8a35d76c59d5814834</td>\n",
178
- " <td>0x027f6bc849e273477f4a63085192714084917fcc0x02...</td>\n",
179
- " <td>2024-06-13 07:22:55+00:00</td>\n",
180
- " <td>Will the 2D-animated Paramount Plus show 'Tale...</td>\n",
181
- " <td>CLOSED</td>\n",
182
- " <td>0.456</td>\n",
183
- " <td>0</td>\n",
184
- " <td>0.009</td>\n",
185
- " <td>1.003</td>\n",
186
- " <td>1</td>\n",
187
- " <td>False</td>\n",
188
- " <td>False</td>\n",
189
- " <td>0.000</td>\n",
190
- " <td>True</td>\n",
191
- " <td>0.000</td>\n",
192
- " <td>3</td>\n",
193
- " <td>0.030</td>\n",
194
- " <td>-0.495</td>\n",
195
- " <td>-1.000</td>\n",
196
- " </tr>\n",
197
- " <tr>\n",
198
- " <th>4</th>\n",
199
- " <td>0x022b36c50b85b8ae7addfb8a35d76c59d5814834</td>\n",
200
- " <td>0x027f6bc849e273477f4a63085192714084917fcc0x02...</td>\n",
201
- " <td>2024-06-14 03:01:20+00:00</td>\n",
202
- " <td>Will the 2D-animated Paramount Plus show 'Tale...</td>\n",
203
- " <td>CLOSED</td>\n",
204
- " <td>0.704</td>\n",
205
- " <td>0</td>\n",
206
- " <td>0.014</td>\n",
207
- " <td>1.198</td>\n",
208
- " <td>1</td>\n",
209
- " <td>False</td>\n",
210
- " <td>False</td>\n",
211
- " <td>0.000</td>\n",
212
- " <td>True</td>\n",
213
- " <td>0.000</td>\n",
214
- " <td>3</td>\n",
215
- " <td>0.030</td>\n",
216
- " <td>-0.748</td>\n",
217
- " <td>-1.000</td>\n",
218
- " </tr>\n",
219
- " </tbody>\n",
220
- "</table>\n",
221
- "</div>"
222
- ],
223
  "text/plain": [
224
- " trader_address \\\n",
225
- "0 0x022b36c50b85b8ae7addfb8a35d76c59d5814834 \n",
226
- "1 0x022b36c50b85b8ae7addfb8a35d76c59d5814834 \n",
227
- "2 0x022b36c50b85b8ae7addfb8a35d76c59d5814834 \n",
228
- "3 0x022b36c50b85b8ae7addfb8a35d76c59d5814834 \n",
229
- "4 0x022b36c50b85b8ae7addfb8a35d76c59d5814834 \n",
230
- "\n",
231
- " trade_id \\\n",
232
- "0 0x017947579ab51313c31fe1cc562c0f1726ec09c90x02... \n",
233
- "1 0x027f6bc849e273477f4a63085192714084917fcc0x02... \n",
234
- "2 0x027f6bc849e273477f4a63085192714084917fcc0x02... \n",
235
- "3 0x027f6bc849e273477f4a63085192714084917fcc0x02... \n",
236
- "4 0x027f6bc849e273477f4a63085192714084917fcc0x02... \n",
237
- "\n",
238
- " creation_timestamp \\\n",
239
- "0 2024-05-19 01:26:30+00:00 \n",
240
- "1 2024-06-12 01:16:55+00:00 \n",
241
- "2 2024-06-12 15:08:00+00:00 \n",
242
- "3 2024-06-13 07:22:55+00:00 \n",
243
- "4 2024-06-14 03:01:20+00:00 \n",
244
- "\n",
245
- " title market_status \\\n",
246
- "0 Will Google's Pixel 9 lineup be officially rel... CLOSED \n",
247
- "1 Will the 2D-animated Paramount Plus show 'Tale... CLOSED \n",
248
- "2 Will the 2D-animated Paramount Plus show 'Tale... CLOSED \n",
249
- "3 Will the 2D-animated Paramount Plus show 'Tale... CLOSED \n",
250
- "4 Will the 2D-animated Paramount Plus show 'Tale... CLOSED \n",
251
- "\n",
252
- " collateral_amount outcome_index trade_fee_amount outcomes_tokens_traded \\\n",
253
- "0 0.638 1 0.013 1.206 \n",
254
- "1 1.000 1 0.020 1.840 \n",
255
- "2 0.800 1 0.016 1.518 \n",
256
- "3 0.456 0 0.009 1.003 \n",
257
- "4 0.704 0 0.014 1.198 \n",
258
- "\n",
259
- " current_answer is_invalid winning_trade earnings redeemed \\\n",
260
- "0 1 False True 1.206 True \n",
261
- "1 1 False True 1.840 True \n",
262
- "2 1 False True 1.518 True \n",
263
- "3 1 False False 0.000 True \n",
264
- "4 1 False False 0.000 True \n",
265
- "\n",
266
- " redeemed_amount num_mech_calls mech_fee_amount net_earnings roi \n",
267
- "0 1.206 0 0.000 0.556 0.854 \n",
268
- "1 1.840 3 0.030 0.790 0.752 \n",
269
- "2 1.518 3 0.030 0.672 0.795 \n",
270
- "3 0.000 3 0.030 -0.495 -1.000 \n",
271
- "4 0.000 3 0.030 -0.748 -1.000 "
272
  ]
273
  },
274
- "execution_count": 15,
275
  "metadata": {},
276
  "output_type": "execute_result"
277
  }
278
  ],
279
  "source": [
280
- "all_trades.head()"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  ]
282
  },
283
  {
284
  "cell_type": "code",
285
  "execution_count": 16,
286
  "metadata": {},
 
 
 
 
 
 
 
 
 
287
  "outputs": [
288
  {
289
  "data": {
@@ -307,6 +202,7 @@
307
  " <tr style=\"text-align: right;\">\n",
308
  " <th></th>\n",
309
  " <th>trader_address</th>\n",
 
310
  " <th>trade_id</th>\n",
311
  " <th>creation_timestamp</th>\n",
312
  " <th>title</th>\n",
@@ -329,184 +225,186 @@
329
  " </thead>\n",
330
  " <tbody>\n",
331
  " <tr>\n",
332
- " <th>18936</th>\n",
333
- " <td>0xc8929dd39bb5f685435ab16345929a47caacc46b</td>\n",
334
- " <td>0xd068383c5d6d1466d10db660f33524c2725f8fb60xc8...</td>\n",
335
- " <td>2024-05-22 19:05:00+00:00</td>\n",
336
- " <td>Will Elon Musk's Neuralink successfully test i...</td>\n",
337
- " <td>CLOSED</td>\n",
338
- " <td>0.100</td>\n",
339
- " <td>1</td>\n",
340
- " <td>0.002</td>\n",
341
- " <td>0.200</td>\n",
342
- " <td>1</td>\n",
343
- " <td>False</td>\n",
344
- " <td>True</td>\n",
345
- " <td>0.200</td>\n",
346
- " <td>False</td>\n",
347
- " <td>0.000</td>\n",
348
- " <td>2</td>\n",
349
- " <td>0.020</td>\n",
350
- " <td>0.078</td>\n",
351
- " <td>0.640</td>\n",
352
- " </tr>\n",
353
- " <tr>\n",
354
- " <th>18937</th>\n",
355
- " <td>0xc8929dd39bb5f685435ab16345929a47caacc46b</td>\n",
356
- " <td>0xec5578e95c71ddbad6aabf8517dcd35cf53da4970xc8...</td>\n",
357
- " <td>2024-05-22 17:57:35+00:00</td>\n",
358
- " <td>Will Kevin Spacey return to acting by 25 May 2...</td>\n",
359
  " <td>CLOSED</td>\n",
360
- " <td>0.160</td>\n",
361
  " <td>0</td>\n",
362
- " <td>0.003</td>\n",
363
- " <td>0.309</td>\n",
364
  " <td>0</td>\n",
365
  " <td>False</td>\n",
366
  " <td>True</td>\n",
367
- " <td>0.309</td>\n",
368
- " <td>False</td>\n",
369
- " <td>0.000</td>\n",
370
- " <td>2</td>\n",
371
- " <td>0.020</td>\n",
372
- " <td>0.126</td>\n",
373
- " <td>0.686</td>\n",
374
- " </tr>\n",
375
- " <tr>\n",
376
- " <th>18938</th>\n",
377
- " <td>0xc8929dd39bb5f685435ab16345929a47caacc46b</td>\n",
378
- " <td>0xf2c74ef39065ee2e239bf8551aedddd6b2d6add70xc8...</td>\n",
379
- " <td>2024-05-22 20:00:05+00:00</td>\n",
380
- " <td>Will Donald Trump testify in the hush money ca...</td>\n",
381
- " <td>CLOSED</td>\n",
382
- " <td>0.100</td>\n",
383
- " <td>1</td>\n",
384
- " <td>0.002</td>\n",
385
- " <td>0.200</td>\n",
386
- " <td>1</td>\n",
387
- " <td>False</td>\n",
388
  " <td>True</td>\n",
389
- " <td>0.200</td>\n",
390
- " <td>False</td>\n",
391
- " <td>0.000</td>\n",
392
- " <td>3</td>\n",
393
- " <td>0.030</td>\n",
394
- " <td>0.068</td>\n",
395
- " <td>0.518</td>\n",
396
- " </tr>\n",
397
- " <tr>\n",
398
- " <th>18939</th>\n",
399
- " <td>0xc8929dd39bb5f685435ab16345929a47caacc46b</td>\n",
400
- " <td>0xfdf1a762eaae0a4472599f26aeafeae043b37d360xc8...</td>\n",
401
- " <td>2024-05-22 19:42:35+00:00</td>\n",
402
- " <td>Will a new Marvel Cinematic Universe (MCU) mov...</td>\n",
403
- " <td>CLOSED</td>\n",
404
- " <td>0.100</td>\n",
405
  " <td>0</td>\n",
406
- " <td>0.002</td>\n",
407
- " <td>0.211</td>\n",
408
- " <td>1</td>\n",
409
- " <td>False</td>\n",
410
- " <td>False</td>\n",
411
- " <td>0.000</td>\n",
412
- " <td>False</td>\n",
413
- " <td>0.000</td>\n",
414
- " <td>2</td>\n",
415
- " <td>0.020</td>\n",
416
- " <td>-0.122</td>\n",
417
- " <td>-1.000</td>\n",
418
- " </tr>\n",
419
- " <tr>\n",
420
- " <th>18940</th>\n",
421
- " <td>0x7b2e78d4dfaaba045a167a70da285e30e8fca196</td>\n",
422
- " <td>0xaf8fa4b8e04bbbee6903fede1d27b3aad25b468e0x7b...</td>\n",
423
- " <td>2024-07-05 09:10:40+00:00</td>\n",
424
- " <td>Will Vice President Kamala Harris be the Democ...</td>\n",
425
- " <td>CLOSED</td>\n",
426
- " <td>1.000</td>\n",
427
- " <td>1</td>\n",
428
- " <td>0.020</td>\n",
429
- " <td>1.717</td>\n",
430
- " <td>1</td>\n",
431
- " <td>False</td>\n",
432
- " <td>True</td>\n",
433
- " <td>1.717</td>\n",
434
- " <td>False</td>\n",
435
- " <td>0.000</td>\n",
436
- " <td>0</td>\n",
437
- " <td>0.000</td>\n",
438
- " <td>0.697</td>\n",
439
- " <td>0.684</td>\n",
440
  " </tr>\n",
441
  " </tbody>\n",
442
  "</table>\n",
443
  "</div>"
444
  ],
445
  "text/plain": [
446
- " trader_address \\\n",
447
- "18936 0xc8929dd39bb5f685435ab16345929a47caacc46b \n",
448
- "18937 0xc8929dd39bb5f685435ab16345929a47caacc46b \n",
449
- "18938 0xc8929dd39bb5f685435ab16345929a47caacc46b \n",
450
- "18939 0xc8929dd39bb5f685435ab16345929a47caacc46b \n",
451
- "18940 0x7b2e78d4dfaaba045a167a70da285e30e8fca196 \n",
452
  "\n",
453
- " trade_id \\\n",
454
- "18936 0xd068383c5d6d1466d10db660f33524c2725f8fb60xc8... \n",
455
- "18937 0xec5578e95c71ddbad6aabf8517dcd35cf53da4970xc8... \n",
456
- "18938 0xf2c74ef39065ee2e239bf8551aedddd6b2d6add70xc8... \n",
457
- "18939 0xfdf1a762eaae0a4472599f26aeafeae043b37d360xc8... \n",
458
- "18940 0xaf8fa4b8e04bbbee6903fede1d27b3aad25b468e0x7b... \n",
459
  "\n",
460
- " creation_timestamp \\\n",
461
- "18936 2024-05-22 19:05:00+00:00 \n",
462
- "18937 2024-05-22 17:57:35+00:00 \n",
463
- "18938 2024-05-22 20:00:05+00:00 \n",
464
- "18939 2024-05-22 19:42:35+00:00 \n",
465
- "18940 2024-07-05 09:10:40+00:00 \n",
466
  "\n",
467
- " title market_status \\\n",
468
- "18936 Will Elon Musk's Neuralink successfully test i... CLOSED \n",
469
- "18937 Will Kevin Spacey return to acting by 25 May 2... CLOSED \n",
470
- "18938 Will Donald Trump testify in the hush money ca... CLOSED \n",
471
- "18939 Will a new Marvel Cinematic Universe (MCU) mov... CLOSED \n",
472
- "18940 Will Vice President Kamala Harris be the Democ... CLOSED \n",
473
  "\n",
474
- " collateral_amount outcome_index trade_fee_amount \\\n",
475
- "18936 0.100 1 0.002 \n",
476
- "18937 0.160 0 0.003 \n",
477
- "18938 0.100 1 0.002 \n",
478
- "18939 0.100 0 0.002 \n",
479
- "18940 1.000 1 0.020 \n",
480
  "\n",
481
- " outcomes_tokens_traded current_answer is_invalid winning_trade \\\n",
482
- "18936 0.200 1 False True \n",
483
- "18937 0.309 0 False True \n",
484
- "18938 0.200 1 False True \n",
485
- "18939 0.211 1 False False \n",
486
- "18940 1.717 1 False True \n",
487
  "\n",
488
- " earnings redeemed redeemed_amount num_mech_calls mech_fee_amount \\\n",
489
- "18936 0.200 False 0.000 2 0.020 \n",
490
- "18937 0.309 False 0.000 2 0.020 \n",
491
- "18938 0.200 False 0.000 3 0.030 \n",
492
- "18939 0.000 False 0.000 2 0.020 \n",
493
- "18940 1.717 False 0.000 0 0.000 \n",
494
  "\n",
495
- " net_earnings roi \n",
496
- "18936 0.078 0.640 \n",
497
- "18937 0.126 0.686 \n",
498
- "18938 0.068 0.518 \n",
499
- "18939 -0.122 -1.000 \n",
500
- "18940 0.697 0.684 "
501
  ]
502
  },
503
- "execution_count": 16,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504
  "metadata": {},
505
  "output_type": "execute_result"
506
  }
507
  ],
508
  "source": [
509
- "all_trades.tail()"
510
  ]
511
  },
512
  {
 
40
  },
41
  {
42
  "cell_type": "code",
43
+ "execution_count": 29,
44
  "metadata": {},
45
  "outputs": [],
46
  "source": [
 
51
  },
52
  {
53
  "cell_type": "code",
54
+ "execution_count": 30,
55
+ "metadata": {},
56
+ "outputs": [
57
+ {
58
+ "data": {
59
+ "text/plain": [
60
+ "currentAnswer\n",
61
+ "No 66982\n",
62
+ "Yes 42810\n",
63
+ "Name: count, dtype: int64"
64
+ ]
65
+ },
66
+ "execution_count": 30,
67
+ "metadata": {},
68
+ "output_type": "execute_result"
69
+ }
70
+ ],
71
+ "source": [
72
+ "tools.currentAnswer.value_counts()"
73
+ ]
74
+ },
75
+ {
76
+ "cell_type": "code",
77
+ "execution_count": 15,
78
  "metadata": {},
79
  "outputs": [],
80
  "source": [
 
83
  },
84
  {
85
  "cell_type": "code",
86
+ "execution_count": null,
87
+ "metadata": {},
88
+ "outputs": [],
89
+ "source": [
90
+ "all_trades.head()"
91
+ ]
92
+ },
93
+ {
94
+ "cell_type": "code",
95
+ "execution_count": 12,
96
  "metadata": {},
97
  "outputs": [
98
  {
99
  "data": {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  "text/plain": [
101
+ "count 8210.000000\n",
102
+ "mean 0.129631\n",
103
+ "std 22.449193\n",
104
+ "min -1.000000\n",
105
+ "25% -1.000000\n",
106
+ "50% 0.117954\n",
107
+ "75% 0.541716\n",
108
+ "max 2032.090177\n",
109
+ "Name: roi, dtype: float64"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  ]
111
  },
112
+ "execution_count": 12,
113
  "metadata": {},
114
  "output_type": "execute_result"
115
  }
116
  ],
117
  "source": [
118
+ "all_trades.roi.describe()"
119
+ ]
120
+ },
121
+ {
122
+ "cell_type": "code",
123
+ "execution_count": 13,
124
+ "metadata": {},
125
+ "outputs": [
126
+ {
127
+ "data": {
128
+ "text/plain": [
129
+ "2032.0901766222644"
130
+ ]
131
+ },
132
+ "execution_count": 13,
133
+ "metadata": {},
134
+ "output_type": "execute_result"
135
+ }
136
+ ],
137
+ "source": [
138
+ "max(all_trades.roi)"
139
+ ]
140
+ },
141
+ {
142
+ "cell_type": "code",
143
+ "execution_count": 19,
144
+ "metadata": {},
145
+ "outputs": [
146
+ {
147
+ "data": {
148
+ "text/plain": [
149
+ "count 8.210000e+03\n",
150
+ "mean 1.269746e-02\n",
151
+ "std 1.381237e-02\n",
152
+ "min 2.000000e-07\n",
153
+ "25% 3.200000e-03\n",
154
+ "50% 1.014609e-02\n",
155
+ "75% 2.000000e-02\n",
156
+ "max 4.400000e-01\n",
157
+ "Name: trade_fee_amount, dtype: float64"
158
+ ]
159
+ },
160
+ "execution_count": 19,
161
+ "metadata": {},
162
+ "output_type": "execute_result"
163
+ }
164
+ ],
165
+ "source": [
166
+ "all_trades.trade_fee_amount.describe()"
167
  ]
168
  },
169
  {
170
  "cell_type": "code",
171
  "execution_count": 16,
172
  "metadata": {},
173
+ "outputs": [],
174
+ "source": [
175
+ "to_investigate = all_trades.loc[all_trades[\"roi\"]==max(all_trades.roi)]"
176
+ ]
177
+ },
178
+ {
179
+ "cell_type": "code",
180
+ "execution_count": 17,
181
+ "metadata": {},
182
  "outputs": [
183
  {
184
  "data": {
 
202
  " <tr style=\"text-align: right;\">\n",
203
  " <th></th>\n",
204
  " <th>trader_address</th>\n",
205
+ " <th>market_creator</th>\n",
206
  " <th>trade_id</th>\n",
207
  " <th>creation_timestamp</th>\n",
208
  " <th>title</th>\n",
 
225
  " </thead>\n",
226
  " <tbody>\n",
227
  " <tr>\n",
228
+ " <th>928</th>\n",
229
+ " <td>0x3666da333dadd05083fef9ff6ddee588d26e4307</td>\n",
230
+ " <td>quickstart</td>\n",
231
+ " <td>0x11cf6ec9649097127238ffb789b0703da448d9fa0x36...</td>\n",
232
+ " <td>2024-09-15 02:02:05+00:00</td>\n",
233
+ " <td>Will Apple launch the iPhone 16 by 15 Septembe...</td>\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  " <td>CLOSED</td>\n",
235
+ " <td>0.00001</td>\n",
236
  " <td>0</td>\n",
237
+ " <td>2.000000e-07</td>\n",
238
+ " <td>0.020738</td>\n",
239
  " <td>0</td>\n",
240
  " <td>False</td>\n",
241
  " <td>True</td>\n",
242
+ " <td>0.020738</td>\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  " <td>True</td>\n",
244
+ " <td>0.020738</td>\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
  " <td>0</td>\n",
246
+ " <td>0.0</td>\n",
247
+ " <td>0.020727</td>\n",
248
+ " <td>2032.090177</td>\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
  " </tr>\n",
250
  " </tbody>\n",
251
  "</table>\n",
252
  "</div>"
253
  ],
254
  "text/plain": [
255
+ " trader_address market_creator \\\n",
256
+ "928 0x3666da333dadd05083fef9ff6ddee588d26e4307 quickstart \n",
 
 
 
 
257
  "\n",
258
+ " trade_id \\\n",
259
+ "928 0x11cf6ec9649097127238ffb789b0703da448d9fa0x36... \n",
 
 
 
 
260
  "\n",
261
+ " creation_timestamp \\\n",
262
+ "928 2024-09-15 02:02:05+00:00 \n",
 
 
 
 
263
  "\n",
264
+ " title market_status \\\n",
265
+ "928 Will Apple launch the iPhone 16 by 15 Septembe... CLOSED \n",
 
 
 
 
266
  "\n",
267
+ " collateral_amount outcome_index trade_fee_amount \\\n",
268
+ "928 0.00001 0 2.000000e-07 \n",
 
 
 
 
269
  "\n",
270
+ " outcomes_tokens_traded current_answer is_invalid winning_trade \\\n",
271
+ "928 0.020738 0 False True \n",
 
 
 
 
272
  "\n",
273
+ " earnings redeemed redeemed_amount num_mech_calls mech_fee_amount \\\n",
274
+ "928 0.020738 True 0.020738 0 0.0 \n",
 
 
 
 
275
  "\n",
276
+ " net_earnings roi \n",
277
+ "928 0.020727 2032.090177 "
 
 
 
 
278
  ]
279
  },
280
+ "execution_count": 17,
281
+ "metadata": {},
282
+ "output_type": "execute_result"
283
+ }
284
+ ],
285
+ "source": [
286
+ "to_investigate"
287
+ ]
288
+ },
289
+ {
290
+ "cell_type": "code",
291
+ "execution_count": 27,
292
+ "metadata": {},
293
+ "outputs": [
294
+ {
295
+ "data": {
296
+ "text/plain": [
297
+ "928 0.036337\n",
298
+ "dtype: float64"
299
+ ]
300
+ },
301
+ "execution_count": 27,
302
+ "metadata": {},
303
+ "output_type": "execute_result"
304
+ }
305
+ ],
306
+ "source": [
307
+ "(to_investigate.net_earnings -(to_investigate.trade_fee_amount + 2*0.01)) / (to_investigate.collateral_amount + to_investigate.trade_fee_amount + 2*0.01)"
308
+ ]
309
+ },
310
+ {
311
+ "cell_type": "code",
312
+ "execution_count": 22,
313
+ "metadata": {},
314
+ "outputs": [],
315
+ "source": [
316
+ "trades_no_mech = all_trades.loc[all_trades[\"num_mech_calls\"]==0]"
317
+ ]
318
+ },
319
+ {
320
+ "cell_type": "code",
321
+ "execution_count": 23,
322
+ "metadata": {},
323
+ "outputs": [
324
+ {
325
+ "name": "stdout",
326
+ "output_type": "stream",
327
+ "text": [
328
+ "<class 'pandas.core.frame.DataFrame'>\n",
329
+ "Index: 1649 entries, 61 to 8201\n",
330
+ "Data columns (total 20 columns):\n",
331
+ " # Column Non-Null Count Dtype \n",
332
+ "--- ------ -------------- ----- \n",
333
+ " 0 trader_address 1649 non-null object \n",
334
+ " 1 market_creator 1649 non-null object \n",
335
+ " 2 trade_id 1649 non-null object \n",
336
+ " 3 creation_timestamp 1649 non-null datetime64[ns, UTC]\n",
337
+ " 4 title 1649 non-null object \n",
338
+ " 5 market_status 1649 non-null object \n",
339
+ " 6 collateral_amount 1649 non-null float64 \n",
340
+ " 7 outcome_index 1649 non-null object \n",
341
+ " 8 trade_fee_amount 1649 non-null float64 \n",
342
+ " 9 outcomes_tokens_traded 1649 non-null float64 \n",
343
+ " 10 current_answer 1649 non-null int64 \n",
344
+ " 11 is_invalid 1649 non-null bool \n",
345
+ " 12 winning_trade 1649 non-null bool \n",
346
+ " 13 earnings 1649 non-null float64 \n",
347
+ " 14 redeemed 1649 non-null bool \n",
348
+ " 15 redeemed_amount 1649 non-null float64 \n",
349
+ " 16 num_mech_calls 1649 non-null int64 \n",
350
+ " 17 mech_fee_amount 1649 non-null float64 \n",
351
+ " 18 net_earnings 1649 non-null float64 \n",
352
+ " 19 roi 1649 non-null float64 \n",
353
+ "dtypes: bool(3), datetime64[ns, UTC](1), float64(8), int64(2), object(6)\n",
354
+ "memory usage: 236.7+ KB\n"
355
+ ]
356
+ }
357
+ ],
358
+ "source": [
359
+ "trades_no_mech.info()"
360
+ ]
361
+ },
362
+ {
363
+ "cell_type": "code",
364
+ "execution_count": 28,
365
+ "metadata": {},
366
+ "outputs": [
367
+ {
368
+ "data": {
369
+ "text/plain": [
370
+ "0.20085261875761268"
371
+ ]
372
+ },
373
+ "execution_count": 28,
374
+ "metadata": {},
375
+ "output_type": "execute_result"
376
+ }
377
+ ],
378
+ "source": [
379
+ "len(trades_no_mech)/len(all_trades)"
380
+ ]
381
+ },
382
+ {
383
+ "cell_type": "code",
384
+ "execution_count": 25,
385
+ "metadata": {},
386
+ "outputs": [
387
+ {
388
+ "data": {
389
+ "text/plain": [
390
+ "count 1649.000000\n",
391
+ "mean 1.378776\n",
392
+ "std 50.053860\n",
393
+ "min -1.000000\n",
394
+ "25% -1.000000\n",
395
+ "50% 0.199740\n",
396
+ "75% 0.673038\n",
397
+ "max 2032.090177\n",
398
+ "Name: roi, dtype: float64"
399
+ ]
400
+ },
401
+ "execution_count": 25,
402
  "metadata": {},
403
  "output_type": "execute_result"
404
  }
405
  ],
406
  "source": [
407
+ "trades_no_mech.roi.describe()"
408
  ]
409
  },
410
  {
tabs/tool_accuracy.py CHANGED
@@ -127,7 +127,9 @@ def plot_tools_weighted_accuracy_graph(tools_accuracy_info: pd.DataFrame):
127
  return gr.Plot(value=plot.get_figure())
128
 
129
 
130
- def plot_tools_weighted_accuracy_rotated_graph(tools_accuracy_info: pd.DataFrame):
 
 
131
  tools_accuracy_info = tools_accuracy_info.sort_values(
132
  by="weighted_accuracy", ascending=False
133
  )
 
127
  return gr.Plot(value=plot.get_figure())
128
 
129
 
130
+ def plot_tools_weighted_accuracy_rotated_graph(
131
+ tools_accuracy_info: pd.DataFrame,
132
+ ) -> gr.Plot:
133
  tools_accuracy_info = tools_accuracy_info.sort_values(
134
  by="weighted_accuracy", ascending=False
135
  )