prediction-market-agent-tooling 0.65.5__py3-none-any.whl → 0.69.17.dev1149__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 (88) hide show
  1. prediction_market_agent_tooling/abis/agentresultmapping.abi.json +192 -0
  2. prediction_market_agent_tooling/abis/erc1155.abi.json +352 -0
  3. prediction_market_agent_tooling/abis/processor.abi.json +16 -0
  4. prediction_market_agent_tooling/abis/swapr_quoter.abi.json +221 -0
  5. prediction_market_agent_tooling/abis/swapr_router.abi.json +634 -0
  6. prediction_market_agent_tooling/benchmark/benchmark.py +1 -1
  7. prediction_market_agent_tooling/benchmark/utils.py +13 -0
  8. prediction_market_agent_tooling/chains.py +1 -0
  9. prediction_market_agent_tooling/config.py +61 -2
  10. prediction_market_agent_tooling/data_download/langfuse_data_downloader.py +405 -0
  11. prediction_market_agent_tooling/deploy/agent.py +199 -67
  12. prediction_market_agent_tooling/deploy/agent_example.py +1 -1
  13. prediction_market_agent_tooling/deploy/betting_strategy.py +412 -68
  14. prediction_market_agent_tooling/deploy/constants.py +6 -0
  15. prediction_market_agent_tooling/gtypes.py +11 -1
  16. prediction_market_agent_tooling/jobs/jobs_models.py +2 -2
  17. prediction_market_agent_tooling/jobs/omen/omen_jobs.py +19 -20
  18. prediction_market_agent_tooling/loggers.py +9 -1
  19. prediction_market_agent_tooling/logprobs_parser.py +2 -1
  20. prediction_market_agent_tooling/markets/agent_market.py +106 -18
  21. prediction_market_agent_tooling/markets/blockchain_utils.py +37 -19
  22. prediction_market_agent_tooling/markets/data_models.py +120 -7
  23. prediction_market_agent_tooling/markets/manifold/data_models.py +5 -3
  24. prediction_market_agent_tooling/markets/manifold/manifold.py +21 -2
  25. prediction_market_agent_tooling/markets/manifold/utils.py +8 -2
  26. prediction_market_agent_tooling/markets/market_type.py +74 -0
  27. prediction_market_agent_tooling/markets/markets.py +7 -99
  28. prediction_market_agent_tooling/markets/metaculus/data_models.py +3 -3
  29. prediction_market_agent_tooling/markets/metaculus/metaculus.py +5 -8
  30. prediction_market_agent_tooling/markets/omen/cow_contracts.py +5 -1
  31. prediction_market_agent_tooling/markets/omen/data_models.py +63 -32
  32. prediction_market_agent_tooling/markets/omen/omen.py +112 -23
  33. prediction_market_agent_tooling/markets/omen/omen_constants.py +8 -0
  34. prediction_market_agent_tooling/markets/omen/omen_contracts.py +18 -203
  35. prediction_market_agent_tooling/markets/omen/omen_resolving.py +33 -13
  36. prediction_market_agent_tooling/markets/omen/omen_subgraph_handler.py +23 -18
  37. prediction_market_agent_tooling/markets/polymarket/api.py +123 -100
  38. prediction_market_agent_tooling/markets/polymarket/clob_manager.py +156 -0
  39. prediction_market_agent_tooling/markets/polymarket/constants.py +15 -0
  40. prediction_market_agent_tooling/markets/polymarket/data_models.py +95 -19
  41. prediction_market_agent_tooling/markets/polymarket/polymarket.py +373 -29
  42. prediction_market_agent_tooling/markets/polymarket/polymarket_contracts.py +35 -0
  43. prediction_market_agent_tooling/markets/polymarket/polymarket_subgraph_handler.py +91 -0
  44. prediction_market_agent_tooling/markets/polymarket/utils.py +1 -22
  45. prediction_market_agent_tooling/markets/seer/data_models.py +111 -17
  46. prediction_market_agent_tooling/markets/seer/exceptions.py +2 -0
  47. prediction_market_agent_tooling/markets/seer/price_manager.py +165 -50
  48. prediction_market_agent_tooling/markets/seer/seer.py +393 -106
  49. prediction_market_agent_tooling/markets/seer/seer_api.py +28 -0
  50. prediction_market_agent_tooling/markets/seer/seer_contracts.py +115 -5
  51. prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py +297 -66
  52. prediction_market_agent_tooling/markets/seer/subgraph_data_models.py +43 -8
  53. prediction_market_agent_tooling/markets/seer/swap_pool_handler.py +80 -0
  54. prediction_market_agent_tooling/tools/_generic_value.py +8 -2
  55. prediction_market_agent_tooling/tools/betting_strategies/kelly_criterion.py +271 -8
  56. prediction_market_agent_tooling/tools/betting_strategies/utils.py +6 -1
  57. prediction_market_agent_tooling/tools/caches/db_cache.py +219 -117
  58. prediction_market_agent_tooling/tools/caches/serializers.py +11 -2
  59. prediction_market_agent_tooling/tools/contract.py +480 -38
  60. prediction_market_agent_tooling/tools/contract_utils.py +61 -0
  61. prediction_market_agent_tooling/tools/cow/cow_order.py +218 -45
  62. prediction_market_agent_tooling/tools/cow/models.py +122 -0
  63. prediction_market_agent_tooling/tools/cow/semaphore.py +104 -0
  64. prediction_market_agent_tooling/tools/datetime_utc.py +14 -2
  65. prediction_market_agent_tooling/tools/db/db_manager.py +59 -0
  66. prediction_market_agent_tooling/tools/hexbytes_custom.py +4 -1
  67. prediction_market_agent_tooling/tools/httpx_cached_client.py +15 -6
  68. prediction_market_agent_tooling/tools/langfuse_client_utils.py +21 -8
  69. prediction_market_agent_tooling/tools/openai_utils.py +31 -0
  70. prediction_market_agent_tooling/tools/perplexity/perplexity_client.py +86 -0
  71. prediction_market_agent_tooling/tools/perplexity/perplexity_models.py +26 -0
  72. prediction_market_agent_tooling/tools/perplexity/perplexity_search.py +73 -0
  73. prediction_market_agent_tooling/tools/rephrase.py +71 -0
  74. prediction_market_agent_tooling/tools/singleton.py +11 -6
  75. prediction_market_agent_tooling/tools/streamlit_utils.py +188 -0
  76. prediction_market_agent_tooling/tools/tokens/auto_deposit.py +64 -0
  77. prediction_market_agent_tooling/tools/tokens/auto_withdraw.py +8 -0
  78. prediction_market_agent_tooling/tools/tokens/slippage.py +21 -0
  79. prediction_market_agent_tooling/tools/tokens/usd.py +5 -2
  80. prediction_market_agent_tooling/tools/utils.py +61 -3
  81. prediction_market_agent_tooling/tools/web3_utils.py +63 -9
  82. {prediction_market_agent_tooling-0.65.5.dist-info → prediction_market_agent_tooling-0.69.17.dev1149.dist-info}/METADATA +13 -9
  83. {prediction_market_agent_tooling-0.65.5.dist-info → prediction_market_agent_tooling-0.69.17.dev1149.dist-info}/RECORD +86 -64
  84. {prediction_market_agent_tooling-0.65.5.dist-info → prediction_market_agent_tooling-0.69.17.dev1149.dist-info}/WHEEL +1 -1
  85. prediction_market_agent_tooling/abis/omen_agentresultmapping.abi.json +0 -171
  86. prediction_market_agent_tooling/markets/polymarket/data_models_web.py +0 -420
  87. {prediction_market_agent_tooling-0.65.5.dist-info → prediction_market_agent_tooling-0.69.17.dev1149.dist-info}/entry_points.txt +0 -0
  88. {prediction_market_agent_tooling-0.65.5.dist-info → prediction_market_agent_tooling-0.69.17.dev1149.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,192 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "internalType": "string",
6
+ "name": "_marketPlatformName",
7
+ "type": "string"
8
+ }
9
+ ],
10
+ "stateMutability": "nonpayable",
11
+ "type": "constructor"
12
+ },
13
+ {
14
+ "anonymous": false,
15
+ "inputs": [
16
+ {
17
+ "indexed": true,
18
+ "internalType": "address",
19
+ "name": "marketAddress",
20
+ "type": "address"
21
+ },
22
+ {
23
+ "indexed": true,
24
+ "internalType": "address",
25
+ "name": "publisherAddress",
26
+ "type": "address"
27
+ },
28
+ {
29
+ "indexed": false,
30
+ "internalType": "string[]",
31
+ "name": "outcomes",
32
+ "type": "string[]"
33
+ },
34
+ {
35
+ "indexed": false,
36
+ "internalType": "uint16[]",
37
+ "name": "estimatedProbabilitiesBps",
38
+ "type": "uint16[]"
39
+ },
40
+ {
41
+ "indexed": false,
42
+ "internalType": "bytes32[]",
43
+ "name": "txHashes",
44
+ "type": "bytes32[]"
45
+ },
46
+ {
47
+ "indexed": false,
48
+ "internalType": "bytes32",
49
+ "name": "ipfsHash",
50
+ "type": "bytes32"
51
+ }
52
+ ],
53
+ "name": "PredictionAdded",
54
+ "type": "event"
55
+ },
56
+ {
57
+ "inputs": [
58
+ { "internalType": "address", "name": "marketAddress", "type": "address" },
59
+ {
60
+ "components": [
61
+ {
62
+ "internalType": "address",
63
+ "name": "marketAddress",
64
+ "type": "address"
65
+ },
66
+ {
67
+ "internalType": "address",
68
+ "name": "publisherAddress",
69
+ "type": "address"
70
+ },
71
+ { "internalType": "bytes32", "name": "ipfsHash", "type": "bytes32" },
72
+ {
73
+ "internalType": "bytes32[]",
74
+ "name": "txHashes",
75
+ "type": "bytes32[]"
76
+ },
77
+ {
78
+ "internalType": "string[]",
79
+ "name": "outcomes",
80
+ "type": "string[]"
81
+ },
82
+ {
83
+ "internalType": "uint16[]",
84
+ "name": "estimatedProbabilitiesBps",
85
+ "type": "uint16[]"
86
+ }
87
+ ],
88
+ "internalType": "struct Prediction",
89
+ "name": "prediction",
90
+ "type": "tuple"
91
+ }
92
+ ],
93
+ "name": "addPrediction",
94
+ "outputs": [],
95
+ "stateMutability": "nonpayable",
96
+ "type": "function"
97
+ },
98
+ {
99
+ "inputs": [
100
+ { "internalType": "address", "name": "marketAddress", "type": "address" },
101
+ { "internalType": "uint256", "name": "index", "type": "uint256" }
102
+ ],
103
+ "name": "getPredictionByIndex",
104
+ "outputs": [
105
+ {
106
+ "components": [
107
+ {
108
+ "internalType": "address",
109
+ "name": "marketAddress",
110
+ "type": "address"
111
+ },
112
+ {
113
+ "internalType": "address",
114
+ "name": "publisherAddress",
115
+ "type": "address"
116
+ },
117
+ { "internalType": "bytes32", "name": "ipfsHash", "type": "bytes32" },
118
+ {
119
+ "internalType": "bytes32[]",
120
+ "name": "txHashes",
121
+ "type": "bytes32[]"
122
+ },
123
+ {
124
+ "internalType": "string[]",
125
+ "name": "outcomes",
126
+ "type": "string[]"
127
+ },
128
+ {
129
+ "internalType": "uint16[]",
130
+ "name": "estimatedProbabilitiesBps",
131
+ "type": "uint16[]"
132
+ }
133
+ ],
134
+ "internalType": "struct Prediction",
135
+ "name": "",
136
+ "type": "tuple"
137
+ }
138
+ ],
139
+ "stateMutability": "view",
140
+ "type": "function"
141
+ },
142
+ {
143
+ "inputs": [
144
+ { "internalType": "address", "name": "marketAddress", "type": "address" }
145
+ ],
146
+ "name": "getPredictions",
147
+ "outputs": [
148
+ {
149
+ "components": [
150
+ {
151
+ "internalType": "address",
152
+ "name": "marketAddress",
153
+ "type": "address"
154
+ },
155
+ {
156
+ "internalType": "address",
157
+ "name": "publisherAddress",
158
+ "type": "address"
159
+ },
160
+ { "internalType": "bytes32", "name": "ipfsHash", "type": "bytes32" },
161
+ {
162
+ "internalType": "bytes32[]",
163
+ "name": "txHashes",
164
+ "type": "bytes32[]"
165
+ },
166
+ {
167
+ "internalType": "string[]",
168
+ "name": "outcomes",
169
+ "type": "string[]"
170
+ },
171
+ {
172
+ "internalType": "uint16[]",
173
+ "name": "estimatedProbabilitiesBps",
174
+ "type": "uint16[]"
175
+ }
176
+ ],
177
+ "internalType": "struct Prediction[]",
178
+ "name": "",
179
+ "type": "tuple[]"
180
+ }
181
+ ],
182
+ "stateMutability": "view",
183
+ "type": "function"
184
+ },
185
+ {
186
+ "inputs": [],
187
+ "name": "marketPlatformName",
188
+ "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
189
+ "stateMutability": "view",
190
+ "type": "function"
191
+ }
192
+ ]
@@ -0,0 +1,352 @@
1
+ [
2
+ {
3
+ "inputs": [],
4
+ "stateMutability": "nonpayable",
5
+ "type": "constructor"
6
+ },
7
+ {
8
+ "anonymous": false,
9
+ "inputs": [
10
+ {
11
+ "indexed": true,
12
+ "internalType": "address",
13
+ "name": "owner",
14
+ "type": "address"
15
+ },
16
+ {
17
+ "indexed": true,
18
+ "internalType": "address",
19
+ "name": "spender",
20
+ "type": "address"
21
+ },
22
+ {
23
+ "indexed": false,
24
+ "internalType": "uint256",
25
+ "name": "value",
26
+ "type": "uint256"
27
+ }
28
+ ],
29
+ "name": "Approval",
30
+ "type": "event"
31
+ },
32
+ {
33
+ "anonymous": false,
34
+ "inputs": [
35
+ {
36
+ "indexed": true,
37
+ "internalType": "address",
38
+ "name": "from",
39
+ "type": "address"
40
+ },
41
+ {
42
+ "indexed": true,
43
+ "internalType": "address",
44
+ "name": "to",
45
+ "type": "address"
46
+ },
47
+ {
48
+ "indexed": false,
49
+ "internalType": "uint256",
50
+ "name": "value",
51
+ "type": "uint256"
52
+ }
53
+ ],
54
+ "name": "Transfer",
55
+ "type": "event"
56
+ },
57
+ {
58
+ "inputs": [
59
+ {
60
+ "internalType": "address",
61
+ "name": "owner",
62
+ "type": "address"
63
+ },
64
+ {
65
+ "internalType": "address",
66
+ "name": "spender",
67
+ "type": "address"
68
+ }
69
+ ],
70
+ "name": "allowance",
71
+ "outputs": [
72
+ {
73
+ "internalType": "uint256",
74
+ "name": "",
75
+ "type": "uint256"
76
+ }
77
+ ],
78
+ "stateMutability": "view",
79
+ "type": "function"
80
+ },
81
+ {
82
+ "inputs": [
83
+ {
84
+ "internalType": "address",
85
+ "name": "spender",
86
+ "type": "address"
87
+ },
88
+ {
89
+ "internalType": "uint256",
90
+ "name": "amount",
91
+ "type": "uint256"
92
+ }
93
+ ],
94
+ "name": "approve",
95
+ "outputs": [
96
+ {
97
+ "internalType": "bool",
98
+ "name": "",
99
+ "type": "bool"
100
+ }
101
+ ],
102
+ "stateMutability": "nonpayable",
103
+ "type": "function"
104
+ },
105
+ {
106
+ "inputs": [
107
+ {
108
+ "internalType": "address",
109
+ "name": "account",
110
+ "type": "address"
111
+ }
112
+ ],
113
+ "name": "balanceOf",
114
+ "outputs": [
115
+ {
116
+ "internalType": "uint256",
117
+ "name": "",
118
+ "type": "uint256"
119
+ }
120
+ ],
121
+ "stateMutability": "view",
122
+ "type": "function"
123
+ },
124
+ {
125
+ "inputs": [
126
+ {
127
+ "internalType": "address",
128
+ "name": "account",
129
+ "type": "address"
130
+ },
131
+ {
132
+ "internalType": "uint256",
133
+ "name": "amount",
134
+ "type": "uint256"
135
+ }
136
+ ],
137
+ "name": "burn",
138
+ "outputs": [],
139
+ "stateMutability": "nonpayable",
140
+ "type": "function"
141
+ },
142
+ {
143
+ "inputs": [],
144
+ "name": "decimals",
145
+ "outputs": [
146
+ {
147
+ "internalType": "uint8",
148
+ "name": "",
149
+ "type": "uint8"
150
+ }
151
+ ],
152
+ "stateMutability": "view",
153
+ "type": "function"
154
+ },
155
+ {
156
+ "inputs": [
157
+ {
158
+ "internalType": "address",
159
+ "name": "spender",
160
+ "type": "address"
161
+ },
162
+ {
163
+ "internalType": "uint256",
164
+ "name": "subtractedValue",
165
+ "type": "uint256"
166
+ }
167
+ ],
168
+ "name": "decreaseAllowance",
169
+ "outputs": [
170
+ {
171
+ "internalType": "bool",
172
+ "name": "",
173
+ "type": "bool"
174
+ }
175
+ ],
176
+ "stateMutability": "nonpayable",
177
+ "type": "function"
178
+ },
179
+ {
180
+ "inputs": [],
181
+ "name": "factory",
182
+ "outputs": [
183
+ {
184
+ "internalType": "contract Wrapped1155Factory",
185
+ "name": "",
186
+ "type": "address"
187
+ }
188
+ ],
189
+ "stateMutability": "view",
190
+ "type": "function"
191
+ },
192
+ {
193
+ "inputs": [
194
+ {
195
+ "internalType": "address",
196
+ "name": "spender",
197
+ "type": "address"
198
+ },
199
+ {
200
+ "internalType": "uint256",
201
+ "name": "addedValue",
202
+ "type": "uint256"
203
+ }
204
+ ],
205
+ "name": "increaseAllowance",
206
+ "outputs": [
207
+ {
208
+ "internalType": "bool",
209
+ "name": "",
210
+ "type": "bool"
211
+ }
212
+ ],
213
+ "stateMutability": "nonpayable",
214
+ "type": "function"
215
+ },
216
+ {
217
+ "inputs": [
218
+ {
219
+ "internalType": "address",
220
+ "name": "account",
221
+ "type": "address"
222
+ },
223
+ {
224
+ "internalType": "uint256",
225
+ "name": "amount",
226
+ "type": "uint256"
227
+ }
228
+ ],
229
+ "name": "mint",
230
+ "outputs": [],
231
+ "stateMutability": "nonpayable",
232
+ "type": "function"
233
+ },
234
+ {
235
+ "inputs": [],
236
+ "name": "multiToken",
237
+ "outputs": [
238
+ {
239
+ "internalType": "contract IERC1155",
240
+ "name": "",
241
+ "type": "address"
242
+ }
243
+ ],
244
+ "stateMutability": "view",
245
+ "type": "function"
246
+ },
247
+ {
248
+ "inputs": [],
249
+ "name": "name",
250
+ "outputs": [
251
+ {
252
+ "internalType": "string",
253
+ "name": "",
254
+ "type": "string"
255
+ }
256
+ ],
257
+ "stateMutability": "view",
258
+ "type": "function"
259
+ },
260
+ {
261
+ "inputs": [],
262
+ "name": "symbol",
263
+ "outputs": [
264
+ {
265
+ "internalType": "string",
266
+ "name": "",
267
+ "type": "string"
268
+ }
269
+ ],
270
+ "stateMutability": "view",
271
+ "type": "function"
272
+ },
273
+ {
274
+ "inputs": [],
275
+ "name": "tokenId",
276
+ "outputs": [
277
+ {
278
+ "internalType": "uint256",
279
+ "name": "",
280
+ "type": "uint256"
281
+ }
282
+ ],
283
+ "stateMutability": "view",
284
+ "type": "function"
285
+ },
286
+ {
287
+ "inputs": [],
288
+ "name": "totalSupply",
289
+ "outputs": [
290
+ {
291
+ "internalType": "uint256",
292
+ "name": "",
293
+ "type": "uint256"
294
+ }
295
+ ],
296
+ "stateMutability": "view",
297
+ "type": "function"
298
+ },
299
+ {
300
+ "inputs": [
301
+ {
302
+ "internalType": "address",
303
+ "name": "recipient",
304
+ "type": "address"
305
+ },
306
+ {
307
+ "internalType": "uint256",
308
+ "name": "amount",
309
+ "type": "uint256"
310
+ }
311
+ ],
312
+ "name": "transfer",
313
+ "outputs": [
314
+ {
315
+ "internalType": "bool",
316
+ "name": "",
317
+ "type": "bool"
318
+ }
319
+ ],
320
+ "stateMutability": "nonpayable",
321
+ "type": "function"
322
+ },
323
+ {
324
+ "inputs": [
325
+ {
326
+ "internalType": "address",
327
+ "name": "sender",
328
+ "type": "address"
329
+ },
330
+ {
331
+ "internalType": "address",
332
+ "name": "recipient",
333
+ "type": "address"
334
+ },
335
+ {
336
+ "internalType": "uint256",
337
+ "name": "amount",
338
+ "type": "uint256"
339
+ }
340
+ ],
341
+ "name": "transferFrom",
342
+ "outputs": [
343
+ {
344
+ "internalType": "bool",
345
+ "name": "",
346
+ "type": "bool"
347
+ }
348
+ ],
349
+ "stateMutability": "nonpayable",
350
+ "type": "function"
351
+ }
352
+ ]
@@ -0,0 +1,16 @@
1
+ [
2
+ {
3
+ "constant": true,
4
+ "inputs": [],
5
+ "name": "processor",
6
+ "outputs": [
7
+ {
8
+ "name": "impl",
9
+ "type": "address"
10
+ }
11
+ ],
12
+ "payable": false,
13
+ "stateMutability": "view",
14
+ "type": "function"
15
+ }
16
+ ]