Commit
·
1c838e1
1
Parent(s):
b7c0059
new data and staking labeling
Browse files- data/all_trades_profitability.parquet +2 -2
- data/fpmmTrades.parquet +2 -2
- data/fpmms.parquet +2 -2
- data/invalid_trades.parquet +2 -2
- data/outliers.parquet +1 -1
- data/service_map.pkl +2 -2
- data/summary_profitability.parquet +2 -2
- data/t_map.pkl +2 -2
- data/tools.parquet +2 -2
- data/tools_accuracy.csv +2 -2
- notebooks/staking.ipynb +49 -18
- scripts/profitability.py +1 -1
data/all_trades_profitability.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:de444336f956e3e925295de47f76a9f2a4032eef7e5b08f62d2d2aaf280e9abb
|
| 3 |
+
size 2260795
|
data/fpmmTrades.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:2ea1005ca010d6520755b783b193c5b63a7086c6078779b6ce519711c5614aeb
|
| 3 |
+
size 6488625
|
data/fpmms.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:8c4e2ebf82e71c8917904414692a9c2035f7dca1ea4dcda2347567f8444d7988
|
| 3 |
+
size 451395
|
data/invalid_trades.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:26d4769eea190d7a60d3baaa05acf5a95e2a7d6a97ee114c51ffed2a5f3a1244
|
| 3 |
+
size 107413
|
data/outliers.parquet
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 17918
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b959330d9f3ad550dc86299aaec934f6493b3722c768dbcd3bfbef5a4d00e28e
|
| 3 |
size 17918
|
data/service_map.pkl
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:c8a65e38c2eb36f0687cecad8a9888c546ba4399146aa6c7f6b95ab6158e5f6f
|
| 3 |
+
size 75673
|
data/summary_profitability.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:5b306cd96c3fbde234f3e78cfcd6e102d7327ffbe0b3e9d57b077c4a2328b8c3
|
| 3 |
+
size 42876
|
data/t_map.pkl
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:a34e1da2839685bf55bcfa18de4ca5fa1b66c371d624407d08a7cbb4c01feaf1
|
| 3 |
+
size 18556147
|
data/tools.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:346ea715c220491617baa1a0aa45de2cb9b3a54b1c7f79cfba52c616a510efef
|
| 3 |
+
size 320754132
|
data/tools_accuracy.csv
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:8d873ec67c6da96e80d1e107a7a09f39b23efda8e12cd24541c573cc30931a79
|
| 3 |
+
size 1011
|
notebooks/staking.ipynb
CHANGED
|
@@ -191,19 +191,29 @@
|
|
| 191 |
},
|
| 192 |
{
|
| 193 |
"cell_type": "code",
|
| 194 |
-
"execution_count":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
"metadata": {},
|
| 196 |
"outputs": [
|
| 197 |
{
|
| 198 |
"data": {
|
| 199 |
"text/plain": [
|
| 200 |
"staking\n",
|
| 201 |
-
"
|
| 202 |
-
"pearl
|
|
|
|
| 203 |
"Name: count, dtype: int64"
|
| 204 |
]
|
| 205 |
},
|
| 206 |
-
"execution_count":
|
| 207 |
"metadata": {},
|
| 208 |
"output_type": "execute_result"
|
| 209 |
}
|
|
@@ -2268,19 +2278,20 @@
|
|
| 2268 |
},
|
| 2269 |
{
|
| 2270 |
"cell_type": "code",
|
| 2271 |
-
"execution_count":
|
| 2272 |
"metadata": {},
|
| 2273 |
"outputs": [
|
| 2274 |
{
|
| 2275 |
"data": {
|
| 2276 |
"text/plain": [
|
| 2277 |
"staking\n",
|
| 2278 |
-
"
|
| 2279 |
-
"
|
|
|
|
| 2280 |
"Name: count, dtype: int64"
|
| 2281 |
]
|
| 2282 |
},
|
| 2283 |
-
"execution_count":
|
| 2284 |
"metadata": {},
|
| 2285 |
"output_type": "execute_result"
|
| 2286 |
}
|
|
@@ -2291,46 +2302,66 @@
|
|
| 2291 |
},
|
| 2292 |
{
|
| 2293 |
"cell_type": "code",
|
| 2294 |
-
"execution_count":
|
| 2295 |
"metadata": {},
|
| 2296 |
"outputs": [
|
| 2297 |
{
|
| 2298 |
"data": {
|
| 2299 |
"text/plain": [
|
| 2300 |
-
"
|
| 2301 |
]
|
| 2302 |
},
|
| 2303 |
-
"execution_count":
|
| 2304 |
"metadata": {},
|
| 2305 |
"output_type": "execute_result"
|
| 2306 |
}
|
| 2307 |
],
|
| 2308 |
"source": [
|
| 2309 |
"qs_trades = trades_df.loc[trades_df[\"market_creator\"]==\"quickstart\"]\n",
|
| 2310 |
-
"
|
| 2311 |
-
"len(
|
| 2312 |
]
|
| 2313 |
},
|
| 2314 |
{
|
| 2315 |
"cell_type": "code",
|
| 2316 |
-
"execution_count":
|
| 2317 |
"metadata": {},
|
| 2318 |
"outputs": [
|
| 2319 |
{
|
| 2320 |
"data": {
|
| 2321 |
"text/plain": [
|
| 2322 |
-
"
|
| 2323 |
]
|
| 2324 |
},
|
| 2325 |
-
"execution_count":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2326 |
"metadata": {},
|
| 2327 |
"output_type": "execute_result"
|
| 2328 |
}
|
| 2329 |
],
|
| 2330 |
"source": [
|
| 2331 |
"pearl_trades = trades_df.loc[trades_df[\"market_creator\"]==\"pearl\"]\n",
|
| 2332 |
-
"
|
| 2333 |
-
"
|
| 2334 |
]
|
| 2335 |
},
|
| 2336 |
{
|
|
|
|
| 191 |
},
|
| 192 |
{
|
| 193 |
"cell_type": "code",
|
| 194 |
+
"execution_count": 20,
|
| 195 |
+
"metadata": {},
|
| 196 |
+
"outputs": [],
|
| 197 |
+
"source": [
|
| 198 |
+
"trades_df = pd.read_parquet(\"../data/all_trades_profitability.parquet\")"
|
| 199 |
+
]
|
| 200 |
+
},
|
| 201 |
+
{
|
| 202 |
+
"cell_type": "code",
|
| 203 |
+
"execution_count": 21,
|
| 204 |
"metadata": {},
|
| 205 |
"outputs": [
|
| 206 |
{
|
| 207 |
"data": {
|
| 208 |
"text/plain": [
|
| 209 |
"staking\n",
|
| 210 |
+
"non_agent 736\n",
|
| 211 |
+
"pearl 670\n",
|
| 212 |
+
"non_staking 72\n",
|
| 213 |
"Name: count, dtype: int64"
|
| 214 |
]
|
| 215 |
},
|
| 216 |
+
"execution_count": 21,
|
| 217 |
"metadata": {},
|
| 218 |
"output_type": "execute_result"
|
| 219 |
}
|
|
|
|
| 2278 |
},
|
| 2279 |
{
|
| 2280 |
"cell_type": "code",
|
| 2281 |
+
"execution_count": 23,
|
| 2282 |
"metadata": {},
|
| 2283 |
"outputs": [
|
| 2284 |
{
|
| 2285 |
"data": {
|
| 2286 |
"text/plain": [
|
| 2287 |
"staking\n",
|
| 2288 |
+
"non_agent 736\n",
|
| 2289 |
+
"pearl 670\n",
|
| 2290 |
+
"non_staking 72\n",
|
| 2291 |
"Name: count, dtype: int64"
|
| 2292 |
]
|
| 2293 |
},
|
| 2294 |
+
"execution_count": 23,
|
| 2295 |
"metadata": {},
|
| 2296 |
"output_type": "execute_result"
|
| 2297 |
}
|
|
|
|
| 2302 |
},
|
| 2303 |
{
|
| 2304 |
"cell_type": "code",
|
| 2305 |
+
"execution_count": 22,
|
| 2306 |
"metadata": {},
|
| 2307 |
"outputs": [
|
| 2308 |
{
|
| 2309 |
"data": {
|
| 2310 |
"text/plain": [
|
| 2311 |
+
"19"
|
| 2312 |
]
|
| 2313 |
},
|
| 2314 |
+
"execution_count": 22,
|
| 2315 |
"metadata": {},
|
| 2316 |
"output_type": "execute_result"
|
| 2317 |
}
|
| 2318 |
],
|
| 2319 |
"source": [
|
| 2320 |
"qs_trades = trades_df.loc[trades_df[\"market_creator\"]==\"quickstart\"]\n",
|
| 2321 |
+
"non_agent_qs_trades = qs_trades.loc[qs_trades[\"staking\"]==\"non_agent\"]\n",
|
| 2322 |
+
"len(non_agent_qs_trades.trader_address.unique())"
|
| 2323 |
]
|
| 2324 |
},
|
| 2325 |
{
|
| 2326 |
"cell_type": "code",
|
| 2327 |
+
"execution_count": 25,
|
| 2328 |
"metadata": {},
|
| 2329 |
"outputs": [
|
| 2330 |
{
|
| 2331 |
"data": {
|
| 2332 |
"text/plain": [
|
| 2333 |
+
"585"
|
| 2334 |
]
|
| 2335 |
},
|
| 2336 |
+
"execution_count": 25,
|
| 2337 |
+
"metadata": {},
|
| 2338 |
+
"output_type": "execute_result"
|
| 2339 |
+
}
|
| 2340 |
+
],
|
| 2341 |
+
"source": [
|
| 2342 |
+
"len(non_agent_qs_trades)"
|
| 2343 |
+
]
|
| 2344 |
+
},
|
| 2345 |
+
{
|
| 2346 |
+
"cell_type": "code",
|
| 2347 |
+
"execution_count": 24,
|
| 2348 |
+
"metadata": {},
|
| 2349 |
+
"outputs": [
|
| 2350 |
+
{
|
| 2351 |
+
"data": {
|
| 2352 |
+
"text/plain": [
|
| 2353 |
+
"21"
|
| 2354 |
+
]
|
| 2355 |
+
},
|
| 2356 |
+
"execution_count": 24,
|
| 2357 |
"metadata": {},
|
| 2358 |
"output_type": "execute_result"
|
| 2359 |
}
|
| 2360 |
],
|
| 2361 |
"source": [
|
| 2362 |
"pearl_trades = trades_df.loc[trades_df[\"market_creator\"]==\"pearl\"]\n",
|
| 2363 |
+
"non_agent_pearl_trades = pearl_trades.loc[pearl_trades[\"staking\"]==\"non_agent\"]\n",
|
| 2364 |
+
"len(non_agent_pearl_trades.trader_address.unique())"
|
| 2365 |
]
|
| 2366 |
},
|
| 2367 |
{
|
scripts/profitability.py
CHANGED
|
@@ -32,7 +32,7 @@ from pathlib import Path
|
|
| 32 |
from get_mech_info import DATETIME_60_DAYS_AGO
|
| 33 |
from utils import SUBGRAPH_API_KEY, wei_to_unit, convert_hex_to_int, _to_content
|
| 34 |
from queries import omen_xdai_trades_query, conditional_tokens_gc_user_query
|
| 35 |
-
from
|
| 36 |
|
| 37 |
QUERY_BATCH_SIZE = 1000
|
| 38 |
DUST_THRESHOLD = 10000000000000
|
|
|
|
| 32 |
from get_mech_info import DATETIME_60_DAYS_AGO
|
| 33 |
from utils import SUBGRAPH_API_KEY, wei_to_unit, convert_hex_to_int, _to_content
|
| 34 |
from queries import omen_xdai_trades_query, conditional_tokens_gc_user_query
|
| 35 |
+
from staking import label_trades_by_staking
|
| 36 |
|
| 37 |
QUERY_BATCH_SIZE = 1000
|
| 38 |
DUST_THRESHOLD = 10000000000000
|