prediction-market-agent-tooling 0.69.0__py3-none-any.whl → 0.69.2__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.
- prediction_market_agent_tooling/config.py +16 -0
- prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py +3 -3
- prediction_market_agent_tooling/markets/seer/subgraph_data_models.py +6 -34
- {prediction_market_agent_tooling-0.69.0.dist-info → prediction_market_agent_tooling-0.69.2.dist-info}/METADATA +1 -1
- {prediction_market_agent_tooling-0.69.0.dist-info → prediction_market_agent_tooling-0.69.2.dist-info}/RECORD +8 -8
- {prediction_market_agent_tooling-0.69.0.dist-info → prediction_market_agent_tooling-0.69.2.dist-info}/LICENSE +0 -0
- {prediction_market_agent_tooling-0.69.0.dist-info → prediction_market_agent_tooling-0.69.2.dist-info}/WHEEL +0 -0
- {prediction_market_agent_tooling-0.69.0.dist-info → prediction_market_agent_tooling-0.69.2.dist-info}/entry_points.txt +0 -0
@@ -73,6 +73,10 @@ class APIKeys(BaseSettings):
|
|
73
73
|
|
74
74
|
PERPLEXITY_API_KEY: t.Optional[SecretStr] = None
|
75
75
|
|
76
|
+
DUNE_API_KEY: t.Optional[SecretStr] = None
|
77
|
+
|
78
|
+
SLACK_WEBHOOK_URL: t.Optional[SecretStr] = None
|
79
|
+
|
76
80
|
ENABLE_CACHE: bool = False
|
77
81
|
CACHE_DIR: str = "./.cache"
|
78
82
|
|
@@ -254,6 +258,18 @@ class APIKeys(BaseSettings):
|
|
254
258
|
self.SQLALCHEMY_DB_URL, "SQLALCHEMY_DB_URL missing in the environment."
|
255
259
|
)
|
256
260
|
|
261
|
+
@property
|
262
|
+
def dune_api_key(self) -> SecretStr:
|
263
|
+
return check_not_none(
|
264
|
+
self.DUNE_API_KEY, "DUNE_API_KEY missing in the environment."
|
265
|
+
)
|
266
|
+
|
267
|
+
@property
|
268
|
+
def slack_webhook_url(self) -> SecretStr:
|
269
|
+
return check_not_none(
|
270
|
+
self.SLACK_WEBHOOK_URL, "SLACK_WEBHOOK_URL missing in the environment."
|
271
|
+
)
|
272
|
+
|
257
273
|
def get_account(self) -> LocalAccount:
|
258
274
|
acc: LocalAccount = Account.from_key(
|
259
275
|
self.bet_from_private_key.get_secret_value()
|
@@ -30,7 +30,7 @@ from prediction_market_agent_tooling.markets.seer.data_models import (
|
|
30
30
|
SeerMarketWithQuestions,
|
31
31
|
)
|
32
32
|
from prediction_market_agent_tooling.markets.seer.subgraph_data_models import (
|
33
|
-
|
33
|
+
SwaprPool,
|
34
34
|
SwaprSwap,
|
35
35
|
)
|
36
36
|
from prediction_market_agent_tooling.tools.hexbytes_custom import HexBytes
|
@@ -373,7 +373,7 @@ class SeerSubgraphHandler(BaseSubgraphHandler):
|
|
373
373
|
|
374
374
|
def get_pool_by_token(
|
375
375
|
self, token_address: ChecksumAddress, collateral_address: ChecksumAddress
|
376
|
-
) ->
|
376
|
+
) -> SwaprPool | None:
|
377
377
|
# We iterate through the wrapped tokens and put them in a where clause so that we hit the subgraph endpoint just once.
|
378
378
|
|
379
379
|
where_argument = {
|
@@ -397,7 +397,7 @@ class SeerSubgraphHandler(BaseSubgraphHandler):
|
|
397
397
|
)
|
398
398
|
|
399
399
|
fields = self._get_fields_for_pools(pools_field)
|
400
|
-
pools = self.do_query(fields=fields, pydantic_model=
|
400
|
+
pools = self.do_query(fields=fields, pydantic_model=SwaprPool)
|
401
401
|
# We assume there is only one pool for outcomeToken/sDAI.
|
402
402
|
if len(pools) > 1:
|
403
403
|
logger.info(
|
@@ -14,7 +14,7 @@ from prediction_market_agent_tooling.gtypes import (
|
|
14
14
|
from prediction_market_agent_tooling.tools.datetime_utc import DatetimeUTC
|
15
15
|
|
16
16
|
|
17
|
-
class
|
17
|
+
class SwaprToken(BaseModel):
|
18
18
|
id: HexBytes
|
19
19
|
name: str
|
20
20
|
symbol: str
|
@@ -24,12 +24,12 @@ class SeerToken(BaseModel):
|
|
24
24
|
return Web3.to_checksum_address(self.id.hex())
|
25
25
|
|
26
26
|
|
27
|
-
class
|
27
|
+
class SwaprPool(BaseModel):
|
28
28
|
model_config = ConfigDict(populate_by_name=True)
|
29
29
|
id: HexBytes
|
30
30
|
liquidity: int
|
31
|
-
token0:
|
32
|
-
token1:
|
31
|
+
token0: SwaprToken
|
32
|
+
token1: SwaprToken
|
33
33
|
token0Price: CollateralToken
|
34
34
|
token1Price: CollateralToken
|
35
35
|
sqrtPrice: int
|
@@ -44,8 +44,8 @@ class SwaprSwap(BaseModel):
|
|
44
44
|
price: Wei
|
45
45
|
amount0: CollateralToken
|
46
46
|
amount1: CollateralToken
|
47
|
-
token0:
|
48
|
-
token1:
|
47
|
+
token0: SwaprToken
|
48
|
+
token1: SwaprToken
|
49
49
|
timestamp: int
|
50
50
|
|
51
51
|
@property
|
@@ -65,34 +65,6 @@ class SwaprSwap(BaseModel):
|
|
65
65
|
)
|
66
66
|
|
67
67
|
|
68
|
-
class SeerSwap(BaseModel):
|
69
|
-
id: str # It's like "0x73afd8f096096552d72a0b40ea66d2076be136c6a531e2f6b190d151a750271e#32" (note the #32) # web3-private-key-ok
|
70
|
-
recipient: HexAddress
|
71
|
-
sender: HexAddress
|
72
|
-
price: Wei
|
73
|
-
amount0: CollateralToken
|
74
|
-
amount1: CollateralToken
|
75
|
-
token0: SeerToken
|
76
|
-
token1: SeerToken
|
77
|
-
timestamp: int
|
78
|
-
|
79
|
-
@property
|
80
|
-
def timestamp_utc(self) -> DatetimeUTC:
|
81
|
-
return DatetimeUTC.to_datetime_utc(self.timestamp)
|
82
|
-
|
83
|
-
@property
|
84
|
-
def buying_collateral_amount(self) -> CollateralToken:
|
85
|
-
return self.amount0 if self.amount0 > 0 else self.amount1
|
86
|
-
|
87
|
-
@property
|
88
|
-
def received_shares_amount(self) -> OutcomeToken:
|
89
|
-
return (
|
90
|
-
OutcomeToken(abs(self.amount0).value)
|
91
|
-
if self.amount0 < 0
|
92
|
-
else OutcomeToken(abs(self.amount1).value)
|
93
|
-
)
|
94
|
-
|
95
|
-
|
96
68
|
class NewMarketEvent(BaseModel):
|
97
69
|
market: HexAddress
|
98
70
|
marketName: str
|
@@ -25,7 +25,7 @@ prediction_market_agent_tooling/benchmark/agents.py,sha256=zC5tUM6pPTWtqSddOOSYV
|
|
25
25
|
prediction_market_agent_tooling/benchmark/benchmark.py,sha256=hpIpjjePDFTLhK841sGftFbhu8bDDZr28KO4VTneewM,17837
|
26
26
|
prediction_market_agent_tooling/benchmark/utils.py,sha256=vmVTQLER8I7MM_bHFiavrNM9aQe28PL6WihM6J-E65k,3327
|
27
27
|
prediction_market_agent_tooling/chains.py,sha256=MF600uUR_I0Mf7-Pz5InS6RWMkdrZI2sohP6Vfh0YRw,148
|
28
|
-
prediction_market_agent_tooling/config.py,sha256=
|
28
|
+
prediction_market_agent_tooling/config.py,sha256=h9rsVMCDhDLMmH657CKEDZ4ZCWvC9RmX5p5kPI5rP58,13464
|
29
29
|
prediction_market_agent_tooling/data_download/langfuse_data_downloader.py,sha256=VY23h324VKIVkevj1B1O-zL1eEp9AElmcfn6SwYDUSc,14246
|
30
30
|
prediction_market_agent_tooling/deploy/agent.py,sha256=xtufEkxHkR54TSAqRqiBRcISf05MwrV-WlG4PcOo7xM,30582
|
31
31
|
prediction_market_agent_tooling/deploy/agent_example.py,sha256=yS1fWkHynr9MYGNOM2WsCnRWLPaffY4bOc6bIudrdd4,1377
|
@@ -78,8 +78,8 @@ prediction_market_agent_tooling/markets/seer/price_manager.py,sha256=LCfbnwOlcWn
|
|
78
78
|
prediction_market_agent_tooling/markets/seer/seer.py,sha256=UUH75JAMfI_uZE1pEbdI3rbf5c0K0KgUzBiaVRshjV0,31031
|
79
79
|
prediction_market_agent_tooling/markets/seer/seer_api.py,sha256=4iiTWskxWm__oGgUUd1GhV_ItPSrAr0OfnYQ7lKndnQ,1143
|
80
80
|
prediction_market_agent_tooling/markets/seer/seer_contracts.py,sha256=JqfQNFSRWREPw6pQGpJoh-No5ZlKwmTiALJiAYEuvW8,5516
|
81
|
-
prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py,sha256=
|
82
|
-
prediction_market_agent_tooling/markets/seer/subgraph_data_models.py,sha256=
|
81
|
+
prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py,sha256=nmeSofxwtdB6osrP0ASmDWhL684U52Qp4bqJRbRFkCE,18794
|
82
|
+
prediction_market_agent_tooling/markets/seer/subgraph_data_models.py,sha256=96v41jdNNxBqTCp5g8SLMSrIgeeITVx5IsBjVgm-qdo,2920
|
83
83
|
prediction_market_agent_tooling/markets/seer/swap_pool_handler.py,sha256=k_sCEJZLroVDjOVkZ084VKJGNODLGjBGezhsWEZvlH4,3528
|
84
84
|
prediction_market_agent_tooling/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
85
85
|
prediction_market_agent_tooling/tools/_generic_value.py,sha256=pD_PI13lpPp1gFoljHwa_Lzlp-u2pu0m-Z7LcxwDM2U,10618
|
@@ -132,8 +132,8 @@ prediction_market_agent_tooling/tools/tokens/usd.py,sha256=DPO-4HBTy1-TZHKL_9CnH
|
|
132
132
|
prediction_market_agent_tooling/tools/transaction_cache.py,sha256=K5YKNL2_tR10Iw2TD9fuP-CTGpBbZtNdgbd0B_R7pjg,1814
|
133
133
|
prediction_market_agent_tooling/tools/utils.py,sha256=mbOGoWKalNIm7M2K51TEPGwU9oVp1Z6SPsFaBgbn6ws,7397
|
134
134
|
prediction_market_agent_tooling/tools/web3_utils.py,sha256=ajHZIBM_PNNNUp0ZxJ-AvpSzyVATm7LnZtb2hi6NcOw,12614
|
135
|
-
prediction_market_agent_tooling-0.69.
|
136
|
-
prediction_market_agent_tooling-0.69.
|
137
|
-
prediction_market_agent_tooling-0.69.
|
138
|
-
prediction_market_agent_tooling-0.69.
|
139
|
-
prediction_market_agent_tooling-0.69.
|
135
|
+
prediction_market_agent_tooling-0.69.2.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
|
136
|
+
prediction_market_agent_tooling-0.69.2.dist-info/METADATA,sha256=TYc4P5Qr0fFmz0yQYHXi7lw8hMw_YE92VOtcr-6B7HY,8805
|
137
|
+
prediction_market_agent_tooling-0.69.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
138
|
+
prediction_market_agent_tooling-0.69.2.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
|
139
|
+
prediction_market_agent_tooling-0.69.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|