cyberosa
commited on
Commit
·
369b808
1
Parent(s):
0f3afed
updating live markets data
Browse files
live_data/markets_live_data.parquet
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bafb0df82e4ecd5e9ad9eb9c5cc0dcb2d9582b059fb6411d7d77bc0198c8a5e7
|
3 |
+
size 41977
|
live_data/markets_live_data_sample.parquet
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3950d1afe7bcb81f847c20c9a0297eb4b35cbab47f69526866a16261288b8a11
|
3 |
+
size 35121
|
scripts/live_traders_data.py
CHANGED
@@ -37,7 +37,7 @@ def _query_omen_xdai_subgraph(
|
|
37 |
id_gt=id_gt,
|
38 |
fpmm_id=fpmm_id,
|
39 |
)
|
40 |
-
logger.debug(f"query for the omen to collect trades {query}")
|
41 |
content_json = _to_content(query)
|
42 |
|
43 |
res = requests.post(omen_subgraph, headers=headers, json=content_json)
|
@@ -116,6 +116,9 @@ def compute_price_weighted_perc(trades_outcome_0: pd.DataFrame, trades_outcome_1
|
|
116 |
total_usd_outcome_0 = sum(trades_outcome_0.collateralAmountUSD)
|
117 |
total_usd_outcome_1 = sum(trades_outcome_1.collateralAmountUSD)
|
118 |
total_usd = total_usd_outcome_0 + total_usd_outcome_1
|
|
|
|
|
|
|
119 |
percentage_pwc_outcome_0 = round((total_usd_outcome_0/total_usd)*100, 2)
|
120 |
logger.debug(f"total amount for outcome 0 = {total_usd_outcome_0}")
|
121 |
logger.debug(f"total usd = {total_usd}")
|
|
|
37 |
id_gt=id_gt,
|
38 |
fpmm_id=fpmm_id,
|
39 |
)
|
40 |
+
#logger.debug(f"query for the omen to collect trades {query}")
|
41 |
content_json = _to_content(query)
|
42 |
|
43 |
res = requests.post(omen_subgraph, headers=headers, json=content_json)
|
|
|
116 |
total_usd_outcome_0 = sum(trades_outcome_0.collateralAmountUSD)
|
117 |
total_usd_outcome_1 = sum(trades_outcome_1.collateralAmountUSD)
|
118 |
total_usd = total_usd_outcome_0 + total_usd_outcome_1
|
119 |
+
if total_usd == 0.0:
|
120 |
+
raise ValueError("The total amount of dollars is 0")
|
121 |
+
|
122 |
percentage_pwc_outcome_0 = round((total_usd_outcome_0/total_usd)*100, 2)
|
123 |
logger.debug(f"total amount for outcome 0 = {total_usd_outcome_0}")
|
124 |
logger.debug(f"total usd = {total_usd}")
|