prediction-market-agent-tooling 0.61.1.dev463__py3-none-any.whl → 0.61.1.dev477__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. prediction_market_agent_tooling/deploy/agent.py +5 -4
  2. prediction_market_agent_tooling/deploy/betting_strategy.py +69 -53
  3. prediction_market_agent_tooling/gtypes.py +27 -105
  4. prediction_market_agent_tooling/jobs/jobs_models.py +7 -5
  5. prediction_market_agent_tooling/jobs/omen/omen_jobs.py +17 -13
  6. prediction_market_agent_tooling/markets/agent_market.py +52 -96
  7. prediction_market_agent_tooling/markets/blockchain_utils.py +27 -1
  8. prediction_market_agent_tooling/markets/data_models.py +44 -40
  9. prediction_market_agent_tooling/markets/manifold/api.py +6 -2
  10. prediction_market_agent_tooling/markets/manifold/data_models.py +25 -33
  11. prediction_market_agent_tooling/markets/manifold/manifold.py +11 -8
  12. prediction_market_agent_tooling/markets/market_fees.py +2 -4
  13. prediction_market_agent_tooling/markets/omen/data_models.py +57 -66
  14. prediction_market_agent_tooling/markets/omen/omen.py +249 -214
  15. prediction_market_agent_tooling/markets/omen/omen_contracts.py +29 -31
  16. prediction_market_agent_tooling/markets/omen/omen_resolving.py +14 -7
  17. prediction_market_agent_tooling/markets/omen/omen_subgraph_handler.py +14 -20
  18. prediction_market_agent_tooling/markets/polymarket/data_models.py +3 -3
  19. prediction_market_agent_tooling/markets/polymarket/data_models_web.py +4 -4
  20. prediction_market_agent_tooling/markets/polymarket/polymarket.py +5 -3
  21. prediction_market_agent_tooling/markets/seer/data_models.py +11 -8
  22. prediction_market_agent_tooling/markets/seer/seer.py +71 -85
  23. prediction_market_agent_tooling/markets/seer/seer_contracts.py +5 -10
  24. prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py +7 -7
  25. prediction_market_agent_tooling/monitor/monitor.py +2 -2
  26. prediction_market_agent_tooling/tools/balances.py +11 -9
  27. prediction_market_agent_tooling/tools/betting_strategies/kelly_criterion.py +10 -12
  28. prediction_market_agent_tooling/tools/betting_strategies/market_moving.py +24 -27
  29. prediction_market_agent_tooling/tools/betting_strategies/utils.py +1 -3
  30. prediction_market_agent_tooling/tools/contract.py +10 -14
  31. prediction_market_agent_tooling/tools/cow/cow_manager.py +4 -3
  32. prediction_market_agent_tooling/tools/cow/cow_order.py +4 -3
  33. prediction_market_agent_tooling/tools/langfuse_client_utils.py +1 -13
  34. prediction_market_agent_tooling/tools/omen/sell_positions.py +3 -6
  35. prediction_market_agent_tooling/tools/safe.py +6 -5
  36. prediction_market_agent_tooling/tools/tokens/auto_deposit.py +30 -32
  37. prediction_market_agent_tooling/tools/tokens/auto_withdraw.py +22 -5
  38. prediction_market_agent_tooling/tools/tokens/main_token.py +2 -2
  39. prediction_market_agent_tooling/tools/utils.py +8 -14
  40. prediction_market_agent_tooling/tools/web3_utils.py +41 -24
  41. {prediction_market_agent_tooling-0.61.1.dev463.dist-info → prediction_market_agent_tooling-0.61.1.dev477.dist-info}/METADATA +1 -2
  42. {prediction_market_agent_tooling-0.61.1.dev463.dist-info → prediction_market_agent_tooling-0.61.1.dev477.dist-info}/RECORD +45 -48
  43. prediction_market_agent_tooling/tools/_generic_value.py +0 -255
  44. prediction_market_agent_tooling/tools/tokens/token_utils.py +0 -46
  45. prediction_market_agent_tooling/tools/tokens/usd.py +0 -63
  46. {prediction_market_agent_tooling-0.61.1.dev463.dist-info → prediction_market_agent_tooling-0.61.1.dev477.dist-info}/LICENSE +0 -0
  47. {prediction_market_agent_tooling-0.61.1.dev463.dist-info → prediction_market_agent_tooling-0.61.1.dev477.dist-info}/WHEEL +0 -0
  48. {prediction_market_agent_tooling-0.61.1.dev463.dist-info → prediction_market_agent_tooling-0.61.1.dev477.dist-info}/entry_points.txt +0 -0
@@ -21,73 +21,72 @@ prediction_market_agent_tooling/benchmark/agents.py,sha256=B1-uWdyeN4GGKMWGK_-Cc
21
21
  prediction_market_agent_tooling/benchmark/benchmark.py,sha256=MqTiaaJ3cYiOLUVR7OyImLWxcEya3Rl5JyFYW-K0lwM,17097
22
22
  prediction_market_agent_tooling/benchmark/utils.py,sha256=D0MfUkVZllmvcU0VOurk9tcKT7JTtwwOp-63zuCBVuc,2880
23
23
  prediction_market_agent_tooling/config.py,sha256=So5l8KbgmzcCpxzzf13TNrEJPu_4iQnUDhzus6XRvSc,10151
24
- prediction_market_agent_tooling/deploy/agent.py,sha256=DW9edzHDX7QVURMGyOoIHTIvl3Itpbi8i0l5XPrEkbk,24974
24
+ prediction_market_agent_tooling/deploy/agent.py,sha256=tMREXM2LwFsatbysCaNRvtCAyCNMAPMGgkkIEpCRj7g,25022
25
25
  prediction_market_agent_tooling/deploy/agent_example.py,sha256=dIIdZashExWk9tOdyDjw87AuUcGyM7jYxNChYrVK2dM,1001
26
- prediction_market_agent_tooling/deploy/betting_strategy.py,sha256=v0t5Z2NWnDQ4xI28tg3STxWXg1xaDvToRWOiuky0qlw,12454
26
+ prediction_market_agent_tooling/deploy/betting_strategy.py,sha256=Y6Pb8OfSb6galRbfdNBvvNTgO-4dR2ybJ4o5GKJcMoM,12894
27
27
  prediction_market_agent_tooling/deploy/constants.py,sha256=M5ty8URipYMGe_G-RzxRydK3AFL6CyvmqCraJUrLBnE,82
28
28
  prediction_market_agent_tooling/deploy/gcp/deploy.py,sha256=CYUgnfy-9XVk04kkxA_5yp0GE9Mw5caYqlFUZQ2j3ks,3739
29
29
  prediction_market_agent_tooling/deploy/gcp/kubernetes_models.py,sha256=OsPboCFGiZKsvGyntGZHwdqPlLTthITkNF5rJFvGgU8,2582
30
30
  prediction_market_agent_tooling/deploy/gcp/utils.py,sha256=WI2ycX1X-IlTRoNoG4ggFlRwPL28kwM9VGDFD2fePLo,5699
31
31
  prediction_market_agent_tooling/deploy/trade_interval.py,sha256=Xk9j45alQ_vrasGvsNyuW70XHIQ7wfvjoxNR3F6HYCw,1155
32
- prediction_market_agent_tooling/gtypes.py,sha256=FKIv4Ca0BGp9_FXTGt_ipbrQvwvQoWf2TG59LG3rYuw,5469
32
+ prediction_market_agent_tooling/gtypes.py,sha256=G9KOKqYcxoKLv5Tfto4g5zq46FeIKxGl4RTArLIJn3I,2563
33
33
  prediction_market_agent_tooling/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
- prediction_market_agent_tooling/jobs/jobs_models.py,sha256=8vYafsK1cqMWQtjBoq9rruroF84xAVD00vBTMWH6QMg,2166
35
- prediction_market_agent_tooling/jobs/omen/omen_jobs.py,sha256=Pf6QxPXGyie-2l_wZUjaGPTjZTlpv50_JhP40mULBaU,5048
34
+ prediction_market_agent_tooling/jobs/jobs_models.py,sha256=GOtsNm7URhzZM5fPY64r8m8Gz-sSsUhG1qmDoC7wGL8,2231
35
+ prediction_market_agent_tooling/jobs/omen/omen_jobs.py,sha256=N0_jGDyXQeVXXlYg4oA_pOfqIjscHsLQbr0pBwFGoRo,5178
36
36
  prediction_market_agent_tooling/loggers.py,sha256=MvCkQSJL2_0yErNatqr81sJlc4aOgPzDp9VNrIhKUcc,4140
37
- prediction_market_agent_tooling/markets/agent_market.py,sha256=jbKkXDFy13f9-Gx4KoF2JsfDudqQtrVMIxCh7tY_2L0,14662
37
+ prediction_market_agent_tooling/markets/agent_market.py,sha256=IoJ7EVj2kHtL4ht8Dq02ghj8OC0mEj5jKOI0jpcU1n0,12889
38
38
  prediction_market_agent_tooling/markets/base_subgraph_handler.py,sha256=7RaYO_4qAmQ6ZGM8oPK2-CkiJfKmV9MxM-rJlduaecU,1971
39
- prediction_market_agent_tooling/markets/blockchain_utils.py,sha256=1iTU_D-Uof0E442qVUhSBCfc1rJNQpDcd3UjSnilYZg,2129
39
+ prediction_market_agent_tooling/markets/blockchain_utils.py,sha256=gZtQwF5UrOd_yOkNPLRbpMzUd55-Nsluy0858YYdPn8,2873
40
40
  prediction_market_agent_tooling/markets/categorize.py,sha256=jsoHWvZk9pU6n17oWSCcCxNNYVwlb_NXsZxKRI7vmsk,1301
41
- prediction_market_agent_tooling/markets/data_models.py,sha256=cFjSPeT3W2YBWrVE6fvGHkwpdR6y4w91WftZsYrRKv0,4431
41
+ prediction_market_agent_tooling/markets/data_models.py,sha256=uUuCMoo-Q4ws-03e6iOJJbQtZmQ1JZLapXOeb97t95o,4386
42
42
  prediction_market_agent_tooling/markets/manifold/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
- prediction_market_agent_tooling/markets/manifold/api.py,sha256=ih92UTZdSbmy6tTUgSCps_HqYQXpMSsfne5Np5znVEM,7217
44
- prediction_market_agent_tooling/markets/manifold/data_models.py,sha256=bUI4b0N-gBid7wkzRECCgQ-Oco0-l9n1YI8xjLXvuhw,6274
45
- prediction_market_agent_tooling/markets/manifold/manifold.py,sha256=P4m1lJ_RRzE4iozwdkrGbAJawDRAx2dCjgnEAyRJnUI,4749
43
+ prediction_market_agent_tooling/markets/manifold/api.py,sha256=Fd0HYnstvvHO6AZkp1xiRlvCwQUc8kLR8DAj6PAZu0s,7297
44
+ prediction_market_agent_tooling/markets/manifold/data_models.py,sha256=eiGS4rEkxseZNpEb2BICKnjF0qqgkQTMuUPbSe7_04I,6059
45
+ prediction_market_agent_tooling/markets/manifold/manifold.py,sha256=qemQIwuFg4yf6egGWFp9lWpz1lXr02QiBeZ2akcT6II,5026
46
46
  prediction_market_agent_tooling/markets/manifold/utils.py,sha256=_gGlWid0sPF127Omx5qQ1fq17frLInv0wdyXJBMGVzM,670
47
- prediction_market_agent_tooling/markets/market_fees.py,sha256=NFLvpMIyfNzeGnN3ziXacrBAA7yeI_Psw-_BRwPTLAw,1289
47
+ prediction_market_agent_tooling/markets/market_fees.py,sha256=Q64T9uaJx0Vllt0BkrPmpMEz53ra-hMVY8Czi7CEP7s,1227
48
48
  prediction_market_agent_tooling/markets/markets.py,sha256=OMADWd1C5wD7sVdcY_GVdxAFDndkU9kn6Ble4GXCw0c,4045
49
49
  prediction_market_agent_tooling/markets/metaculus/api.py,sha256=4TRPGytQQbSdf42DCg2M_JWYPAuNjqZ3eBqaQBLkNks,2736
50
50
  prediction_market_agent_tooling/markets/metaculus/data_models.py,sha256=FaBCTPPezXbBwZ9p791CiVgQ4vB696xnMbz9XVXmiVI,3267
51
51
  prediction_market_agent_tooling/markets/metaculus/metaculus.py,sha256=86TIx6cavEWc8Cv4KpZxSvwiSw9oFybXE3YB49pg-CA,4377
52
52
  prediction_market_agent_tooling/markets/omen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
- prediction_market_agent_tooling/markets/omen/data_models.py,sha256=zJIp3i1ujRq0YpEtaotAiyNuz0N0AVwQgWZvgO8rDGU,29109
54
- prediction_market_agent_tooling/markets/omen/omen.py,sha256=X6Uqr8s0tseDu2fPKDdFzR7U1zxmoxtiJz5zB2Nr--Q,51428
53
+ prediction_market_agent_tooling/markets/omen/data_models.py,sha256=sfaOpNk6oFIzxYQzs9EehqAT_19IxYJy9pns-UTepOc,28934
54
+ prediction_market_agent_tooling/markets/omen/omen.py,sha256=FUPGOKmhiKjLHLmfgHBM_MzoiKVWiPOu8SzRk-AKrNk,53339
55
55
  prediction_market_agent_tooling/markets/omen/omen_constants.py,sha256=D9oflYKafLQiHYtB5sScMHqmXyzM8JP8J0yATmc4SQQ,233
56
- prediction_market_agent_tooling/markets/omen/omen_contracts.py,sha256=bCC9A7ZTJxMDJcPbl3jof6HcAGGHv1BrFq3RRWbkQ_c,28739
57
- prediction_market_agent_tooling/markets/omen/omen_resolving.py,sha256=Cyi9Ci-Z-K8WCZWVLs9oSuJC6qRobi_CpqDCno_5F-0,10238
58
- prediction_market_agent_tooling/markets/omen/omen_subgraph_handler.py,sha256=6N6RJ-noC7gkoDBeYdBSXp1QI3u4iftBLu8Dtew9yU4,39017
56
+ prediction_market_agent_tooling/markets/omen/omen_contracts.py,sha256=EXqBlVivbmW8aBQ65O09X2xkyesHAop49GUl1tUffWA,28648
57
+ prediction_market_agent_tooling/markets/omen/omen_resolving.py,sha256=B4z9dPqtEfows8-1hkstBLLS_7X0L9z3CG41adyCYgg,10336
58
+ prediction_market_agent_tooling/markets/omen/omen_subgraph_handler.py,sha256=dQyz1RR1MlQncb1Slq7tk1Maql-sbb5YYE_sDe26MYA,38711
59
59
  prediction_market_agent_tooling/markets/polymarket/api.py,sha256=UZ4_TG8ceb9Y-qgsOKs8Qiv8zDt957QkT8IX2c83yqo,4800
60
- prediction_market_agent_tooling/markets/polymarket/data_models.py,sha256=utGN-Lhjsa-RHX5WW_jcqgWXtRkEZn0JemwYZkt3Lng,4344
61
- prediction_market_agent_tooling/markets/polymarket/data_models_web.py,sha256=LVEsNw2nUx5poiU1m803NNqG5-fs8-MODQRyGLqy4mE,12585
62
- prediction_market_agent_tooling/markets/polymarket/polymarket.py,sha256=A4TnNVLOdlOGBoxHV_KxIDfkziUiw4vqCTOFfDXFpAY,3319
60
+ prediction_market_agent_tooling/markets/polymarket/data_models.py,sha256=Fd5PI5y3mJM8VHExBhWFWEnuuIKxQmIAXgBuoPDvNjw,4341
61
+ prediction_market_agent_tooling/markets/polymarket/data_models_web.py,sha256=VZhVccTApygSKMmy6Au2G02JCJOKJnR_oVeKlaesuSg,12548
62
+ prediction_market_agent_tooling/markets/polymarket/polymarket.py,sha256=NRoZK71PtH8kkangMqme7twcAXhRJSSabbmOir-UnAI,3418
63
63
  prediction_market_agent_tooling/markets/polymarket/utils.py,sha256=8kTeVjXPcXC6DkDvWYsZQLY7x8DS6CEp_yznSEazsNU,2037
64
- prediction_market_agent_tooling/markets/seer/data_models.py,sha256=jk7sIA7dwPbwK2y7xx9PbCp2i8OQ1hCyv8Qse42jzss,8172
65
- prediction_market_agent_tooling/markets/seer/seer.py,sha256=WBMKNICykhzwpEgExbnig8MlCGogE2p4E0DagK8yDbg,13119
66
- prediction_market_agent_tooling/markets/seer/seer_contracts.py,sha256=XOEhaL5wrKEg7P-xg1mW5mJXVfeALuflJOvqAeuwrWM,2717
67
- prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py,sha256=o5Sh_6bpiJQb1KnW3rf4cBqN2PM8IdggQARdBeDMvIE,8725
64
+ prediction_market_agent_tooling/markets/seer/data_models.py,sha256=67hUD-Bs_bJd_j0iuxXTHR0lcWNF3Tkk-fnCi6kSSoE,8268
65
+ prediction_market_agent_tooling/markets/seer/seer.py,sha256=r21sXj_4_oIG2L1N5l56vEYGI_q2RGem_6G-Sixkbck,12954
66
+ prediction_market_agent_tooling/markets/seer/seer_contracts.py,sha256=E7CYAKZiK6cg3dyj1kJuIPKSYYUft98F64shF5S0g4s,2730
67
+ prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py,sha256=-XpRmK5gmXCmf1h82PMkNf_AizFdzI90m9P3OzsVfnw,8684
68
68
  prediction_market_agent_tooling/monitor/financial_metrics/financial_metrics.py,sha256=fjIgjDIx5MhH5mwf7S0cspLOOSU3elYLhGYoIiM26mU,2746
69
69
  prediction_market_agent_tooling/monitor/markets/manifold.py,sha256=TS4ERwTfQnot8dhekNyVNhJYf5ysYsjF-9v5_kM3aVI,3334
70
70
  prediction_market_agent_tooling/monitor/markets/metaculus.py,sha256=LOnyWWBFdg10-cTWdb76nOsNjDloO8OfMT85GBzRCFI,1455
71
71
  prediction_market_agent_tooling/monitor/markets/omen.py,sha256=EqiJYTvDbSu7fBpbrBmCuf3fc6GHr4MxWrBGa69MIyc,3305
72
72
  prediction_market_agent_tooling/monitor/markets/polymarket.py,sha256=wak8o4BYaGbLpshQD12OrsqNABdanyID6ql95lEG2io,1870
73
- prediction_market_agent_tooling/monitor/monitor.py,sha256=yvSXwV-3DSAm3vsFZnFC9jEQzlaB9KUOxI6pOyNKGQk,14147
73
+ prediction_market_agent_tooling/monitor/monitor.py,sha256=4jw_1aDUoWi9kTET8usy_k5hwhANR8m522aAjHWmvMI,14161
74
74
  prediction_market_agent_tooling/monitor/monitor_app.py,sha256=-_6w_ZvQ-Ad5qaeuo7NKTXUOOZ_6OrR8jMe25BGOY4k,4615
75
75
  prediction_market_agent_tooling/monitor/monitor_settings.py,sha256=Xiozs3AsufuJ04JOe1vjUri-IAMWHjjmc2ugGGiHNH4,947
76
76
  prediction_market_agent_tooling/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
77
- prediction_market_agent_tooling/tools/_generic_value.py,sha256=uMUf6IRC19PHxE8b78PRfECt5kuzZwS4W6DNs4OfDjk,10410
78
- prediction_market_agent_tooling/tools/balances.py,sha256=9MpTTnquwjflTYYo1e0w48iOTceBuQV_6PfvywrTlFk,989
79
- prediction_market_agent_tooling/tools/betting_strategies/kelly_criterion.py,sha256=cui0wc7InSG-GdFvrJ3ypxAvHBTnv7UAFR6QOm6pI8A,4813
80
- prediction_market_agent_tooling/tools/betting_strategies/market_moving.py,sha256=uG11UAzM6C0ZKTS7SyT1iVsTs6O13y8_o8RAtm29HFg,5432
77
+ prediction_market_agent_tooling/tools/balances.py,sha256=7lenJ0XEdZQHRJA89vdeLNhzCPJJA4x_Id2CS3IjIv0,1076
78
+ prediction_market_agent_tooling/tools/betting_strategies/kelly_criterion.py,sha256=TKVF8qZhxgz-4TTEHr7iVLfpurIhuji38qLc8CYaiXA,4662
79
+ prediction_market_agent_tooling/tools/betting_strategies/market_moving.py,sha256=Ej2s9fiG_iLWvgj1o5rtxN7NR4jmq8Y9syP5PCGIx6U,5270
81
80
  prediction_market_agent_tooling/tools/betting_strategies/minimum_bet_to_win.py,sha256=-FUSuQQgjcWSSnoFxnlAyTeilY6raJABJVM2QKkFqAY,438
82
81
  prediction_market_agent_tooling/tools/betting_strategies/stretch_bet_between.py,sha256=THMXwFlskvzbjnX_OiYtDSzI8XVFyULWfP2525_9UGc,429
83
- prediction_market_agent_tooling/tools/betting_strategies/utils.py,sha256=7CwImollCwQlA7hVsRdaorU9iW-1Ez7HKThNC4Zy2vs,155
82
+ prediction_market_agent_tooling/tools/betting_strategies/utils.py,sha256=kpIb-ci67Vc1Yqqaa-_S4OUkbhWSIYog4_Iwp69HU_k,97
84
83
  prediction_market_agent_tooling/tools/caches/db_cache.py,sha256=dB8LNs2JvVRaFCeAKRmIQRwiirsMgtL31he8051wM-g,11431
85
84
  prediction_market_agent_tooling/tools/caches/inmemory_cache.py,sha256=ZW5iI5rmjqeAebu5T7ftRnlkxiL02IC-MxCfDB80x7w,1506
86
85
  prediction_market_agent_tooling/tools/caches/serializers.py,sha256=vFDx4fsPxclXp2q0sv27j4al_M_Tj9aR2JJP-xNHQXA,2151
87
- prediction_market_agent_tooling/tools/contract.py,sha256=K9i7J4F7gt6saoKT3tx5S-fPYVh-eCliJpg2T1eNBWo,20998
86
+ prediction_market_agent_tooling/tools/contract.py,sha256=XM7v6Wmi5OXPtn0SS__27MhlaBHGJG3VEeQFSIBJo6U,20963
88
87
  prediction_market_agent_tooling/tools/costs.py,sha256=EaAJ7v9laD4VEV3d8B44M4u3_oEO_H16jRVCdoZ93Uw,954
89
- prediction_market_agent_tooling/tools/cow/cow_manager.py,sha256=F6T4SlKDQ06nwz3W2wVBr0VqgVvdb4Wphf-kI31W4ms,3792
90
- prediction_market_agent_tooling/tools/cow/cow_order.py,sha256=qhtsEd7a9qAV3zKgSdAyOFZOLAiNOL632JgYAPqazUY,4399
88
+ prediction_market_agent_tooling/tools/cow/cow_manager.py,sha256=WK6Uk722VotjLHtxDPHxvwBrWVb3rvTegg_3w58ehwU,3869
89
+ prediction_market_agent_tooling/tools/cow/cow_order.py,sha256=M3zQohgAzy_LETnf9rKtS1L9rr7FP92CH6v0G2laZkM,4435
91
90
  prediction_market_agent_tooling/tools/custom_exceptions.py,sha256=Fh8z1fbwONvP4-j7AmV_PuEcoqb6-QXa9PJ9m7guMcM,93
92
91
  prediction_market_agent_tooling/tools/datetime_utc.py,sha256=8_WackjtjC8zHXrhQFTGQ6e6Fz_6llWoKR4CSFvIv9I,2766
93
92
  prediction_market_agent_tooling/tools/db/db_manager.py,sha256=GtzHH1NLl8HwqC8Z7s6eTlIQXuV0blxfaV2PeQrBnfQ,3013
@@ -100,28 +99,26 @@ prediction_market_agent_tooling/tools/ipfs/ipfs_handler.py,sha256=CTTMfTvs_8PH4k
100
99
  prediction_market_agent_tooling/tools/is_invalid.py,sha256=TAHQXiiusAU45xJ11ZyEP7PnEfcjfzVG7qHRbsHiAd0,5335
101
100
  prediction_market_agent_tooling/tools/is_predictable.py,sha256=qVd6zqay2Dg2fyeAuZvAFqSHMg71TcPfCZULsVk2XvA,6797
102
101
  prediction_market_agent_tooling/tools/langfuse_.py,sha256=jI_4ROxqo41CCnWGS1vN_AeDVhRzLMaQLxH3kxDu3L8,1153
103
- prediction_market_agent_tooling/tools/langfuse_client_utils.py,sha256=636bHCxwfWSbQYQQ0ipeyJUDXCbAC1zP6ZqzeLL2GJk,6582
102
+ prediction_market_agent_tooling/tools/langfuse_client_utils.py,sha256=IQboU9EPl4QEIo0poNylomevuVntpPpmkuNCzZl1Qdg,6058
104
103
  prediction_market_agent_tooling/tools/omen/reality_accuracy.py,sha256=M1SF7iSW1gVlQSTskdVFTn09uPLST23YeipVIWj54io,2236
105
- prediction_market_agent_tooling/tools/omen/sell_positions.py,sha256=7b2qHGQ_2V3ke_UTR9wQeJW88z5ub1GTre9Y_zd4e9E,2387
104
+ prediction_market_agent_tooling/tools/omen/sell_positions.py,sha256=hZCxXpcACO95DyiZ5oLFp982N0erZg4wccdSUKTgRlA,2307
106
105
  prediction_market_agent_tooling/tools/parallelism.py,sha256=6Gou0hbjtMZrYvxjTDFUDZuxmE2nqZVbb6hkg1hF82A,1022
107
106
  prediction_market_agent_tooling/tools/relevant_news_analysis/data_models.py,sha256=95l84aztFaxcRLLcRQ46yKJbIlOEuDAbIGLouyliDzA,1316
108
107
  prediction_market_agent_tooling/tools/relevant_news_analysis/relevant_news_analysis.py,sha256=CddJem7tk15NAudJDwmuL8znTycbR-YI8kTNtd3LzG8,5474
109
108
  prediction_market_agent_tooling/tools/relevant_news_analysis/relevant_news_cache.py,sha256=kNWq92T11Knb9mYBZlMiZUzOpKgCd-5adanylQUMRJA,3085
110
- prediction_market_agent_tooling/tools/safe.py,sha256=o477HGPQv7X_eDoOeYoELCHryiq1_102y_JVhGEPDXw,5165
109
+ prediction_market_agent_tooling/tools/safe.py,sha256=9vxGGLvSPnfy-sxUFDpBTe8omqpGXP7MzvGPp6bRxrU,5197
111
110
  prediction_market_agent_tooling/tools/singleton.py,sha256=CiIELUiI-OeS7U7eeHEt0rnVhtQGzwoUdAgn_7u_GBM,729
112
111
  prediction_market_agent_tooling/tools/streamlit_user_login.py,sha256=NXEqfjT9Lc9QtliwSGRASIz1opjQ7Btme43H4qJbzgE,3010
113
112
  prediction_market_agent_tooling/tools/tavily/tavily_models.py,sha256=5ldQs1pZe6uJ5eDAuP4OLpzmcqYShlIV67kttNFvGS0,342
114
113
  prediction_market_agent_tooling/tools/tavily/tavily_search.py,sha256=pPs0qZNfJ7G-1ajfz0iaWOBQyiC0TbcShfrW8T39jtg,3859
115
- prediction_market_agent_tooling/tools/tokens/auto_deposit.py,sha256=M2ozvdLZyX0R3WftrSYT2SNjz-Af-p9huEihgsUUkYA,6567
116
- prediction_market_agent_tooling/tools/tokens/auto_withdraw.py,sha256=nV9jSUt1ydceDj03cTwdyrJs8kFGqz9z6YcvTVUaNg4,2682
117
- prediction_market_agent_tooling/tools/tokens/main_token.py,sha256=1rbwpdCusPgQIVFuo3m00nBZ_b2lCAoFVm67i-YDcEw,812
118
- prediction_market_agent_tooling/tools/tokens/token_utils.py,sha256=zwV-jGFkPJu4-IslXOUqnsNQjzh_9CrfkruDQL0dq0c,1381
119
- prediction_market_agent_tooling/tools/tokens/usd.py,sha256=0GU7RiWGlu7yDctGeWJeLsy8uYLcpI1JyLWWqFt0QWE,2179
114
+ prediction_market_agent_tooling/tools/tokens/auto_deposit.py,sha256=o8_ERfPL-ps9FLvH5vgdiSRJQ4dZONJw9KK9sHgeP2I,6390
115
+ prediction_market_agent_tooling/tools/tokens/auto_withdraw.py,sha256=25Y0H1p0hSD3gWShKPcJ5BckQc3nr_hOAvImOFODC0w,3160
116
+ prediction_market_agent_tooling/tools/tokens/main_token.py,sha256=7JPgVF4RbiFzLDQVBkBuC--eUoM1AYOcJ4VygbmK5yo,822
120
117
  prediction_market_agent_tooling/tools/transaction_cache.py,sha256=K5YKNL2_tR10Iw2TD9fuP-CTGpBbZtNdgbd0B_R7pjg,1814
121
- prediction_market_agent_tooling/tools/utils.py,sha256=7P1veh76ni-0EfT7MlRlLE9hHUU498UOx70Lwxe7UaM,6536
122
- prediction_market_agent_tooling/tools/web3_utils.py,sha256=eYCc1iWAVtqDKUPTwnMUHuYolPdwh_OTiM3-AdRgDp4,12198
123
- prediction_market_agent_tooling-0.61.1.dev463.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
124
- prediction_market_agent_tooling-0.61.1.dev463.dist-info/METADATA,sha256=Ffw49SoHlbcyEvVwF7G85L4_SWUDHMjWcm0CmThSaLM,8696
125
- prediction_market_agent_tooling-0.61.1.dev463.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
126
- prediction_market_agent_tooling-0.61.1.dev463.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
127
- prediction_market_agent_tooling-0.61.1.dev463.dist-info/RECORD,,
118
+ prediction_market_agent_tooling/tools/utils.py,sha256=jLG4nbEoIzzJiZ4RgMx4Q969Zdl0p0s63p8uET_0Fuw,6440
119
+ prediction_market_agent_tooling/tools/web3_utils.py,sha256=3wfqNxvMn44ivweFRoeKNVb9QRtFd7kFtp7VUY5juEE,12862
120
+ prediction_market_agent_tooling-0.61.1.dev477.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
121
+ prediction_market_agent_tooling-0.61.1.dev477.dist-info/METADATA,sha256=cTdPU6VSva5PSgofTUucAuFXtbSnDug4fvTtvi-s1s8,8636
122
+ prediction_market_agent_tooling-0.61.1.dev477.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
123
+ prediction_market_agent_tooling-0.61.1.dev477.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
124
+ prediction_market_agent_tooling-0.61.1.dev477.dist-info/RECORD,,
@@ -1,255 +0,0 @@
1
- import typing as t
2
- from decimal import Decimal
3
- from typing import TypeVar, overload
4
-
5
- from pydantic import GetCoreSchemaHandler
6
- from pydantic_core import CoreSchema, core_schema
7
- from web3.types import Wei as WeiWeb3
8
-
9
- InputValueType = TypeVar(
10
- "InputValueType", bound=t.Union[str, int, float, WeiWeb3, Decimal]
11
- )
12
- InternalValueType = TypeVar("InternalValueType", bound=t.Union[int, float, WeiWeb3])
13
-
14
-
15
- class _GenericValue(
16
- t.Generic[InputValueType, InternalValueType],
17
- # Not great, but it allows to serialize this object with plain json.
18
- dict[t.Literal["value"] | t.Literal["type"], InternalValueType | str],
19
- ):
20
- """
21
- A helper class intended for inheritance. Do not instantiate this class directly.
22
-
23
- Example:
24
-
25
- ```python
26
- a = _GenericValue(10)
27
- b = Token(100) # Token is a subclass of _GenericValue
28
- c = xDai(100) # xDai is a subclass of _GenericValue
29
- d = Mana(100) # Mana is a subclass of _GenericValue
30
- e = xDai(50)
31
-
32
- # Mypy will complain if we try to work with different currencies (types)
33
- b - c # mypy will report incompatible types
34
- c - d # mypy will report incompatible types
35
- c - e # mypy will be ok
36
- a - b # mypy won't report issues, as others are subclasses of _GenericValue, and that's a problem, so don't use _GenericValue directly
37
-
38
- # Resulting types after arithmetic operations are as expected, so we don't need to wrap them as before (e.g. xdai_type(c + c))
39
- x = c - e # x is of type xDai
40
- x = c * e # x if of type xDai
41
- x = c / e # x is of type float (pure value after division with same types)
42
- x = c / 2 # x is of type xDai
43
- x = c // 2 # x is of type xDai
44
- x * x * 2 # x is of type xDai
45
- ```
46
-
47
- TODO: There are some type ignores which isn't cool, but it works and type-wise values are also correct. Idk how to explain it to mypy though.
48
- """
49
-
50
- GenericValueType = TypeVar(
51
- "GenericValueType", bound="_GenericValue[InputValueType, InternalValueType]"
52
- )
53
-
54
- parser: t.Callable[[InputValueType], InternalValueType]
55
-
56
- def __init_subclass__(
57
- cls, parser: t.Callable[[InputValueType], InternalValueType]
58
- ) -> None:
59
- super().__init_subclass__()
60
- cls.parser = parser
61
-
62
- def __init__(self, value: InputValueType) -> None:
63
- self.value: InternalValueType = self.parser(value)
64
- super().__init__({"value": self.value, "type": self.__class__.__name__})
65
-
66
- def __str__(self) -> str:
67
- return f"{self.value}"
68
-
69
- def __neg__(self: GenericValueType) -> GenericValueType:
70
- return type(self)(-self.value) # type: ignore[arg-type]
71
-
72
- def __abs__(self: GenericValueType) -> GenericValueType:
73
- return type(self)(abs(self.value)) # type: ignore[arg-type]
74
-
75
- def __sub__(
76
- self: GenericValueType, other: GenericValueType | t.Literal[0]
77
- ) -> GenericValueType:
78
- if other == 0:
79
- other = self.zero()
80
- if not isinstance(other, _GenericValue):
81
- raise TypeError("Cannot subtract different types")
82
- if type(self) is not type(other):
83
- raise TypeError("Cannot subtract different types")
84
- return type(self)(self.value - other.value)
85
-
86
- def __add__(
87
- self: GenericValueType, other: GenericValueType | t.Literal[0]
88
- ) -> GenericValueType:
89
- if other == 0:
90
- other = self.zero()
91
- if not isinstance(other, _GenericValue):
92
- raise TypeError("Cannot add different types")
93
- if type(self) is not type(other):
94
- raise TypeError("Cannot add different types")
95
- return type(self)(self.value + other.value)
96
-
97
- def __mul__(
98
- self: GenericValueType, other: GenericValueType | int | float
99
- ) -> GenericValueType:
100
- if not isinstance(other, (_GenericValue, int, float)):
101
- raise TypeError("Cannot multiply different types")
102
- if not isinstance(other, (int, float)) and type(self) is not type(other):
103
- raise TypeError("Cannot multiply different types")
104
- return type(self)(self.value * (other if isinstance(other, (int, float)) else other.value)) # type: ignore
105
-
106
- @overload
107
- def __truediv__(self: GenericValueType, other: int | float) -> GenericValueType: ...
108
-
109
- @overload
110
- def __truediv__(
111
- self: GenericValueType, other: GenericValueType
112
- ) -> InternalValueType: ...
113
-
114
- def __truediv__(
115
- self: GenericValueType, other: GenericValueType | int | float
116
- ) -> GenericValueType | InternalValueType:
117
- if not isinstance(other, (_GenericValue, int, float)):
118
- raise TypeError("Cannot multiply different types")
119
- if not isinstance(other, (int, float)) and type(self) is not type(other):
120
- raise TypeError("Cannot multiply different types")
121
- if other == 0:
122
- raise ZeroDivisionError("Cannot divide by zero")
123
- if isinstance(other, (int, float)):
124
- return type(self)(self.value / other) # type: ignore
125
- else:
126
- return self.value / other.value # type: ignore
127
-
128
- @overload
129
- def __floordiv__(
130
- self: GenericValueType, other: int | float
131
- ) -> GenericValueType: ...
132
-
133
- @overload
134
- def __floordiv__(
135
- self: GenericValueType, other: GenericValueType
136
- ) -> InternalValueType: ...
137
-
138
- def __floordiv__(
139
- self: GenericValueType, other: GenericValueType | int | float
140
- ) -> GenericValueType | InternalValueType:
141
- if not isinstance(other, (_GenericValue, int, float)):
142
- raise TypeError("Cannot multiply different types")
143
- if not isinstance(other, (int, float)) and type(self) is not type(other):
144
- raise TypeError("Cannot multiply different types")
145
- if other == 0:
146
- raise ZeroDivisionError("Cannot divide by zero")
147
- if isinstance(other, (int, float)):
148
- return type(self)(self.value // other) # type: ignore
149
- else:
150
- return self.value // other.value # type: ignore
151
-
152
- def __lt__(self: GenericValueType, other: GenericValueType | t.Literal[0]) -> bool:
153
- if other == 0:
154
- other = self.zero()
155
- if not isinstance(other, _GenericValue):
156
- raise TypeError("Cannot compare different types")
157
- if type(self) is not type(other):
158
- raise TypeError("Cannot compare different types")
159
- return bool(self.value < other.value)
160
-
161
- def __le__(self: GenericValueType, other: GenericValueType | t.Literal[0]) -> bool:
162
- if other == 0:
163
- other = self.zero()
164
- if not isinstance(other, _GenericValue):
165
- raise TypeError("Cannot compare different types")
166
- if type(self) is not type(other):
167
- raise TypeError("Cannot compare different types")
168
- return bool(self.value <= other.value)
169
-
170
- def __gt__(self: GenericValueType, other: GenericValueType | t.Literal[0]) -> bool:
171
- if other == 0:
172
- other = self.zero()
173
- if not isinstance(other, _GenericValue):
174
- raise TypeError("Cannot compare different types")
175
- if type(self) is not type(other):
176
- raise TypeError("Cannot compare different types")
177
- return bool(self.value > other.value)
178
-
179
- def __ge__(self: GenericValueType, other: GenericValueType | t.Literal[0]) -> bool:
180
- if other == 0:
181
- other = self.zero()
182
- if not isinstance(other, _GenericValue):
183
- raise TypeError("Cannot compare different types")
184
- if type(self) is not type(other):
185
- raise TypeError("Cannot compare different types")
186
- return bool(self.value >= other.value)
187
-
188
- def __eq__(self: GenericValueType, other: GenericValueType | t.Literal[0]) -> bool: # type: ignore
189
- if other == 0:
190
- other = self.zero()
191
- if not isinstance(other, _GenericValue):
192
- raise TypeError("Cannot compare different types")
193
- if type(self) is not type(other):
194
- raise TypeError("Cannot compare different types")
195
- return bool(self.value == other.value)
196
-
197
- def __ne__(self: GenericValueType, other: GenericValueType | t.Literal[0]) -> bool: # type: ignore
198
- if other == 0:
199
- other = self.zero()
200
- if not isinstance(other, _GenericValue):
201
- raise TypeError("Cannot compare different types")
202
- if type(self) is not type(other):
203
- raise TypeError("Cannot compare different types")
204
- return bool(self.value != other.value)
205
-
206
- def __repr__(self) -> str:
207
- return f"{type(self).__name__}({self.value})"
208
-
209
- def __float__(self) -> float:
210
- return float(self.value)
211
-
212
- def __radd__(
213
- self: GenericValueType, other: GenericValueType | t.Literal[0] | int | float
214
- ) -> GenericValueType:
215
- if isinstance(other, (_GenericValue, int, float)):
216
- return self.__add__(other) # type: ignore[operator]
217
-
218
- elif isinstance(other, (int, float)) and other == 0:
219
- return self
220
-
221
- else:
222
- raise TypeError("Cannot add different types")
223
-
224
- def __round__(self: GenericValueType, ndigits: int = 0) -> GenericValueType:
225
- if not isinstance(self.value, (int, float)):
226
- raise TypeError("Cannot round non-numeric types")
227
- return type(self)(round(self.value, ndigits)) # type: ignore[arg-type]
228
-
229
- def __bool__(self) -> bool:
230
- return bool(self.value)
231
-
232
- @classmethod
233
- def __get_pydantic_core_schema__(
234
- cls, source_type: t.Any, handler: GetCoreSchemaHandler
235
- ) -> CoreSchema:
236
- # Support for Pydantic usage.
237
- dt_schema = handler(str | int | float | dict)
238
- return core_schema.no_info_after_validator_function(
239
- lambda x: cls(x["value"] if isinstance(x, dict) else x),
240
- dt_schema,
241
- )
242
-
243
- def with_fraction(self: GenericValueType, fraction: float) -> GenericValueType:
244
- if not 0 <= fraction <= 1:
245
- raise ValueError(f"Given fraction {fraction} is not in the range [0,1].")
246
- return self.__class__(self.value * (1 + fraction)) # type: ignore[arg-type]
247
-
248
- def without_fraction(self: GenericValueType, fraction: float) -> GenericValueType:
249
- if not 0 <= fraction <= 1:
250
- raise ValueError(f"Given fraction {fraction} is not in the range [0,1].")
251
- return self.__class__(self.value * (1 - fraction)) # type: ignore[arg-type]
252
-
253
- @classmethod
254
- def zero(cls: type[GenericValueType]) -> GenericValueType:
255
- return cls(0) # type: ignore[arg-type]
@@ -1,46 +0,0 @@
1
- from eth_typing.evm import ChecksumAddress
2
- from web3 import Web3
3
-
4
- from prediction_market_agent_tooling.gtypes import ChecksumAddress, Wei
5
- from prediction_market_agent_tooling.tools.contract import (
6
- ContractERC4626BaseClass,
7
- init_collateral_token_contract,
8
- to_gnosis_chain_contract,
9
- )
10
- from prediction_market_agent_tooling.tools.cow.cow_order import get_buy_token_amount
11
-
12
-
13
- def convert_to_another_token(
14
- amount: Wei,
15
- from_token: ChecksumAddress,
16
- to_token: ChecksumAddress,
17
- web3: Web3 | None = None,
18
- ) -> Wei:
19
- from_token_contract = to_gnosis_chain_contract(
20
- init_collateral_token_contract(from_token, web3)
21
- )
22
- to_token_contract = to_gnosis_chain_contract(
23
- init_collateral_token_contract(to_token, web3)
24
- )
25
-
26
- if from_token == to_token:
27
- return amount
28
-
29
- elif (
30
- isinstance(to_token_contract, ContractERC4626BaseClass)
31
- and to_token_contract.get_asset_token_contract().address == from_token
32
- ):
33
- return to_token_contract.convertToShares(amount)
34
-
35
- elif (
36
- isinstance(from_token_contract, ContractERC4626BaseClass)
37
- and from_token_contract.get_asset_token_contract().address == to_token
38
- ):
39
- return from_token_contract.convertToAssets(amount)
40
-
41
- else:
42
- return get_buy_token_amount(
43
- amount,
44
- from_token,
45
- to_token,
46
- )
@@ -1,63 +0,0 @@
1
- from cachetools import TTLCache, cached
2
- from eth_typing.evm import ChecksumAddress
3
-
4
- from prediction_market_agent_tooling.gtypes import (
5
- USD,
6
- ChecksumAddress,
7
- OutcomeToken,
8
- Token,
9
- xDai,
10
- )
11
- from prediction_market_agent_tooling.markets.omen.omen_constants import (
12
- SDAI_CONTRACT_ADDRESS,
13
- WRAPPED_XDAI_CONTRACT_ADDRESS,
14
- )
15
- from prediction_market_agent_tooling.tools.contract import ContractERC4626OnGnosisChain
16
- from prediction_market_agent_tooling.tools.cow.cow_order import get_buy_token_amount
17
-
18
-
19
- def get_usd_in_xdai(amount: USD) -> xDai:
20
- # xDai is stable coin against USD, so for simplicity we just cast it.
21
- return xDai(amount.value)
22
-
23
-
24
- def get_xdai_in_usd(amount: xDai) -> USD:
25
- # xDai is stable coin against USD, so for simplicity we just cast it.
26
- return USD(amount.value)
27
-
28
-
29
- def get_usd_in_token(amount: USD, token_address: ChecksumAddress) -> Token:
30
- rate = get_single_token_unit_to_usd_rate(token_address)
31
- return Token(amount.value / rate.value)
32
-
33
-
34
- def get_token_in_usd(
35
- amount: Token | OutcomeToken, token_address: ChecksumAddress
36
- ) -> USD:
37
- rate = get_single_token_unit_to_usd_rate(token_address)
38
- return USD(amount.value * rate.value)
39
-
40
-
41
- # A short cache to not spam CoW and prevent timeouts, but still have relatively fresh data.
42
- RATE_CACHE: TTLCache[ChecksumAddress, USD] = TTLCache(maxsize=100, ttl=5 * 60)
43
-
44
-
45
- @cached(RATE_CACHE)
46
- def get_single_token_unit_to_usd_rate(token_address: ChecksumAddress) -> USD:
47
- # (w)xDai is a stable coin against USD, so use it to estimate USD worth.
48
- if WRAPPED_XDAI_CONTRACT_ADDRESS == token_address:
49
- return USD(1.0)
50
- # sDai is ERC4626 with wxDai as asset, we can take the rate directly from there instead of calling CoW.
51
- if SDAI_CONTRACT_ADDRESS == token_address:
52
- return USD(
53
- ContractERC4626OnGnosisChain(address=SDAI_CONTRACT_ADDRESS)
54
- .convertToAssets(Token(1).as_wei)
55
- .as_token.value
56
- )
57
- in_wei = get_buy_token_amount(
58
- amount_wei=Token(1).as_wei,
59
- sell_token=token_address,
60
- buy_token=WRAPPED_XDAI_CONTRACT_ADDRESS,
61
- )
62
- in_token = in_wei.as_token
63
- return USD(in_token.value)