cyberosa
commited on
Commit
·
d48b280
1
Parent(s):
f632617
Adding filter for invalid markets for trades stats
Browse files- notebooks/markets_analysis.ipynb +63 -227
- scripts/profitability.py +4 -0
notebooks/markets_analysis.ipynb
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
-
"execution_count":
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
@@ -167,7 +167,7 @@
|
|
167 |
},
|
168 |
{
|
169 |
"cell_type": "code",
|
170 |
-
"execution_count":
|
171 |
"metadata": {},
|
172 |
"outputs": [],
|
173 |
"source": [
|
@@ -176,301 +176,137 @@
|
|
176 |
},
|
177 |
{
|
178 |
"cell_type": "code",
|
179 |
-
"execution_count":
|
180 |
"metadata": {},
|
181 |
"outputs": [
|
182 |
{
|
183 |
"data": {
|
184 |
"text/plain": [
|
185 |
-
"
|
|
|
|
|
|
|
186 |
]
|
187 |
},
|
188 |
-
"execution_count":
|
189 |
"metadata": {},
|
190 |
"output_type": "execute_result"
|
191 |
}
|
192 |
],
|
193 |
"source": [
|
194 |
-
"
|
195 |
]
|
196 |
},
|
197 |
{
|
198 |
"cell_type": "code",
|
199 |
-
"execution_count":
|
200 |
"metadata": {},
|
201 |
"outputs": [
|
202 |
{
|
203 |
"data": {
|
204 |
"text/plain": [
|
205 |
-
"
|
206 |
]
|
207 |
},
|
208 |
-
"execution_count":
|
209 |
"metadata": {},
|
210 |
"output_type": "execute_result"
|
211 |
}
|
212 |
],
|
213 |
"source": [
|
214 |
-
"
|
|
|
|
|
215 |
]
|
216 |
},
|
217 |
{
|
218 |
"cell_type": "code",
|
219 |
-
"execution_count":
|
220 |
"metadata": {},
|
221 |
"outputs": [
|
222 |
{
|
223 |
"data": {
|
224 |
-
"text/html": [
|
225 |
-
"<div>\n",
|
226 |
-
"<style scoped>\n",
|
227 |
-
" .dataframe tbody tr th:only-of-type {\n",
|
228 |
-
" vertical-align: middle;\n",
|
229 |
-
" }\n",
|
230 |
-
"\n",
|
231 |
-
" .dataframe tbody tr th {\n",
|
232 |
-
" vertical-align: top;\n",
|
233 |
-
" }\n",
|
234 |
-
"\n",
|
235 |
-
" .dataframe thead th {\n",
|
236 |
-
" text-align: right;\n",
|
237 |
-
" }\n",
|
238 |
-
"</style>\n",
|
239 |
-
"<table border=\"1\" class=\"dataframe\">\n",
|
240 |
-
" <thead>\n",
|
241 |
-
" <tr style=\"text-align: right;\">\n",
|
242 |
-
" <th></th>\n",
|
243 |
-
" <th>trader_address</th>\n",
|
244 |
-
" <th>trade_id</th>\n",
|
245 |
-
" <th>creation_timestamp</th>\n",
|
246 |
-
" <th>title</th>\n",
|
247 |
-
" <th>market_status</th>\n",
|
248 |
-
" <th>collateral_amount</th>\n",
|
249 |
-
" <th>outcome_index</th>\n",
|
250 |
-
" <th>trade_fee_amount</th>\n",
|
251 |
-
" <th>outcomes_tokens_traded</th>\n",
|
252 |
-
" <th>current_answer</th>\n",
|
253 |
-
" <th>is_invalid</th>\n",
|
254 |
-
" <th>winning_trade</th>\n",
|
255 |
-
" <th>earnings</th>\n",
|
256 |
-
" <th>redeemed</th>\n",
|
257 |
-
" <th>redeemed_amount</th>\n",
|
258 |
-
" <th>num_mech_calls</th>\n",
|
259 |
-
" <th>mech_fee_amount</th>\n",
|
260 |
-
" <th>net_earnings</th>\n",
|
261 |
-
" <th>roi</th>\n",
|
262 |
-
" </tr>\n",
|
263 |
-
" </thead>\n",
|
264 |
-
" <tbody>\n",
|
265 |
-
" <tr>\n",
|
266 |
-
" <th>0</th>\n",
|
267 |
-
" <td>0x034c4ad84f7ac6638bf19300d5bbe7d9b981e736</td>\n",
|
268 |
-
" <td>0x005e3f7a90585acbec807425a750fbba1d0c2b5c0x03...</td>\n",
|
269 |
-
" <td>2024-05-12 04:26:35+00:00</td>\n",
|
270 |
-
" <td>Will Apple announce the release of a new M4 ch...</td>\n",
|
271 |
-
" <td>CLOSED</td>\n",
|
272 |
-
" <td>0.682360</td>\n",
|
273 |
-
" <td>0</td>\n",
|
274 |
-
" <td>0.013647</td>\n",
|
275 |
-
" <td>0.889368</td>\n",
|
276 |
-
" <td>0</td>\n",
|
277 |
-
" <td>False</td>\n",
|
278 |
-
" <td>True</td>\n",
|
279 |
-
" <td>0.889368</td>\n",
|
280 |
-
" <td>True</td>\n",
|
281 |
-
" <td>0.889368</td>\n",
|
282 |
-
" <td>0</td>\n",
|
283 |
-
" <td>0.0</td>\n",
|
284 |
-
" <td>0.193360</td>\n",
|
285 |
-
" <td>0.277813</td>\n",
|
286 |
-
" </tr>\n",
|
287 |
-
" <tr>\n",
|
288 |
-
" <th>1</th>\n",
|
289 |
-
" <td>0x034c4ad84f7ac6638bf19300d5bbe7d9b981e736</td>\n",
|
290 |
-
" <td>0x017947579ab51313c31fe1cc562c0f1726ec09c90x03...</td>\n",
|
291 |
-
" <td>2024-05-21 04:26:40+00:00</td>\n",
|
292 |
-
" <td>Will Google's Pixel 9 lineup be officially rel...</td>\n",
|
293 |
-
" <td>CLOSED</td>\n",
|
294 |
-
" <td>0.732158</td>\n",
|
295 |
-
" <td>1</td>\n",
|
296 |
-
" <td>0.014643</td>\n",
|
297 |
-
" <td>1.120798</td>\n",
|
298 |
-
" <td>1</td>\n",
|
299 |
-
" <td>False</td>\n",
|
300 |
-
" <td>True</td>\n",
|
301 |
-
" <td>1.120798</td>\n",
|
302 |
-
" <td>True</td>\n",
|
303 |
-
" <td>1.120798</td>\n",
|
304 |
-
" <td>0</td>\n",
|
305 |
-
" <td>0.0</td>\n",
|
306 |
-
" <td>0.373997</td>\n",
|
307 |
-
" <td>0.500799</td>\n",
|
308 |
-
" </tr>\n",
|
309 |
-
" <tr>\n",
|
310 |
-
" <th>2</th>\n",
|
311 |
-
" <td>0x034c4ad84f7ac6638bf19300d5bbe7d9b981e736</td>\n",
|
312 |
-
" <td>0x0290d432108f22fdc91e6677b1436e7bc702bced0x03...</td>\n",
|
313 |
-
" <td>2024-05-09 08:26:30+00:00</td>\n",
|
314 |
-
" <td>Will the ICC take legal action against Israel ...</td>\n",
|
315 |
-
" <td>CLOSED</td>\n",
|
316 |
-
" <td>1.246551</td>\n",
|
317 |
-
" <td>0</td>\n",
|
318 |
-
" <td>0.024931</td>\n",
|
319 |
-
" <td>2.505972</td>\n",
|
320 |
-
" <td>0</td>\n",
|
321 |
-
" <td>False</td>\n",
|
322 |
-
" <td>True</td>\n",
|
323 |
-
" <td>2.505972</td>\n",
|
324 |
-
" <td>True</td>\n",
|
325 |
-
" <td>2.505972</td>\n",
|
326 |
-
" <td>0</td>\n",
|
327 |
-
" <td>0.0</td>\n",
|
328 |
-
" <td>1.234490</td>\n",
|
329 |
-
" <td>0.970906</td>\n",
|
330 |
-
" </tr>\n",
|
331 |
-
" <tr>\n",
|
332 |
-
" <th>3</th>\n",
|
333 |
-
" <td>0x034c4ad84f7ac6638bf19300d5bbe7d9b981e736</td>\n",
|
334 |
-
" <td>0x02c244eef143b16254f3d6a444c2e44d35a175590x03...</td>\n",
|
335 |
-
" <td>2024-05-04 04:24:20+00:00</td>\n",
|
336 |
-
" <td>Will Trent Staggs win the Senatorial race to r...</td>\n",
|
337 |
-
" <td>CLOSED</td>\n",
|
338 |
-
" <td>1.219659</td>\n",
|
339 |
-
" <td>0</td>\n",
|
340 |
-
" <td>0.024393</td>\n",
|
341 |
-
" <td>2.948666</td>\n",
|
342 |
-
" <td>1</td>\n",
|
343 |
-
" <td>False</td>\n",
|
344 |
-
" <td>False</td>\n",
|
345 |
-
" <td>0.000000</td>\n",
|
346 |
-
" <td>True</td>\n",
|
347 |
-
" <td>0.000000</td>\n",
|
348 |
-
" <td>0</td>\n",
|
349 |
-
" <td>0.0</td>\n",
|
350 |
-
" <td>-1.244052</td>\n",
|
351 |
-
" <td>-1.000000</td>\n",
|
352 |
-
" </tr>\n",
|
353 |
-
" <tr>\n",
|
354 |
-
" <th>4</th>\n",
|
355 |
-
" <td>0x034c4ad84f7ac6638bf19300d5bbe7d9b981e736</td>\n",
|
356 |
-
" <td>0x0518764fb0684f3156c200ae78d4214d19d8b9530x03...</td>\n",
|
357 |
-
" <td>2024-05-19 04:22:50+00:00</td>\n",
|
358 |
-
" <td>Will OpenAI release another model update by 20...</td>\n",
|
359 |
-
" <td>CLOSED</td>\n",
|
360 |
-
" <td>1.203097</td>\n",
|
361 |
-
" <td>1</td>\n",
|
362 |
-
" <td>0.024062</td>\n",
|
363 |
-
" <td>3.143667</td>\n",
|
364 |
-
" <td>0</td>\n",
|
365 |
-
" <td>False</td>\n",
|
366 |
-
" <td>False</td>\n",
|
367 |
-
" <td>0.000000</td>\n",
|
368 |
-
" <td>True</td>\n",
|
369 |
-
" <td>0.000000</td>\n",
|
370 |
-
" <td>0</td>\n",
|
371 |
-
" <td>0.0</td>\n",
|
372 |
-
" <td>-1.227159</td>\n",
|
373 |
-
" <td>-1.000000</td>\n",
|
374 |
-
" </tr>\n",
|
375 |
-
" </tbody>\n",
|
376 |
-
"</table>\n",
|
377 |
-
"</div>"
|
378 |
-
],
|
379 |
"text/plain": [
|
380 |
-
"
|
381 |
-
"0 0x034c4ad84f7ac6638bf19300d5bbe7d9b981e736 \n",
|
382 |
-
"1 0x034c4ad84f7ac6638bf19300d5bbe7d9b981e736 \n",
|
383 |
-
"2 0x034c4ad84f7ac6638bf19300d5bbe7d9b981e736 \n",
|
384 |
-
"3 0x034c4ad84f7ac6638bf19300d5bbe7d9b981e736 \n",
|
385 |
-
"4 0x034c4ad84f7ac6638bf19300d5bbe7d9b981e736 \n",
|
386 |
-
"\n",
|
387 |
-
" trade_id \\\n",
|
388 |
-
"0 0x005e3f7a90585acbec807425a750fbba1d0c2b5c0x03... \n",
|
389 |
-
"1 0x017947579ab51313c31fe1cc562c0f1726ec09c90x03... \n",
|
390 |
-
"2 0x0290d432108f22fdc91e6677b1436e7bc702bced0x03... \n",
|
391 |
-
"3 0x02c244eef143b16254f3d6a444c2e44d35a175590x03... \n",
|
392 |
-
"4 0x0518764fb0684f3156c200ae78d4214d19d8b9530x03... \n",
|
393 |
-
"\n",
|
394 |
-
" creation_timestamp \\\n",
|
395 |
-
"0 2024-05-12 04:26:35+00:00 \n",
|
396 |
-
"1 2024-05-21 04:26:40+00:00 \n",
|
397 |
-
"2 2024-05-09 08:26:30+00:00 \n",
|
398 |
-
"3 2024-05-04 04:24:20+00:00 \n",
|
399 |
-
"4 2024-05-19 04:22:50+00:00 \n",
|
400 |
-
"\n",
|
401 |
-
" title market_status \\\n",
|
402 |
-
"0 Will Apple announce the release of a new M4 ch... CLOSED \n",
|
403 |
-
"1 Will Google's Pixel 9 lineup be officially rel... CLOSED \n",
|
404 |
-
"2 Will the ICC take legal action against Israel ... CLOSED \n",
|
405 |
-
"3 Will Trent Staggs win the Senatorial race to r... CLOSED \n",
|
406 |
-
"4 Will OpenAI release another model update by 20... CLOSED \n",
|
407 |
-
"\n",
|
408 |
-
" collateral_amount outcome_index trade_fee_amount outcomes_tokens_traded \\\n",
|
409 |
-
"0 0.682360 0 0.013647 0.889368 \n",
|
410 |
-
"1 0.732158 1 0.014643 1.120798 \n",
|
411 |
-
"2 1.246551 0 0.024931 2.505972 \n",
|
412 |
-
"3 1.219659 0 0.024393 2.948666 \n",
|
413 |
-
"4 1.203097 1 0.024062 3.143667 \n",
|
414 |
-
"\n",
|
415 |
-
" current_answer is_invalid winning_trade earnings redeemed \\\n",
|
416 |
-
"0 0 False True 0.889368 True \n",
|
417 |
-
"1 1 False True 1.120798 True \n",
|
418 |
-
"2 0 False True 2.505972 True \n",
|
419 |
-
"3 1 False False 0.000000 True \n",
|
420 |
-
"4 0 False False 0.000000 True \n",
|
421 |
-
"\n",
|
422 |
-
" redeemed_amount num_mech_calls mech_fee_amount net_earnings roi \n",
|
423 |
-
"0 0.889368 0 0.0 0.193360 0.277813 \n",
|
424 |
-
"1 1.120798 0 0.0 0.373997 0.500799 \n",
|
425 |
-
"2 2.505972 0 0.0 1.234490 0.970906 \n",
|
426 |
-
"3 0.000000 0 0.0 -1.244052 -1.000000 \n",
|
427 |
-
"4 0.000000 0 0.0 -1.227159 -1.000000 "
|
428 |
]
|
429 |
},
|
430 |
-
"execution_count":
|
431 |
"metadata": {},
|
432 |
"output_type": "execute_result"
|
433 |
}
|
434 |
],
|
435 |
"source": [
|
436 |
-
"all_trades
|
437 |
]
|
438 |
},
|
439 |
{
|
440 |
"cell_type": "code",
|
441 |
-
"execution_count":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
442 |
"metadata": {},
|
443 |
"outputs": [
|
444 |
{
|
445 |
"data": {
|
446 |
"text/plain": [
|
447 |
"winning_trade\n",
|
448 |
-
"False 14574\n",
|
449 |
"True 13133\n",
|
|
|
450 |
"Name: count, dtype: int64"
|
451 |
]
|
452 |
},
|
453 |
-
"execution_count":
|
454 |
"metadata": {},
|
455 |
"output_type": "execute_result"
|
456 |
}
|
457 |
],
|
458 |
"source": [
|
459 |
-
"
|
460 |
]
|
461 |
},
|
462 |
{
|
463 |
"cell_type": "code",
|
464 |
-
"execution_count":
|
465 |
"metadata": {},
|
466 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
467 |
"source": [
|
468 |
-
"
|
469 |
]
|
470 |
},
|
471 |
{
|
472 |
"cell_type": "code",
|
473 |
-
"execution_count":
|
474 |
"metadata": {},
|
475 |
"outputs": [
|
476 |
{
|
@@ -479,17 +315,17 @@
|
|
479 |
"current_answer\n",
|
480 |
" 1 13016\n",
|
481 |
" 0 10814\n",
|
482 |
-
"-1
|
483 |
"Name: count, dtype: int64"
|
484 |
]
|
485 |
},
|
486 |
-
"execution_count":
|
487 |
"metadata": {},
|
488 |
"output_type": "execute_result"
|
489 |
}
|
490 |
],
|
491 |
"source": [
|
492 |
-
"
|
493 |
]
|
494 |
},
|
495 |
{
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": 2,
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
|
|
167 |
},
|
168 |
{
|
169 |
"cell_type": "code",
|
170 |
+
"execution_count": 3,
|
171 |
"metadata": {},
|
172 |
"outputs": [],
|
173 |
"source": [
|
|
|
176 |
},
|
177 |
{
|
178 |
"cell_type": "code",
|
179 |
+
"execution_count": 5,
|
180 |
"metadata": {},
|
181 |
"outputs": [
|
182 |
{
|
183 |
"data": {
|
184 |
"text/plain": [
|
185 |
+
"is_invalid\n",
|
186 |
+
"False 23830\n",
|
187 |
+
"True 3877\n",
|
188 |
+
"Name: count, dtype: int64"
|
189 |
]
|
190 |
},
|
191 |
+
"execution_count": 5,
|
192 |
"metadata": {},
|
193 |
"output_type": "execute_result"
|
194 |
}
|
195 |
],
|
196 |
"source": [
|
197 |
+
"all_trades.is_invalid.value_counts()"
|
198 |
]
|
199 |
},
|
200 |
{
|
201 |
"cell_type": "code",
|
202 |
+
"execution_count": 7,
|
203 |
"metadata": {},
|
204 |
"outputs": [
|
205 |
{
|
206 |
"data": {
|
207 |
"text/plain": [
|
208 |
+
"24722"
|
209 |
]
|
210 |
},
|
211 |
+
"execution_count": 7,
|
212 |
"metadata": {},
|
213 |
"output_type": "execute_result"
|
214 |
}
|
215 |
],
|
216 |
"source": [
|
217 |
+
"mask = (all_trades[\"is_invalid\"] & all_trades[\"redeemed\"])\n",
|
218 |
+
"filtered_trades = all_trades[~mask]\n",
|
219 |
+
"len(filtered_trades)"
|
220 |
]
|
221 |
},
|
222 |
{
|
223 |
"cell_type": "code",
|
224 |
+
"execution_count": 4,
|
225 |
"metadata": {},
|
226 |
"outputs": [
|
227 |
{
|
228 |
"data": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
"text/plain": [
|
230 |
+
"27707"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
]
|
232 |
},
|
233 |
+
"execution_count": 4,
|
234 |
"metadata": {},
|
235 |
"output_type": "execute_result"
|
236 |
}
|
237 |
],
|
238 |
"source": [
|
239 |
+
"len(all_trades)"
|
240 |
]
|
241 |
},
|
242 |
{
|
243 |
"cell_type": "code",
|
244 |
+
"execution_count": 8,
|
245 |
+
"metadata": {},
|
246 |
+
"outputs": [
|
247 |
+
{
|
248 |
+
"data": {
|
249 |
+
"text/plain": [
|
250 |
+
"24722"
|
251 |
+
]
|
252 |
+
},
|
253 |
+
"execution_count": 8,
|
254 |
+
"metadata": {},
|
255 |
+
"output_type": "execute_result"
|
256 |
+
}
|
257 |
+
],
|
258 |
+
"source": [
|
259 |
+
"len(filtered_trades)"
|
260 |
+
]
|
261 |
+
},
|
262 |
+
{
|
263 |
+
"cell_type": "code",
|
264 |
+
"execution_count": 9,
|
265 |
"metadata": {},
|
266 |
"outputs": [
|
267 |
{
|
268 |
"data": {
|
269 |
"text/plain": [
|
270 |
"winning_trade\n",
|
|
|
271 |
"True 13133\n",
|
272 |
+
"False 11589\n",
|
273 |
"Name: count, dtype: int64"
|
274 |
]
|
275 |
},
|
276 |
+
"execution_count": 9,
|
277 |
"metadata": {},
|
278 |
"output_type": "execute_result"
|
279 |
}
|
280 |
],
|
281 |
"source": [
|
282 |
+
"filtered_trades.winning_trade.value_counts()"
|
283 |
]
|
284 |
},
|
285 |
{
|
286 |
"cell_type": "code",
|
287 |
+
"execution_count": 10,
|
288 |
"metadata": {},
|
289 |
+
"outputs": [
|
290 |
+
{
|
291 |
+
"name": "stderr",
|
292 |
+
"output_type": "stream",
|
293 |
+
"text": [
|
294 |
+
"/var/folders/gp/02mb1d514ng739czlxw1lhh00000gn/T/ipykernel_82376/982645160.py:1: SettingWithCopyWarning: \n",
|
295 |
+
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
|
296 |
+
"Try using .loc[row_indexer,col_indexer] = value instead\n",
|
297 |
+
"\n",
|
298 |
+
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
|
299 |
+
" filtered_trades[\"creation_timestamp\"] = pd.to_datetime(filtered_trades[\"creation_timestamp\"])\n"
|
300 |
+
]
|
301 |
+
}
|
302 |
+
],
|
303 |
"source": [
|
304 |
+
"filtered_trades[\"creation_timestamp\"] = pd.to_datetime(filtered_trades[\"creation_timestamp\"])"
|
305 |
]
|
306 |
},
|
307 |
{
|
308 |
"cell_type": "code",
|
309 |
+
"execution_count": 11,
|
310 |
"metadata": {},
|
311 |
"outputs": [
|
312 |
{
|
|
|
315 |
"current_answer\n",
|
316 |
" 1 13016\n",
|
317 |
" 0 10814\n",
|
318 |
+
"-1 892\n",
|
319 |
"Name: count, dtype: int64"
|
320 |
]
|
321 |
},
|
322 |
+
"execution_count": 11,
|
323 |
"metadata": {},
|
324 |
"output_type": "execute_result"
|
325 |
}
|
326 |
],
|
327 |
"source": [
|
328 |
+
"filtered_trades.current_answer.value_counts()"
|
329 |
]
|
330 |
},
|
331 |
{
|
scripts/profitability.py
CHANGED
@@ -617,6 +617,10 @@ def run_profitability_analysis(rpc):
|
|
617 |
print("Analysing trades...")
|
618 |
all_trades_df = analyse_all_traders(fpmmTrades, tools)
|
619 |
|
|
|
|
|
|
|
|
|
620 |
# summarize profitability df
|
621 |
print("Summarising trades...")
|
622 |
summary_df = summary_analyse(all_trades_df)
|
|
|
617 |
print("Analysing trades...")
|
618 |
all_trades_df = analyse_all_traders(fpmmTrades, tools)
|
619 |
|
620 |
+
# filter invalid markets. Condition: "redeemed" and "is_invalid" are True
|
621 |
+
invalid_market_mask = all_trades_df["is_invalid"] & all_trades_df["redeemed"]
|
622 |
+
all_trades_df = all_trades_df[~invalid_market_mask]
|
623 |
+
|
624 |
# summarize profitability df
|
625 |
print("Summarising trades...")
|
626 |
summary_df = summary_analyse(all_trades_df)
|