rosacastillo commited on
Commit
30c8ea3
·
1 Parent(s): fe04619

new data and staking labeling

Browse files
data/all_trades_profitability.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f0d88dddc2ccfcad5531d596e3b51c20ca74563d3b431da117878c1d73ea6d01
3
- size 411266
 
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:4e57c32b028ed9b3f4c0014ce90b6f77117411dcf4c592815bf748ffddbf9717
3
- size 1348456
 
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:46926f13d043d507345a9ff2347c4724cd947d297b50bca09d849315fb6bc67e
3
- size 444159
 
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:dafc20c50d26be24bf7ce3c5937ebbe525d0a190f2771985e95c815718923739
3
- size 53461
 
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:51fd4bea9e2c7e8a3c87ca9ba9adefafe537ab43904a33c3d04b79c102ef446b
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:f0a0b8258b8a46f5e53a1decfda25f670f3fdec4e2d21d1e1ed856d6d4400ef9
3
- size 72607
 
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:faa3804873a746265985b8bd74e36371a59772533ea74c56e6a28d2c3f712ea3
3
- size 37651
 
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:18e0905077b4d7969d04360c2b3140166e68d10d5647ffd58adaa6313f0e3a44
3
- size 18149038
 
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:c04883dfbdff1969db7d1920a7118c894c9b111e280d6da7e673420e3090546f
3
- size 332731570
 
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:73922c739057bc29ed78e540e75a74f9d6991c199b158cea7d870ead3d225cca
3
- size 1009
 
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": 5,
 
 
 
 
 
 
 
 
 
195
  "metadata": {},
196
  "outputs": [
197
  {
198
  "data": {
199
  "text/plain": [
200
  "staking\n",
201
- " 808\n",
202
- "pearl 670\n",
 
203
  "Name: count, dtype: int64"
204
  ]
205
  },
206
- "execution_count": 5,
207
  "metadata": {},
208
  "output_type": "execute_result"
209
  }
@@ -2268,19 +2278,20 @@
2268
  },
2269
  {
2270
  "cell_type": "code",
2271
- "execution_count": 7,
2272
  "metadata": {},
2273
  "outputs": [
2274
  {
2275
  "data": {
2276
  "text/plain": [
2277
  "staking\n",
2278
- "non_staking 808\n",
2279
- "staking 670\n",
 
2280
  "Name: count, dtype: int64"
2281
  ]
2282
  },
2283
- "execution_count": 7,
2284
  "metadata": {},
2285
  "output_type": "execute_result"
2286
  }
@@ -2291,46 +2302,66 @@
2291
  },
2292
  {
2293
  "cell_type": "code",
2294
- "execution_count": 19,
2295
  "metadata": {},
2296
  "outputs": [
2297
  {
2298
  "data": {
2299
  "text/plain": [
2300
- "109"
2301
  ]
2302
  },
2303
- "execution_count": 19,
2304
  "metadata": {},
2305
  "output_type": "execute_result"
2306
  }
2307
  ],
2308
  "source": [
2309
  "qs_trades = trades_df.loc[trades_df[\"market_creator\"]==\"quickstart\"]\n",
2310
- "non_staking_qs_trades = qs_trades.loc[qs_trades[\"staking\"]==\"non_staking\"]\n",
2311
- "len(qs_trades.trader_address.unique())"
2312
  ]
2313
  },
2314
  {
2315
  "cell_type": "code",
2316
- "execution_count": 11,
2317
  "metadata": {},
2318
  "outputs": [
2319
  {
2320
  "data": {
2321
  "text/plain": [
2322
- "'0x034c4ad84f7ac6638bf19300d5bbe7d9b981e736'"
2323
  ]
2324
  },
2325
- "execution_count": 11,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2326
  "metadata": {},
2327
  "output_type": "execute_result"
2328
  }
2329
  ],
2330
  "source": [
2331
  "pearl_trades = trades_df.loc[trades_df[\"market_creator\"]==\"pearl\"]\n",
2332
- "non_staking_pearl_trades = pearl_trades.loc[pearl_trades[\"staking\"]==\"non_staking\"]\n",
2333
- "non_staking_pearl_trades.trader_address.values[0].lower()"
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 scripts.staking import label_trades_by_staking
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