cyberosa commited on
Commit ·
a899051
1
Parent(s): 217aa4f
updating DAA numbers
Browse files- latest_result_DAA_Pearl.parquet +2 -2
- latest_result_DAA_QS.parquet +2 -2
- scripts/daa.py +4 -23
latest_result_DAA_Pearl.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:944c4f705105e2fd1851266664960a489a6f516a92c01906482492e30408c6c8
|
| 3 |
+
size 5041
|
latest_result_DAA_QS.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:fc362c583e0dc2e7b53d950c9a843c68e8dde0ae28202e38c752874e088ae400
|
| 3 |
+
size 5412
|
scripts/daa.py
CHANGED
|
@@ -129,25 +129,6 @@ def prepare_predict_agents_dataset():
|
|
| 129 |
predict_agents.to_csv(ROOT_DIR / "olas_trader_agents.csv", index=False)
|
| 130 |
|
| 131 |
|
| 132 |
-
def prepare_olas_traders_dataset():
|
| 133 |
-
# load the service map pickle file
|
| 134 |
-
with open(ROOT_DIR / "service_map.pkl", "rb") as f:
|
| 135 |
-
service_map = pickle.load(f)
|
| 136 |
-
|
| 137 |
-
# get the list of unique olas traders from all trades profitability
|
| 138 |
-
all_trades = pd.read_parquet(ROOT_DIR / "all_trades_profitability.parquet")
|
| 139 |
-
olas_traders = all_trades[all_trades["staking"] != "non_Olas"]
|
| 140 |
-
olas_traders = olas_traders[["trader_address", "market_creator"]].drop_duplicates()
|
| 141 |
-
olas_traders = olas_traders.reset_index(drop=True)
|
| 142 |
-
print(f"Number of unique traders = {len(olas_traders)}")
|
| 143 |
-
|
| 144 |
-
olas_traders["service_id"] = olas_traders["trader_address"].apply(
|
| 145 |
-
lambda x: get_service_id_from_trader_address(x, service_map)
|
| 146 |
-
)
|
| 147 |
-
# save the dataset as a csv file
|
| 148 |
-
olas_traders.to_csv(ROOT_DIR / "olas_traders.csv", index=False)
|
| 149 |
-
|
| 150 |
-
|
| 151 |
def setup_dune_python_client():
|
| 152 |
"""Function to setup the dune python client"""
|
| 153 |
|
|
@@ -196,12 +177,12 @@ def load_olas_agents_dataset_in_dune(dune_client: DuneClient):
|
|
| 196 |
|
| 197 |
def get_latest_result_from_DAA_QS(dune_client: DuneClient):
|
| 198 |
query = QueryBase(
|
| 199 |
-
query_id=
|
| 200 |
)
|
| 201 |
try:
|
| 202 |
# Add error handling and sanitize headers
|
| 203 |
# query_result = dune_client.run_query_dataframe(query=query)
|
| 204 |
-
query_result = dune_client.get_latest_result_dataframe(
|
| 205 |
print(f"DAA QS query result = {query_result.head()}")
|
| 206 |
return query_result
|
| 207 |
except UnicodeEncodeError:
|
|
@@ -215,10 +196,10 @@ def get_latest_result_from_DAA_QS(dune_client: DuneClient):
|
|
| 215 |
|
| 216 |
def get_latest_result_from_DAA_Pearl(dune_client: DuneClient):
|
| 217 |
query = QueryBase(
|
| 218 |
-
query_id=
|
| 219 |
)
|
| 220 |
# query_result = dune_client.run_query_dataframe(query=query)
|
| 221 |
-
query_result = dune_client.get_latest_result_dataframe(
|
| 222 |
print(f"DAA Pearl query result = {query_result.head()}")
|
| 223 |
return query_result
|
| 224 |
|
|
|
|
| 129 |
predict_agents.to_csv(ROOT_DIR / "olas_trader_agents.csv", index=False)
|
| 130 |
|
| 131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
def setup_dune_python_client():
|
| 133 |
"""Function to setup the dune python client"""
|
| 134 |
|
|
|
|
| 177 |
|
| 178 |
def get_latest_result_from_DAA_QS(dune_client: DuneClient):
|
| 179 |
query = QueryBase(
|
| 180 |
+
query_id=5193717,
|
| 181 |
)
|
| 182 |
try:
|
| 183 |
# Add error handling and sanitize headers
|
| 184 |
# query_result = dune_client.run_query_dataframe(query=query)
|
| 185 |
+
query_result = dune_client.get_latest_result_dataframe(5193717)
|
| 186 |
print(f"DAA QS query result = {query_result.head()}")
|
| 187 |
return query_result
|
| 188 |
except UnicodeEncodeError:
|
|
|
|
| 196 |
|
| 197 |
def get_latest_result_from_DAA_Pearl(dune_client: DuneClient):
|
| 198 |
query = QueryBase(
|
| 199 |
+
query_id=5193539,
|
| 200 |
)
|
| 201 |
# query_result = dune_client.run_query_dataframe(query=query)
|
| 202 |
+
query_result = dune_client.get_latest_result_dataframe(5193539)
|
| 203 |
print(f"DAA Pearl query result = {query_result.head()}")
|
| 204 |
return query_result
|
| 205 |
|