cyberosa commited on
Commit
832855e
·
1 Parent(s): 122f9fa

updating daily data

Browse files
active_traders.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5cd84095e9650fc07fdf93f2365e97b33b9608f577463e00eac8d186fd8a34e4
3
- size 18339184
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91be5cfb286ae2b411a945929c3ed843561da3338adfeca563c8b342ce33419d
3
+ size 18522584
all_trades_profitability.parquet.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d4bef03b610de3ad5eb4cb9ffab8dbf97f7d4ad1374fd3fd0c41a8c1a08c1436
3
- size 12022424
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82cc038f80494ea5d5fa3ba8f72b2491758aa91b8655ec6958c6cd5223d24bf5
3
+ size 12735685
closed_market_metrics.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:33dd2f3d6995b5478a5969a438ec8c60b065f7d3067666ceb3981e7a23cbaa03
3
- size 138411
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:353853750bd42a44afe2726793c2be1ee4d26c33895efdce13735353c9e5358a
3
+ size 138783
daily_info.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:989ff72d77eb91002ab290a04c2e4c5dceef5266f609d0959e7e13198f0499f1
3
- size 5269219
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0bbd5c77ffcc79cb052647a271ac84645510e0c23dd0d7f2d7b9f896e06231c2
3
+ size 5683511
daily_mech_requests.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f3f22db05f540c4e980ed088126f864530c451195e80490074ba47cf569ac154
3
- size 10086
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18cacdb76de8c5a230c1efcb11aaba29aec36ac122be76605686b488aeb64565
3
+ size 10169
daily_mech_requests_by_pearl_agents.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f01840e23fa5c82257b20aa5548976d6a0c0e9e73f54dc95b566301b6e75a484
3
- size 4446
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d146efbf8952342008c5774faaa5a30dd62e962cb39503f858cc9cf13f78075
3
+ size 4432
error_by_markets.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7989e887dae2ae122efcb2237f664a7ea7095996c5d9be4caa11af86a3e002ed
3
- size 10858
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f10dc840589b6892aa7d93e73e2ee719a4b3ab1c818bd8ae301747914b8739a
3
+ size 10909
errors_by_mech.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:360781be450a7921bd1c05dba30f4e2be5bc367d5d810ec5f068b85fa19c61fd
3
- size 6150
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ac566e738966e896e4dbd745fb0938c55bdf169c790be2668736ba6362bff1a
3
+ size 6098
invalid_trades.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e9b9e0ea67d60a161151399400b9f3decb2203df92bef728c5feae5ccae9cb05
3
- size 210900
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7745c0ef125f04b5fec871a3419b52794d8a86bf5de9122e5450ef366b91a3c
3
+ size 237464
latest_result_DAA_Pearl.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ce65e49cabe8852ae1e2a0f8a9472af77ae56b8dac97caaa7f0b2b932e9d12a7
3
- size 5276
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7684f857fe900813ce1e627901b2a1f6e6c5093e8a7c56b99c7f9c7e0cc2275c
3
+ size 5291
latest_result_DAA_QS.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:643e3cccf4ba4c19c464e9a43e2ab3745b69c257a0b95637e70b4ab8694356f7
3
- size 5802
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1cf5304e658a781e277ee3cc4ccacd97e16b1e0614752a1cf7dc1774c5f1f504
3
+ size 5826
old_tools_accuracy.csv CHANGED
@@ -1,13 +1,13 @@
1
  tool,tool_accuracy,total_requests,min,max
2
- claude-prediction-offline,59.618459933947506,345180,2025-04-02 05:16:45,2025-06-06 00:13:05
3
- claude-prediction-online,62.621820624279216,157814,2025-04-02 00:01:00,2025-05-21 18:47:35
4
- prediction-offline,58.390693147163866,2138983,2025-04-02 00:00:05,2025-06-09 07:28:55
5
- prediction-offline-sme,59.52069716775599,18360,2025-04-02 00:57:25,2025-06-07 08:53:25
6
- prediction-online,50.26802218114602,119020,2025-04-02 07:32:50,2025-06-08 22:40:55
7
- prediction-online-sme,50.509700756330155,66902,2025-04-02 07:33:25,2025-06-09 04:59:30
8
- prediction-request-rag,49.81549815498155,1355,2025-04-02 14:01:55,2025-06-03 18:59:40
9
- prediction-request-rag-claude,51.31158029430582,1563,2025-04-02 12:05:10,2025-06-03 17:51:10
10
- prediction-request-reasoning,52.58601483826535,982999,2025-04-02 07:03:25,2025-06-08 23:46:20
11
- prediction-request-reasoning-claude,65.74074074074075,1188,2025-04-02 12:25:50,2025-05-28 09:25:40
12
- prediction-url-cot-claude,57.6890756302521,4760,2025-04-02 05:46:40,2025-05-20 15:21:20
13
- superforcaster,55.255578133322814,101378,2025-04-02 00:02:10,2025-06-08 21:00:40
 
1
  tool,tool_accuracy,total_requests,min,max
2
+ claude-prediction-offline,59.4460280810884,358177,2025-04-02 05:16:45,2025-06-06 00:13:05
3
+ claude-prediction-online,62.54165685897992,161438,2025-04-02 00:01:00,2025-05-21 18:47:35
4
+ prediction-offline,58.46082343489606,2259195,2025-04-02 00:00:05,2025-06-09 07:28:55
5
+ prediction-offline-sme,59.35504135692597,19102,2025-04-02 00:57:25,2025-06-07 08:53:25
6
+ prediction-online,50.531919075962605,127181,2025-04-02 07:32:50,2025-06-08 22:40:55
7
+ prediction-online-sme,50.66788269959309,71270,2025-04-02 07:33:25,2025-06-09 04:59:30
8
+ prediction-request-rag,50.21067415730337,1424,2025-04-02 14:01:55,2025-06-03 18:59:40
9
+ prediction-request-rag-claude,51.951219512195124,1640,2025-04-02 12:05:10,2025-06-03 17:51:10
10
+ prediction-request-reasoning,52.567043388493424,1038432,2025-04-02 07:03:25,2025-06-08 23:46:20
11
+ prediction-request-reasoning-claude,65.94202898550726,1242,2025-04-02 12:25:50,2025-05-28 09:25:40
12
+ prediction-url-cot-claude,57.54314720812183,4925,2025-04-02 05:46:40,2025-05-20 15:21:20
13
+ superforcaster,55.27624465500028,106174,2025-04-02 00:02:10,2025-06-08 21:00:40
pearl_agents.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:dc3449f3ef7d2a3428d4c40d043045316ad88da6771c19bb2dd3c7a910217942
3
- size 46692
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a07df743b0f5bb02022079d1b4f0da37faa1ea7cc04c9dec3d3c600089b56ea
3
+ size 46669
retention_activity.parquet.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:56971554da0e12703e95602012e1114c368b00154b6a5c61047273a1a35d3066
3
- size 4676466
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:edc9849c3d3ff82f243cc010ae430a118259bff6de026aa459a8609c583f5d33
3
+ size 4664359
scripts/market_metrics.py CHANGED
@@ -80,6 +80,8 @@ def prepare_traders_data() -> Tuple[pd.DataFrame, pd.DataFrame]:
80
  except Exception as e:
81
  print(f"Error reading tools parquet file {e}")
82
  return None
 
 
83
  traders_activity = tools_df[
84
  tools_df["trader_address"].isin(unique_addresses)
85
  ].copy()
 
80
  except Exception as e:
81
  print(f"Error reading tools parquet file {e}")
82
  return None
83
+ # remove the market_creator all category
84
+ tools_df = tools_df[tools_df["market_creator"] != "all"]
85
  traders_activity = tools_df[
86
  tools_df["trader_address"].isin(unique_addresses)
87
  ].copy()
scripts/predict_kpis.py CHANGED
@@ -11,7 +11,7 @@ from tqdm import tqdm
11
  import requests
12
  import os
13
  import pickle
14
- from utils import TMP_DIR, INC_TOOLS, ROOT_DIR
15
  from concurrent.futures import ThreadPoolExecutor
16
  from gnosis_timestamps import get_all_txs_between_blocks_from_trader_address
17
  from dune_client.types import QueryParameter
@@ -188,7 +188,7 @@ def load_predict_services_file(dune_client: DuneClient):
188
  print(f"CSV file uploaded successfully!")
189
 
190
  except FileNotFoundError:
191
- print(f"Error: CSV file not found at {ROOT_DIR / "olas_trader_agents.csv"}")
192
  except Exception as e:
193
  print(f"An error occurred during upload: {e}")
194
 
@@ -278,6 +278,8 @@ def get_mech_requests_on_closed_markets_by_pearl_agents(
278
  except Exception as e:
279
  print(f"Error reading tools parquet file {e}")
280
  return None
 
 
281
  agents_activity = tools_df[tools_df["trader_address"].isin(unique_addresses)].copy()
282
  agents_activity = agents_activity[agents_activity["title"].isin(closed_markets)]
283
  if len(agents_activity) > 0:
@@ -431,6 +433,39 @@ def compute_weekly_avg_roi_pearl_agents(
431
  return weekly_avg_roi_data
432
 
433
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434
  def compute_two_weeks_rolling_avg_roi_pearl_agents(
435
  agents_trades: pd.DataFrame, agents_mech_requests: pd.DataFrame
436
  ) -> pd.DataFrame:
@@ -489,10 +524,12 @@ def compute_two_weeks_rolling_avg_roi_pearl_agents(
489
  if __name__ == "__main__":
490
  prepare_daa_data()
491
  prepare_predict_services_dataset()
492
- # dune = setup_dune_python_client()
493
  # load_predict_services_file(dune_client=dune)
494
  agents_trades, agents_mech_requests = prepare_agents_data()
495
-
 
 
496
  weekly_avg = compute_weekly_avg_roi_pearl_agents(
497
  agents_trades, agents_mech_requests
498
  )
 
11
  import requests
12
  import os
13
  import pickle
14
+ from utils import TMP_DIR, ROOT_DIR
15
  from concurrent.futures import ThreadPoolExecutor
16
  from gnosis_timestamps import get_all_txs_between_blocks_from_trader_address
17
  from dune_client.types import QueryParameter
 
188
  print(f"CSV file uploaded successfully!")
189
 
190
  except FileNotFoundError:
191
+ print(f"Error: CSV file not found at {ROOT_DIR} / predict_services.csv")
192
  except Exception as e:
193
  print(f"An error occurred during upload: {e}")
194
 
 
278
  except Exception as e:
279
  print(f"Error reading tools parquet file {e}")
280
  return None
281
+ # remove the market_creator= "all" entries
282
+ tools_df = tools_df[tools_df["market_creator"] != "all"]
283
  agents_activity = tools_df[tools_df["trader_address"].isin(unique_addresses)].copy()
284
  agents_activity = agents_activity[agents_activity["title"].isin(closed_markets)]
285
  if len(agents_activity) > 0:
 
433
  return weekly_avg_roi_data
434
 
435
 
436
+ def compute_total_roi_pearl_agents(agent_trades, agent_mech_requests) -> pd.DataFrame:
437
+ closed_markets = agent_trades.title.unique()
438
+ contents = []
439
+ agents = agent_trades.trader_address.unique()
440
+ for agent in agents:
441
+ # compute all trades done by the agent on those markets, no matter from which week
442
+ agent_markets_data = agent_trades.loc[
443
+ (agent_trades["trader_address"] == agent)
444
+ & (agent_trades["title"].isin(closed_markets))
445
+ ]
446
+ if len(agent_markets_data) == 0:
447
+ # not betting activity
448
+ continue
449
+ # filter mech requests done by the agent on that market
450
+ agent_mech_calls = agent_mech_requests.loc[
451
+ (agent_mech_requests["trader_address"] == agent)
452
+ & (agent_mech_requests["title"].isin(closed_markets))
453
+ ]
454
+
455
+ # compute the ROI for that market, that trader and that week
456
+ try:
457
+ # Convert the dictionary to DataFrame before appending
458
+ roi_dict = compute_markets_agent_roi(
459
+ agent_markets_data, agent_mech_calls, agent, "day", None
460
+ )
461
+ contents.append(pd.DataFrame([roi_dict]))
462
+ except ValueError as e:
463
+ print(f"Skipping ROI calculation: {e}")
464
+ continue
465
+ total_roi_data = pd.concat(contents, ignore_index=True)
466
+ total_roi_data.to_parquet(ROOT_DIR / "total_roi.parquet")
467
+
468
+
469
  def compute_two_weeks_rolling_avg_roi_pearl_agents(
470
  agents_trades: pd.DataFrame, agents_mech_requests: pd.DataFrame
471
  ) -> pd.DataFrame:
 
524
  if __name__ == "__main__":
525
  prepare_daa_data()
526
  prepare_predict_services_dataset()
527
+ dune = setup_dune_python_client()
528
  # load_predict_services_file(dune_client=dune)
529
  agents_trades, agents_mech_requests = prepare_agents_data()
530
+ # compute_total_roi_pearl_agents(
531
+ # agent_trades=agents_trades, agent_mech_requests=agents_mech_requests
532
+ # )
533
  weekly_avg = compute_weekly_avg_roi_pearl_agents(
534
  agents_trades, agents_mech_requests
535
  )
scripts/pull_data.py CHANGED
@@ -136,7 +136,7 @@ def only_new_weekly_analysis():
136
 
137
  save_historical_data()
138
  try:
139
- clean_old_data_from_parquet_files("2025-04-29")
140
  clean_old_data_from_json_files()
141
  except Exception as e:
142
  print("Error cleaning the oldest information from parquet files")
 
136
 
137
  save_historical_data()
138
  try:
139
+ clean_old_data_from_parquet_files("2025-05-02")
140
  clean_old_data_from_json_files()
141
  except Exception as e:
142
  print("Error cleaning the oldest information from parquet files")
service_map.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e6e10282aa191a2ac657af6e1824b79999adfa9d6f577458cf569ee332f4c5ab
3
- size 157999
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc29aa99f18e8b277a14b68d02ec41e69331321d92e53d613d9da3a34dc1cadd
3
+ size 158519
tools_accuracy.csv CHANGED
@@ -1,13 +1,13 @@
1
  tool,tool_accuracy,total_requests,min,max
2
- claude-prediction-offline,50.274710990949636,19744,2025-05-25 10:30:10,2025-06-29 23:45:05
3
- claude-prediction-online,49.363139308463246,26735,2025-05-25 00:00:15,2025-06-29 23:42:35
4
- prediction-offline,58.98738002164555,495321,2025-05-25 00:00:30,2025-06-29 23:44:00
5
- prediction-offline-sme,60.06413232848768,1491,2025-05-25 00:13:15,2025-06-27 08:12:35
6
- prediction-online,57.93239712787832,72005,2025-05-25 07:33:20,2025-06-29 23:44:40
7
- prediction-online-sme,52.55046876031451,56045,2025-05-25 07:05:50,2025-06-29 23:42:35
8
- prediction-request-rag,39.104435043722226,47847,2025-05-25 14:16:25,2025-06-29 23:42:20
9
- prediction-request-rag-claude,72.75753093060787,352,2025-05-25 13:21:55,2025-06-29 22:38:00
10
- prediction-request-reasoning,55.5764699844214,169207,2025-05-25 07:14:15,2025-06-29 23:45:10
11
- prediction-request-reasoning-claude,77.68147933704856,328,2025-05-25 13:48:00,2025-06-29 22:40:25
12
- prediction-url-cot-claude,71.20999090232402,321,2025-05-25 00:12:40,2025-06-18 18:07:55
13
- superforcaster,65.7564104601496,101531,2025-05-25 00:00:20,2025-06-29 23:28:15
 
1
  tool,tool_accuracy,total_requests,min,max
2
+ claude-prediction-offline,52.489079123026734,32150,2025-05-25 10:30:10,2025-07-02 22:22:30
3
+ claude-prediction-online,50.97268933846528,39965,2025-05-25 00:00:15,2025-07-02 23:07:45
4
+ prediction-offline,59.3776319899559,631864,2025-05-25 00:00:30,2025-07-02 23:44:40
5
+ prediction-offline-sme,60.25242177383664,1805,2025-05-25 00:13:15,2025-07-01 13:31:30
6
+ prediction-online,58.92259629715118,99979,2025-05-25 07:33:20,2025-07-02 22:20:20
7
+ prediction-online-sme,52.990663647931754,78508,2025-05-25 07:05:50,2025-07-02 23:24:05
8
+ prediction-request-rag,40.00016064652507,61648,2025-05-25 14:16:25,2025-07-02 22:18:30
9
+ prediction-request-rag-claude,67.27216350998684,458,2025-05-25 13:21:55,2025-07-02 06:30:10
10
+ prediction-request-reasoning,55.17073673090758,213737,2025-05-25 07:14:15,2025-07-02 22:26:15
11
+ prediction-request-reasoning-claude,70.78315005527433,408,2025-05-25 13:48:00,2025-07-01 21:23:20
12
+ prediction-url-cot-claude,70.82081675732725,327,2025-05-25 00:12:40,2025-06-18 18:07:55
13
+ superforcaster,65.34915303763684,127148,2025-05-25 00:00:20,2025-07-02 22:13:40
total_roi.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ebbd506a2470bc2cdfece77a35199eba5f2cfa63692a8706546a2a928e5b9652
3
+ size 23089
traders_weekly_metrics.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5ea435271201405a7c4e5f4a7bed3a56ca53a9780bbccf2bab5ff168cb0dbfe4
3
- size 190957
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4ffe4e83f56198c7b96258ac10789a5661991e9f182a4e0bfa7ec3ce95cba28
3
+ size 201639
two_weeks_avg_roi_pearl_agents.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:292128fb6222bbea57946d78529a77b608299ce4133d087b494e24dcaf53d402
3
- size 3045
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e5985b572ed153f00b475f855b5383cc7c31ec182476f67178b4ce44d8335f7
3
+ size 3057
unknown_traders.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ece6d2ef440fceff721ebd47c0c4a2badb7d90b7a871bd7fc3a9d727aa2489ee
3
- size 1451714
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:900623322ca20d760548571b6c378bb1ae9f8de4327d71a3f9595eee60d09557
3
+ size 1481331
validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ecb7ea057dc637239aaf46e9a5cd3896e7c595fd2b7ccd7bf64394cdd4ceea69
3
+ size 57273
weekly_avg_roi_pearl_agents.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b24d90b12897d7fd6af3080a27d40ff27cc7e3e8529ddae295bf2b0ede007d48
3
- size 2396
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3de1c26b2c552b5e4fb03a9ac4fc06e28d1b260757e7e19ce4264a9d7fce7b5a
3
+ size 2413
weekly_mech_calls.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2443cbc31d362e7bcf9a927a81b9967f90f4b1ce410b52943d30091a9c857006
3
- size 54873
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1255a99013706dc87d29e639cf1267cc0875ae716dcdc9926ee9872406036277
3
+ size 54520
winning_df.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5ada588c169b83ce8dd087db8468b9050cf2c193f47cbc2b44326caf93831805
3
- size 10557
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c5d9d4885c11088ea30cbd5dfdd30645b6ecb7db605261c36e19cf32627aef32
3
+ size 11167