{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "all_trades = pd.read_parquet('../data/all_trades_profitability.parquet')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['trader_address', 'market_creator', 'trade_id', 'creation_timestamp',\n", " 'title', 'market_status', 'collateral_amount', 'outcome_index',\n", " 'trade_fee_amount', 'outcomes_tokens_traded', 'current_answer',\n", " 'is_invalid', 'winning_trade', 'earnings', 'redeemed',\n", " 'redeemed_amount', 'num_mech_calls', 'mech_fee_amount', 'net_earnings',\n", " 'roi', 'staking'],\n", " dtype='object')" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "all_trades.columns" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
trader_addressmarket_creatortrade_idcreation_timestamptitlemarket_statuscollateral_amountoutcome_indextrade_fee_amountoutcomes_tokens_traded...winning_tradeearningsredeemedredeemed_amountnum_mech_callsmech_fee_amountnet_earningsroistakingnr_mech_calls
00x01274796ce41aa8e8312e05a427ffb4b0d2148f6quickstart0x007068173910cf8719b6f2e66a18b6825c9dde820x01...2024-10-10 21:43:25+00:00Will the emergency public warning tests planne...CLOSED0.93059700.0093061.574258...True1.574258True1.57425810.010.6243560.657284non_stakingNaN
10x01274796ce41aa8e8312e05a427ffb4b0d2148f6quickstart0x00d659d7749fda4f1c9402182ca5d7ce26cf5cd10x01...2024-10-18 00:36:50+00:00Will the Northern Lights be visible over UK sk...CLOSED1.37560310.0137561.942215...False0.000000False0.00000010.01-1.399359-1.000000non_stakingNaN
20x01274796ce41aa8e8312e05a427ffb4b0d2148f6quickstart0x02ccdf04646d9a55332e67a73e4ffdab2368d05f0x01...2024-10-23 22:37:35+00:00Will any Republican lawmakers introduce legisl...CLOSED0.47169510.0047170.784784...True0.784784True0.78478410.010.2983720.613414non_stakingNaN
30x01274796ce41aa8e8312e05a427ffb4b0d2148f6quickstart0x09f47ce8995abf1d5b91f2cbfa940ede2fb954c30x01...2024-10-20 23:58:35+00:00Will any new major AI-driven fraud detection t...CLOSED0.28904610.0028900.445590...False0.000000False0.00000050.05-0.341936-1.000000non_stakingNaN
40x01274796ce41aa8e8312e05a427ffb4b0d2148f6quickstart0x0c86942c52740316bbdb70303c5aaee40876d8ce0x01...2024-10-24 22:42:00+00:00Will any new norovirus vaccine trial sites be ...CLOSED0.28655210.0028660.470457...True0.470457True0.47045710.010.1710400.571242non_stakingNaN
\n", "

5 rows × 22 columns

\n", "
" ], "text/plain": [ " trader_address market_creator \\\n", "0 0x01274796ce41aa8e8312e05a427ffb4b0d2148f6 quickstart \n", "1 0x01274796ce41aa8e8312e05a427ffb4b0d2148f6 quickstart \n", "2 0x01274796ce41aa8e8312e05a427ffb4b0d2148f6 quickstart \n", "3 0x01274796ce41aa8e8312e05a427ffb4b0d2148f6 quickstart \n", "4 0x01274796ce41aa8e8312e05a427ffb4b0d2148f6 quickstart \n", "\n", " trade_id \\\n", "0 0x007068173910cf8719b6f2e66a18b6825c9dde820x01... \n", "1 0x00d659d7749fda4f1c9402182ca5d7ce26cf5cd10x01... \n", "2 0x02ccdf04646d9a55332e67a73e4ffdab2368d05f0x01... \n", "3 0x09f47ce8995abf1d5b91f2cbfa940ede2fb954c30x01... \n", "4 0x0c86942c52740316bbdb70303c5aaee40876d8ce0x01... \n", "\n", " creation_timestamp \\\n", "0 2024-10-10 21:43:25+00:00 \n", "1 2024-10-18 00:36:50+00:00 \n", "2 2024-10-23 22:37:35+00:00 \n", "3 2024-10-20 23:58:35+00:00 \n", "4 2024-10-24 22:42:00+00:00 \n", "\n", " title market_status \\\n", "0 Will the emergency public warning tests planne... CLOSED \n", "1 Will the Northern Lights be visible over UK sk... CLOSED \n", "2 Will any Republican lawmakers introduce legisl... CLOSED \n", "3 Will any new major AI-driven fraud detection t... CLOSED \n", "4 Will any new norovirus vaccine trial sites be ... CLOSED \n", "\n", " collateral_amount outcome_index trade_fee_amount outcomes_tokens_traded \\\n", "0 0.930597 0 0.009306 1.574258 \n", "1 1.375603 1 0.013756 1.942215 \n", "2 0.471695 1 0.004717 0.784784 \n", "3 0.289046 1 0.002890 0.445590 \n", "4 0.286552 1 0.002866 0.470457 \n", "\n", " ... winning_trade earnings redeemed redeemed_amount num_mech_calls \\\n", "0 ... True 1.574258 True 1.574258 1 \n", "1 ... False 0.000000 False 0.000000 1 \n", "2 ... True 0.784784 True 0.784784 1 \n", "3 ... False 0.000000 False 0.000000 5 \n", "4 ... True 0.470457 True 0.470457 1 \n", "\n", " mech_fee_amount net_earnings roi staking nr_mech_calls \n", "0 0.01 0.624356 0.657284 non_staking NaN \n", "1 0.01 -1.399359 -1.000000 non_staking NaN \n", "2 0.01 0.298372 0.613414 non_staking NaN \n", "3 0.05 -0.341936 -1.000000 non_staking NaN \n", "4 0.01 0.171040 0.571242 non_staking NaN \n", "\n", "[5 rows x 22 columns]" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "all_trades.head()" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "pandas.core.series.Series" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type(all_trades.creation_timestamp)" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "pandas._libs.tslibs.timestamps.Timestamp" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type(all_trades.creation_timestamp.iloc[0])" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/var/folders/gp/02mb1d514ng739czlxw1lhh00000gn/T/ipykernel_69783/1320555996.py:2: UserWarning: Converting to PeriodArray/Index representation will drop timezone information.\n", " all_trades[\"creation_timestamp\"].dt.to_period(\"W\").dt.strftime(\"%b-%d\")\n" ] } ], "source": [ "all_trades[\"month_year_week\"] = (\n", " all_trades[\"creation_timestamp\"].dt.to_period(\"W\").dt.strftime(\"%b-%d\")\n", ")" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/var/folders/gp/02mb1d514ng739czlxw1lhh00000gn/T/ipykernel_69783/353897105.py:2: UserWarning: Converting to PeriodArray/Index representation will drop timezone information.\n", " all_trades[\"creation_timestamp\"].dt.to_period(\"W\")\n" ] } ], "source": [ "all_trades[\"month_year_week\"] = (\n", " all_trades[\"creation_timestamp\"].dt.to_period(\"W\")\n", ")" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "pandas._libs.tslibs.period.Period" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type(all_trades.month_year_week.iloc[0])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Period('2024-10-07/2024-10-13', 'W-SUN')" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "all_trades.month_year_week.iloc[0]" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "pandas._libs.tslibs.timestamps.Timestamp" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type(all_trades.iloc[0].creation_timestamp)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Timestamp('2024-11-27 01:45:05+0000', tz='UTC')" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "max(all_trades.creation_timestamp)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Timestamp('2024-09-29 00:02:45+0000', tz='UTC')" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "min(all_trades.creation_timestamp)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "new_trades = pd.read_parquet('../data/new_fpmmTrades.parquet')" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 3798 entries, 0 to 3797\n", "Data columns (total 24 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 collateralAmount 3798 non-null object\n", " 1 collateralAmountUSD 3798 non-null object\n", " 2 collateralToken 3798 non-null object\n", " 3 creationTimestamp 3798 non-null object\n", " 4 trader_address 3798 non-null object\n", " 5 feeAmount 3798 non-null object\n", " 6 id 3798 non-null object\n", " 7 oldOutcomeTokenMarginalPrice 3798 non-null object\n", " 8 outcomeIndex 3798 non-null object\n", " 9 outcomeTokenMarginalPrice 3798 non-null object\n", " 10 outcomeTokensTraded 3798 non-null object\n", " 11 title 3798 non-null object\n", " 12 transactionHash 3798 non-null object\n", " 13 type 3798 non-null object\n", " 14 market_creator 3798 non-null object\n", " 15 fpmm.answerFinalizedTimestamp 0 non-null object\n", " 16 fpmm.arbitrationOccurred 3798 non-null bool \n", " 17 fpmm.currentAnswer 0 non-null object\n", " 18 fpmm.id 3798 non-null object\n", " 19 fpmm.isPendingArbitration 3798 non-null bool \n", " 20 fpmm.openingTimestamp 3798 non-null object\n", " 21 fpmm.outcomes 3798 non-null object\n", " 22 fpmm.title 3798 non-null object\n", " 23 fpmm.condition.id 3798 non-null object\n", "dtypes: bool(2), object(22)\n", "memory usage: 660.3+ KB\n" ] } ], "source": [ "new_trades.info()" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3798" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(new_trades.id.unique())" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['collateralAmount', 'collateralAmountUSD', 'collateralToken',\n", " 'creationTimestamp', 'trader_address', 'feeAmount', 'id',\n", " 'oldOutcomeTokenMarginalPrice', 'outcomeIndex',\n", " 'outcomeTokenMarginalPrice', 'outcomeTokensTraded', 'title',\n", " 'transactionHash', 'type', 'market_creator',\n", " 'fpmm.answerFinalizedTimestamp', 'fpmm.arbitrationOccurred',\n", " 'fpmm.currentAnswer', 'fpmm.id', 'fpmm.isPendingArbitration',\n", " 'fpmm.openingTimestamp', 'fpmm.outcomes', 'fpmm.title',\n", " 'fpmm.condition.id'],\n", " dtype='object')" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "new_trades.columns" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'1732609530'" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "max(new_trades.creationTimestamp)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "old_trades = pd.read_parquet('../data/fpmmTrades.parquet')" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'1732609530'" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "max(old_trades.creationTimestamp)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "all_trades_before = pd.read_parquet('../data/daily_info.parquet')" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 7104 entries, 0 to 7103\n", "Data columns (total 21 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 trader_address 7104 non-null object \n", " 1 market_creator 7104 non-null object \n", " 2 trade_id 7104 non-null object \n", " 3 creation_timestamp 7104 non-null datetime64[ns, UTC]\n", " 4 title 7104 non-null object \n", " 5 market_status 7104 non-null object \n", " 6 collateral_amount 7104 non-null float64 \n", " 7 outcome_index 7104 non-null object \n", " 8 trade_fee_amount 7104 non-null float64 \n", " 9 outcomes_tokens_traded 7104 non-null float64 \n", " 10 current_answer 0 non-null object \n", " 11 is_invalid 7104 non-null bool \n", " 12 winning_trade 0 non-null object \n", " 13 earnings 7104 non-null float64 \n", " 14 redeemed 7104 non-null bool \n", " 15 redeemed_amount 7104 non-null float64 \n", " 16 num_mech_calls 7104 non-null int64 \n", " 17 mech_fee_amount 7104 non-null float64 \n", " 18 net_earnings 7104 non-null float64 \n", " 19 roi 7104 non-null float64 \n", " 20 staking 7104 non-null object \n", "dtypes: bool(2), datetime64[ns, UTC](1), float64(8), int64(1), object(9)\n", "memory usage: 1.0+ MB\n" ] } ], "source": [ "all_trades_before.info()" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['trader_address', 'market_creator', 'trade_id', 'creation_timestamp',\n", " 'title', 'market_status', 'collateral_amount', 'outcome_index',\n", " 'trade_fee_amount', 'outcomes_tokens_traded', 'current_answer',\n", " 'is_invalid', 'winning_trade', 'earnings', 'redeemed',\n", " 'redeemed_amount', 'num_mech_calls', 'mech_fee_amount', 'net_earnings',\n", " 'roi', 'staking'],\n", " dtype='object')" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "all_trades_before.columns" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Timestamp('2025-01-07 09:01:05+0000', tz='UTC')" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "min(all_trades_before.creation_timestamp)" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "staking\n", "non_agent 6140\n", "quickstart 1920\n", "non_staking 1024\n", "pearl 602\n", "Name: count, dtype: int64" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "all_trades_before.staking.value_counts()" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "count 9686.0\n", "mean 0.0\n", "std 0.0\n", "min 0.0\n", "25% 0.0\n", "50% 0.0\n", "75% 0.0\n", "max 0.0\n", "Name: num_mech_calls, dtype: float64" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "all_trades_before.num_mech_calls.describe()" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
trader_addressmarket_creatortrade_idcreation_timestamptitlemarket_statuscollateral_amountoutcome_indextrade_fee_amountoutcomes_tokens_traded...is_invalidwinning_tradeearningsredeemedredeemed_amountnum_mech_callsmech_fee_amountnet_earningsroistaking
87780x047f8663b254d90d28af6d8ca7181947e94577cepearl0x2379c39b63aa1a3e37d4a7e4b909a699b4c14a810x04...2024-11-30 16:57:40+00:00Will the IAEA issue a formal statement regardi...OPEN0.02500.000250.047923...FalseNone0.0False000.0-0.02525-1.0pearl
87790x047f8663b254d90d28af6d8ca7181947e94577cepearl0xbb96f5a99bf452aa202fea0b36b0910734377d450x04...2024-11-30 16:45:25+00:00Will the IAEA confirm Iran has started feeding...OPEN0.02500.000250.049461...FalseNone0.0False000.0-0.02525-1.0pearl
87800x047f8663b254d90d28af6d8ca7181947e94577cepearl0xcd34c44c5f944bcf05f958e5d25960f8fcda664b0x04...2024-12-01 18:38:40+00:00Will Iran install more than 6,000 new centrifu...OPEN0.02510.000250.046737...FalseNone0.0False000.0-0.02525-1.0pearl
87810x047f8663b254d90d28af6d8ca7181947e94577cepearl0xff1d1569a94ebad89612213f083a3cb948415f740x04...2024-11-30 17:00:30+00:00Will Rivian's stock price increase by at least...OPEN0.02500.000250.047316...FalseNone0.0False000.0-0.02525-1.0pearl
87820x06d873e7465a6680f5487905d7b5daf7f2c6e299pearl0x2379c39b63aa1a3e37d4a7e4b909a699b4c14a810x06...2024-12-02 17:07:05+00:00Will the IAEA issue a formal statement regardi...OPEN0.02500.000250.043896...FalseNone0.0False000.0-0.02525-1.0pearl
\n", "

5 rows × 21 columns

\n", "
" ], "text/plain": [ " trader_address market_creator \\\n", "8778 0x047f8663b254d90d28af6d8ca7181947e94577ce pearl \n", "8779 0x047f8663b254d90d28af6d8ca7181947e94577ce pearl \n", "8780 0x047f8663b254d90d28af6d8ca7181947e94577ce pearl \n", "8781 0x047f8663b254d90d28af6d8ca7181947e94577ce pearl \n", "8782 0x06d873e7465a6680f5487905d7b5daf7f2c6e299 pearl \n", "\n", " trade_id \\\n", "8778 0x2379c39b63aa1a3e37d4a7e4b909a699b4c14a810x04... \n", "8779 0xbb96f5a99bf452aa202fea0b36b0910734377d450x04... \n", "8780 0xcd34c44c5f944bcf05f958e5d25960f8fcda664b0x04... \n", "8781 0xff1d1569a94ebad89612213f083a3cb948415f740x04... \n", "8782 0x2379c39b63aa1a3e37d4a7e4b909a699b4c14a810x06... \n", "\n", " creation_timestamp \\\n", "8778 2024-11-30 16:57:40+00:00 \n", "8779 2024-11-30 16:45:25+00:00 \n", "8780 2024-12-01 18:38:40+00:00 \n", "8781 2024-11-30 17:00:30+00:00 \n", "8782 2024-12-02 17:07:05+00:00 \n", "\n", " title market_status \\\n", "8778 Will the IAEA issue a formal statement regardi... OPEN \n", "8779 Will the IAEA confirm Iran has started feeding... OPEN \n", "8780 Will Iran install more than 6,000 new centrifu... OPEN \n", "8781 Will Rivian's stock price increase by at least... OPEN \n", "8782 Will the IAEA issue a formal statement regardi... OPEN \n", "\n", " collateral_amount outcome_index trade_fee_amount \\\n", "8778 0.025 0 0.00025 \n", "8779 0.025 0 0.00025 \n", "8780 0.025 1 0.00025 \n", "8781 0.025 0 0.00025 \n", "8782 0.025 0 0.00025 \n", "\n", " outcomes_tokens_traded ... is_invalid winning_trade earnings \\\n", "8778 0.047923 ... False None 0.0 \n", "8779 0.049461 ... False None 0.0 \n", "8780 0.046737 ... False None 0.0 \n", "8781 0.047316 ... False None 0.0 \n", "8782 0.043896 ... False None 0.0 \n", "\n", " redeemed redeemed_amount num_mech_calls mech_fee_amount \\\n", "8778 False 0 0 0.0 \n", "8779 False 0 0 0.0 \n", "8780 False 0 0 0.0 \n", "8781 False 0 0 0.0 \n", "8782 False 0 0 0.0 \n", "\n", " net_earnings roi staking \n", "8778 -0.02525 -1.0 pearl \n", "8779 -0.02525 -1.0 pearl \n", "8780 -0.02525 -1.0 pearl \n", "8781 -0.02525 -1.0 pearl \n", "8782 -0.02525 -1.0 pearl \n", "\n", "[5 rows x 21 columns]" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "all_trades_before.loc[all_trades_before[\"staking\"]==\"pearl\"].head()" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
trader_addressmarket_creatortrade_idcreation_timestamptitlemarket_statuscollateral_amountoutcome_indextrade_fee_amountoutcomes_tokens_traded...is_invalidwinning_tradeearningsredeemedredeemed_amountnum_mech_callsmech_fee_amountnet_earningsroistaking
00x027592700fafc4db3221bb662d7bdc7f546a2bb5quickstart0x08ee7c048ea0b7e3c967a455cf7da5e38abdbaff0x02...2024-11-28 16:56:25+00:00Will any major legal precedent regarding influ...OPEN0.31892610.0031890.642313...FalseNone0.0False000.0-0.322116-1.0non_agent
10x027592700fafc4db3221bb662d7bdc7f546a2bb5quickstart0x08ee7c048ea0b7e3c967a455cf7da5e38abdbaff0x02...2024-11-30 15:00:10+00:00Will any major legal precedent regarding influ...OPEN0.10605700.0010610.244680...FalseNone0.0False000.0-0.107117-1.0non_agent
20x027592700fafc4db3221bb662d7bdc7f546a2bb5quickstart0x1bdd848ae9044375c11b6ab5eddd2e4f9ff0f0aa0x02...2024-12-01 23:09:55+00:00Will any Democratic senator publicly call for ...OPEN0.15250100.0015250.304904...FalseNone0.0False000.0-0.154026-1.0non_agent
30x027592700fafc4db3221bb662d7bdc7f546a2bb5quickstart0x25408c25b8681e994e2e12c6754ddf446124cce90x02...2024-11-30 13:54:45+00:00Will any major Linux distribution announce a s...OPEN0.24530600.0024530.507058...FalseNone0.0False000.0-0.247759-1.0non_agent
40x027592700fafc4db3221bb662d7bdc7f546a2bb5quickstart0x2b5f1a0eef4c846bfddc4ae88bd1a6d02a9e703d0x02...2024-11-30 13:39:40+00:00Will any cybersecurity firm release a detailed...OPEN0.27756600.0027760.520043...FalseNone0.0False000.0-0.280342-1.0non_agent
\n", "

5 rows × 21 columns

\n", "
" ], "text/plain": [ " trader_address market_creator \\\n", "0 0x027592700fafc4db3221bb662d7bdc7f546a2bb5 quickstart \n", "1 0x027592700fafc4db3221bb662d7bdc7f546a2bb5 quickstart \n", "2 0x027592700fafc4db3221bb662d7bdc7f546a2bb5 quickstart \n", "3 0x027592700fafc4db3221bb662d7bdc7f546a2bb5 quickstart \n", "4 0x027592700fafc4db3221bb662d7bdc7f546a2bb5 quickstart \n", "\n", " trade_id \\\n", "0 0x08ee7c048ea0b7e3c967a455cf7da5e38abdbaff0x02... \n", "1 0x08ee7c048ea0b7e3c967a455cf7da5e38abdbaff0x02... \n", "2 0x1bdd848ae9044375c11b6ab5eddd2e4f9ff0f0aa0x02... \n", "3 0x25408c25b8681e994e2e12c6754ddf446124cce90x02... \n", "4 0x2b5f1a0eef4c846bfddc4ae88bd1a6d02a9e703d0x02... \n", "\n", " creation_timestamp \\\n", "0 2024-11-28 16:56:25+00:00 \n", "1 2024-11-30 15:00:10+00:00 \n", "2 2024-12-01 23:09:55+00:00 \n", "3 2024-11-30 13:54:45+00:00 \n", "4 2024-11-30 13:39:40+00:00 \n", "\n", " title market_status \\\n", "0 Will any major legal precedent regarding influ... OPEN \n", "1 Will any major legal precedent regarding influ... OPEN \n", "2 Will any Democratic senator publicly call for ... OPEN \n", "3 Will any major Linux distribution announce a s... OPEN \n", "4 Will any cybersecurity firm release a detailed... OPEN \n", "\n", " collateral_amount outcome_index trade_fee_amount outcomes_tokens_traded \\\n", "0 0.318926 1 0.003189 0.642313 \n", "1 0.106057 0 0.001061 0.244680 \n", "2 0.152501 0 0.001525 0.304904 \n", "3 0.245306 0 0.002453 0.507058 \n", "4 0.277566 0 0.002776 0.520043 \n", "\n", " ... is_invalid winning_trade earnings redeemed redeemed_amount \\\n", "0 ... False None 0.0 False 0 \n", "1 ... False None 0.0 False 0 \n", "2 ... False None 0.0 False 0 \n", "3 ... False None 0.0 False 0 \n", "4 ... False None 0.0 False 0 \n", "\n", " num_mech_calls mech_fee_amount net_earnings roi staking \n", "0 0 0.0 -0.322116 -1.0 non_agent \n", "1 0 0.0 -0.107117 -1.0 non_agent \n", "2 0 0.0 -0.154026 -1.0 non_agent \n", "3 0 0.0 -0.247759 -1.0 non_agent \n", "4 0 0.0 -0.280342 -1.0 non_agent \n", "\n", "[5 rows x 21 columns]" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "all_trades_before.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "all_trades_df = pd.read_parquet('../json_data/all_trades_df.parquet')" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['trader_address', 'market_creator', 'trade_id', 'creation_timestamp',\n", " 'title', 'market_status', 'collateral_amount', 'outcome_index',\n", " 'trade_fee_amount', 'outcomes_tokens_traded', 'current_answer',\n", " 'is_invalid', 'winning_trade', 'earnings', 'redeemed',\n", " 'redeemed_amount', 'num_mech_calls', 'mech_fee_amount', 'net_earnings',\n", " 'roi', 'staking', 'nr_mech_calls'],\n", " dtype='object')" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "all_trades_df.columns" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Timestamp('2024-11-23 01:38:25+0000', tz='UTC')" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "max(all_trades_df.creation_timestamp)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "hf_dashboards", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.2" } }, "nbformat": 4, "nbformat_minor": 2 }