{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "import json\n", "sns.set_style(\"darkgrid\")" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "tools = pd.read_parquet('../data/tools.parquet')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Timestamp('2024-12-10 07:50:55+0000', tz='UTC')" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "max(tools.request_time)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Timestamp('2024-10-13 00:00:30+0000', tz='UTC')" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "min(tools.request_time)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 358454 entries, 0 to 358453\n", "Data columns (total 23 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 request_id 358454 non-null object \n", " 1 request_block 358454 non-null object \n", " 2 prompt_request 358454 non-null object \n", " 3 tool 358454 non-null object \n", " 4 nonce 358454 non-null object \n", " 5 trader_address 358454 non-null object \n", " 6 deliver_block 358454 non-null object \n", " 7 error 358454 non-null int64 \n", " 8 error_message 3772 non-null object \n", " 9 prompt_response 357509 non-null object \n", " 10 mech_address 357601 non-null object \n", " 11 p_yes 354682 non-null float64\n", " 12 p_no 354682 non-null float64\n", " 13 confidence 354682 non-null float64\n", " 14 info_utility 354682 non-null float64\n", " 15 vote 261707 non-null object \n", " 16 win_probability 354682 non-null float64\n", " 17 market_creator 358454 non-null object \n", " 18 title 358454 non-null object \n", " 19 currentAnswer 287126 non-null object \n", " 20 request_time 358454 non-null object \n", " 21 request_month_year 358454 non-null object \n", " 22 request_month_year_week 358454 non-null object \n", "dtypes: float64(5), int64(1), object(17)\n", "memory usage: 62.9+ MB\n" ] } ], "source": [ "tools.info()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['request_id', 'request_block', 'prompt_request', 'tool', 'nonce',\n", " 'trader_address', 'deliver_block', 'error', 'error_message',\n", " 'prompt_response', 'mech_address', 'p_yes', 'p_no', 'confidence',\n", " 'info_utility', 'vote', 'win_probability', 'market_creator', 'title',\n", " 'currentAnswer', 'request_time', 'request_month_year',\n", " 'request_month_year_week'],\n", " dtype='object')" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tools.columns" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "str" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type(tools.iloc[0].request_time)" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "dict" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pickle\n", "t_map = pickle.load(open(\"../data/t_map.pkl\", \"rb\"))\n", "type(t_map)" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "475329" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(t_map)" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "29624577\n" ] } ], "source": [ "for item in t_map:\n", " print(item)\n", " break" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'2023-07-12 11:58:40'" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "min(t_map.values())" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'2023-08-24 16:04:50'" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t_map[29624577]" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'2024-09-04 07:32:15'" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "max(t_map.values())" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "request_id 1155886186807766696223563218518399229072982679...\n", "request_block 35356121\n", "prompt_request Please take over the role of a Data Scientist ...\n", "tool prediction-request-rag-claude\n", "nonce 2c4c8c5c-afcf-4e28-a09a-aa2bae3f5444\n", "trader_address 0x22335c348afa4eae4cc6d2158c1ac259aaaecdfe\n", "deliver_block 35356134\n", "error 0\n", "error_message None\n", "prompt_response \\nYou will be evaluating the likelihood of an ...\n", "mech_address 0x5e1d1eb61e1164d5a50b28c575da73a29595dff7\n", "p_yes 0.6\n", "p_no 0.4\n", "confidence 0.7\n", "info_utility 0.7\n", "vote Yes\n", "win_probability 0.6\n", "title Will there be an increase in the wasp populati...\n", "currentAnswer Yes\n", "Name: 0, dtype: object" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tools.iloc[0]" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "vote\n", "Yes 55881\n", "No 51741\n", "Name: count, dtype: int64" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tools.vote.value_counts()" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 132150 entries, 0 to 132149\n", "Data columns (total 22 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 request_id 132150 non-null object \n", " 1 request_block 132150 non-null int64 \n", " 2 prompt_request 132150 non-null object \n", " 3 tool 132150 non-null object \n", " 4 nonce 132150 non-null object \n", " 5 trader_address 132150 non-null object \n", " 6 deliver_block 132150 non-null int64 \n", " 7 error 132149 non-null float64\n", " 8 error_message 9702 non-null object \n", " 9 prompt_response 132060 non-null object \n", " 10 mech_address 132150 non-null object \n", " 11 p_yes 122447 non-null float64\n", " 12 p_no 122447 non-null float64\n", " 13 confidence 122447 non-null float64\n", " 14 info_utility 122447 non-null float64\n", " 15 vote 102396 non-null object \n", " 16 win_probability 122447 non-null float64\n", " 17 title 124256 non-null object \n", " 18 currentAnswer 85763 non-null object \n", " 19 request_time 132150 non-null object \n", " 20 request_month_year 132150 non-null object \n", " 21 request_month_year_week 132150 non-null object \n", "dtypes: float64(6), int64(2), object(14)\n", "memory usage: 22.2+ MB\n" ] } ], "source": [ "tools.info()" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [], "source": [ "fpmms = pd.read_parquet('../data/fpmms.parquet')" ] }, { "cell_type": "code", "execution_count": 6, "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", "
currentAnsweridtitle
0No0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5Will the first floating offshore wind research...
1No0x0020d13c89140b47e10db54cbd53852b90bc1391Will the Francis Scott Key Bridge in Baltimore...
2No0x003ae5e007cc38b3f86b0ed7c82f938a1285ac07Will FC Saarbrucken reach the final of the Ger...
3Yes0x004c8d4c619dc6b9caa940f5ea7ef699ae85359cWill the pro-life activists convicted for 'con...
4Yes0x005e3f7a90585acbec807425a750fbba1d0c2b5cWill Apple announce the release of a new M4 ch...
\n", "
" ], "text/plain": [ " currentAnswer id \\\n", "0 No 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5 \n", "1 No 0x0020d13c89140b47e10db54cbd53852b90bc1391 \n", "2 No 0x003ae5e007cc38b3f86b0ed7c82f938a1285ac07 \n", "3 Yes 0x004c8d4c619dc6b9caa940f5ea7ef699ae85359c \n", "4 Yes 0x005e3f7a90585acbec807425a750fbba1d0c2b5c \n", "\n", " title \n", "0 Will the first floating offshore wind research... \n", "1 Will the Francis Scott Key Bridge in Baltimore... \n", "2 Will FC Saarbrucken reach the final of the Ger... \n", "3 Will the pro-life activists convicted for 'con... \n", "4 Will Apple announce the release of a new M4 ch... " ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fpmms.head()" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "4251" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(fpmms)" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 18035 entries, 0 to 18034\n", "Data columns (total 20 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 trader_address 18035 non-null object \n", " 1 market_creator 18035 non-null object \n", " 2 trade_id 18035 non-null object \n", " 3 creation_timestamp 18035 non-null datetime64[ns, UTC]\n", " 4 title 18035 non-null object \n", " 5 market_status 18035 non-null object \n", " 6 collateral_amount 18035 non-null float64 \n", " 7 outcome_index 18035 non-null object \n", " 8 trade_fee_amount 18035 non-null float64 \n", " 9 outcomes_tokens_traded 18035 non-null float64 \n", " 10 current_answer 18035 non-null int64 \n", " 11 is_invalid 18035 non-null bool \n", " 12 winning_trade 18035 non-null bool \n", " 13 earnings 18035 non-null float64 \n", " 14 redeemed 18035 non-null bool \n", " 15 redeemed_amount 18035 non-null float64 \n", " 16 num_mech_calls 18035 non-null int64 \n", " 17 mech_fee_amount 18035 non-null float64 \n", " 18 net_earnings 18035 non-null float64 \n", " 19 roi 18035 non-null float64 \n", "dtypes: bool(3), datetime64[ns, UTC](1), float64(8), int64(2), object(6)\n", "memory usage: 2.4+ MB\n" ] } ], "source": [ "prof = pd.read_parquet('../data/all_trades_profitability.parquet')\n", "prof.info()" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "market_creator\n", "quickstart 16775\n", "pearl 1260\n", "Name: count, dtype: int64" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "prof.market_creator.value_counts()" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "trades = pd.read_parquet(\"../data/fpmmTrades.parquet\")" ] }, { "cell_type": "code", "execution_count": 22, "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", "
request_idrequest_blockprompt_requesttoolnoncetrader_addressdeliver_blockerrorerror_messageprompt_responsemech_addressp_yesp_noconfidenceinfo_utilityvotewin_probability
\n", "
" ], "text/plain": [ "Empty DataFrame\n", "Columns: [request_id, request_block, prompt_request, tool, nonce, trader_address, deliver_block, error, error_message, prompt_response, mech_address, p_yes, p_no, confidence, info_utility, vote, win_probability]\n", "Index: []" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tools.head()" ] }, { "cell_type": "code", "execution_count": 13, "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", "
collateralAmountcollateralAmountUSDcollateralTokencreationTimestamptrader_addressfeeAmountidoldOutcomeTokenMarginalPriceoutcomeIndexoutcomeTokenMarginalPrice...market_creatorfpmm.answerFinalizedTimestampfpmm.arbitrationOccurredfpmm.currentAnswerfpmm.idfpmm.isPendingArbitrationfpmm.openingTimestampfpmm.outcomesfpmm.titlefpmm.condition.id
04504264746507386880.45042696940341457163080730941680060xe91d153e0b41518a2ce8dd3d7944fa863463a97d17245534550x022b36c50b85b8ae7addfb8a35d76c59d581483490085294930147730x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x02...0.59278521060961027063412533557212910.6171295391012242250994586583534301...quickstart1725071760False0x00000000000000000000000000000000000000000000...0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5False1724976000[Yes, No]Will the first floating offshore wind research...0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1...
16101632145469414000.61016362322151501356540073370152980xe91d153e0b41518a2ce8dd3d7944fa863463a97d17248119400x034c4ad84f7ac6638bf19300d5bbe7d9b981e736122032642909388280x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x03...0.84299263652375506193482212939481210.8523396372892128845826889719620915...quickstart1725071760False0x00000000000000000000000000000000000000000000...0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5False1724976000[Yes, No]Will the first floating offshore wind research...0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1...
27890650923324606720.78906441205273240719087938227960860xe91d153e0b41518a2ce8dd3d7944fa863463a97d17248157550x09e9d42a029e8b0c2df3871709a762117a681d92157813018466492130x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x09...0.798377574371244289110459877033902810.8152123711444691659642000374025623...quickstart1725071760False0x00000000000000000000000000000000000000000000...0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5False1724976000[Yes, No]Will the first floating offshore wind research...0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1...
310000000000000000001.0000006053836603290484917949391260xe91d153e0b41518a2ce8dd3d7944fa863463a97d17245466200x09e9d42a029e8b0c2df3871709a762117a681d92200000000000000000x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x09...0.511074590773343880544707225262270810.5746805204222762335911904727318937...quickstart1725071760False0x00000000000000000000000000000000000000000000...0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5False1724976000[Yes, No]Will the first floating offshore wind research...0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1...
41000000000000000000.10000042712628624195473946465679060xe91d153e0b41518a2ce8dd3d7944fa863463a97d17247712600x0d049dcaece0ecb6fc81a460da7bcc2a4785d6e520000000000000000x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x0d...0.271396821866231938898868198738940800.2804586217805511523845593360379658...quickstart1725071760False0x00000000000000000000000000000000000000000000...0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5False1724976000[Yes, No]Will the first floating offshore wind research...0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1...
\n", "

5 rows × 24 columns

\n", "
" ], "text/plain": [ " collateralAmount collateralAmountUSD \\\n", "0 450426474650738688 0.4504269694034145716308073094168006 \n", "1 610163214546941400 0.6101636232215150135654007337015298 \n", "2 789065092332460672 0.7890644120527324071908793822796086 \n", "3 1000000000000000000 1.000000605383660329048491794939126 \n", "4 100000000000000000 0.1000004271262862419547394646567906 \n", "\n", " collateralToken creationTimestamp \\\n", "0 0xe91d153e0b41518a2ce8dd3d7944fa863463a97d 1724553455 \n", "1 0xe91d153e0b41518a2ce8dd3d7944fa863463a97d 1724811940 \n", "2 0xe91d153e0b41518a2ce8dd3d7944fa863463a97d 1724815755 \n", "3 0xe91d153e0b41518a2ce8dd3d7944fa863463a97d 1724546620 \n", "4 0xe91d153e0b41518a2ce8dd3d7944fa863463a97d 1724771260 \n", "\n", " trader_address feeAmount \\\n", "0 0x022b36c50b85b8ae7addfb8a35d76c59d5814834 9008529493014773 \n", "1 0x034c4ad84f7ac6638bf19300d5bbe7d9b981e736 12203264290938828 \n", "2 0x09e9d42a029e8b0c2df3871709a762117a681d92 15781301846649213 \n", "3 0x09e9d42a029e8b0c2df3871709a762117a681d92 20000000000000000 \n", "4 0x0d049dcaece0ecb6fc81a460da7bcc2a4785d6e5 2000000000000000 \n", "\n", " id \\\n", "0 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x02... \n", "1 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x03... \n", "2 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x09... \n", "3 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x09... \n", "4 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f50x0d... \n", "\n", " oldOutcomeTokenMarginalPrice outcomeIndex \\\n", "0 0.592785210609610270634125335572129 1 \n", "1 0.842992636523755061934822129394812 1 \n", "2 0.7983775743712442891104598770339028 1 \n", "3 0.5110745907733438805447072252622708 1 \n", "4 0.2713968218662319388988681987389408 0 \n", "\n", " outcomeTokenMarginalPrice ... market_creator \\\n", "0 0.6171295391012242250994586583534301 ... quickstart \n", "1 0.8523396372892128845826889719620915 ... quickstart \n", "2 0.8152123711444691659642000374025623 ... quickstart \n", "3 0.5746805204222762335911904727318937 ... quickstart \n", "4 0.2804586217805511523845593360379658 ... quickstart \n", "\n", " fpmm.answerFinalizedTimestamp fpmm.arbitrationOccurred \\\n", "0 1725071760 False \n", "1 1725071760 False \n", "2 1725071760 False \n", "3 1725071760 False \n", "4 1725071760 False \n", "\n", " fpmm.currentAnswer \\\n", "0 0x00000000000000000000000000000000000000000000... \n", "1 0x00000000000000000000000000000000000000000000... \n", "2 0x00000000000000000000000000000000000000000000... \n", "3 0x00000000000000000000000000000000000000000000... \n", "4 0x00000000000000000000000000000000000000000000... \n", "\n", " fpmm.id fpmm.isPendingArbitration \\\n", "0 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5 False \n", "1 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5 False \n", "2 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5 False \n", "3 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5 False \n", "4 0x0017cd58d6a7ee1451388c7d5b1051b4c0a041f5 False \n", "\n", " fpmm.openingTimestamp fpmm.outcomes \\\n", "0 1724976000 [Yes, No] \n", "1 1724976000 [Yes, No] \n", "2 1724976000 [Yes, No] \n", "3 1724976000 [Yes, No] \n", "4 1724976000 [Yes, No] \n", "\n", " fpmm.title \\\n", "0 Will the first floating offshore wind research... \n", "1 Will the first floating offshore wind research... \n", "2 Will the first floating offshore wind research... \n", "3 Will the first floating offshore wind research... \n", "4 Will the first floating offshore wind research... \n", "\n", " fpmm.condition.id \n", "0 0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1... \n", "1 0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1... \n", "2 0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1... \n", "3 0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1... \n", "4 0x0e940f12f30e928e4879c52d065d9da739a3d3f020d1... \n", "\n", "[5 rows x 24 columns]" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "trades.head()" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 23455 entries, 0 to 23454\n", "Data columns (total 24 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 collateralAmount 23455 non-null object\n", " 1 collateralAmountUSD 23455 non-null object\n", " 2 collateralToken 23455 non-null object\n", " 3 creationTimestamp 23455 non-null object\n", " 4 trader_address 23455 non-null object\n", " 5 feeAmount 23455 non-null object\n", " 6 id 23455 non-null object\n", " 7 oldOutcomeTokenMarginalPrice 23455 non-null object\n", " 8 outcomeIndex 23455 non-null object\n", " 9 outcomeTokenMarginalPrice 23455 non-null object\n", " 10 outcomeTokensTraded 23455 non-null object\n", " 11 title 23455 non-null object\n", " 12 transactionHash 23455 non-null object\n", " 13 type 23455 non-null object\n", " 14 market_creator 23455 non-null object\n", " 15 fpmm.answerFinalizedTimestamp 21489 non-null object\n", " 16 fpmm.arbitrationOccurred 23455 non-null bool \n", " 17 fpmm.currentAnswer 21489 non-null object\n", " 18 fpmm.id 23455 non-null object\n", " 19 fpmm.isPendingArbitration 23455 non-null bool \n", " 20 fpmm.openingTimestamp 23455 non-null object\n", " 21 fpmm.outcomes 23455 non-null object\n", " 22 fpmm.title 23455 non-null object\n", " 23 fpmm.condition.id 23455 non-null object\n", "dtypes: bool(2), object(22)\n", "memory usage: 4.0+ MB\n" ] } ], "source": [ "trades.info()" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "market_creator\n", "quickstart 21852\n", "pearl 1603\n", "Name: count, dtype: int64" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "trades.market_creator.value_counts()" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [], "source": [ "fpmms_trades = pd.read_parquet('../data/fpmmTrades.parquet')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Adding market creator info" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "ERROR getting the market creator of 0xae7b042059b179dcac3169657fac111d7925f8dd\n", "ERROR getting the market creator of 0x347e4ef0ff34cf39d1c7e08bc07c68c41a4836d6\n", "ERROR getting the market creator of 0x8e03d3a7a3dfd930f73577ba4204deadf12b33f3\n", "ERROR getting the market creator of 0x2a0b461417fa0ae8bbeb28ed265fbe3944772435\n", "ERROR getting the market creator of 0x8069ea45a18910fa493a6a736438971b0e59ec9b\n", "ERROR getting the market creator of 0xdf91eac2a8573646c7e8e95c740877fe3d38f11f\n", "ERROR getting the market creator of 0x87f0fcfe810502555f8d1439793155cbfa2eb583\n", "ERROR getting the market creator of 0x7bcf0f480e52da1597d7437d5b4a4644b1e7ec23\n", "ERROR getting the market creator of 0xcfef6a50bd9439d1e1a15fcfe99068a57e533d95\n", "ERROR getting the market creator of 0xaeb8c31302361d42ec806faf406ef0c30b6eba5f\n", "ERROR getting the market creator of 0x9db7e7a0c82a229a7f3bb15046ff0c3a778b7291\n", "ERROR getting the market creator of 0x85c31bbeaab5468d97900e69d87a459aba997fa5\n", "ERROR getting the market creator of 0x36660fec571bb4d5849a433f9ec64622416f1dbb\n", "ERROR getting the market creator of 0x5ebe6dcb1ac4470bb71c89cf1e6b9abc48b637ba\n", "ERROR getting the market creator of 0xa0acfecc55465870c9baa7c954a0e81165fb112c\n", "ERROR getting the market creator of 0xd6d6951a8fa033f91a2227d75fb1eebc139e2e57\n", "ERROR getting the market creator of 0x651d04044b780e68f3f952796fb7c06fb0928ad2\n", "ERROR getting the market creator of 0xe271378e094db9d64e34c6c14a7492bcccd11dfb\n", "ERROR getting the market creator of 0x37c241945001f6c26c886c8d551cc2e6cf34c214\n", "ERROR getting the market creator of 0x20b9e32b17360310c633e5676f28430bd723f4bd\n", "ERROR getting the market creator of 0x06d873e7465a6680f5487905d7b5daf7f2c6e299\n", "ERROR getting the market creator of 0xd28b5e2f2ce950705354cd2ceaf4eab9d23db52b\n", "ERROR getting the market creator of 0x4d70e1ac779094e9790c8b74954d15729371e6bc\n", "ERROR getting the market creator of 0x81489c0eab196fb88704f08ef34b8a9ed7137c91\n", "ERROR getting the market creator of 0x223c99787f25179d51a9934a426b6d1b252bb4bd\n", "ERROR getting the market creator of 0xd61b2c4f70645c830bd5af76426d6b22af63c152\n", "ERROR getting the market creator of 0xe66e931f7b065361f56e41d61f599adab3b167c2\n", "ERROR getting the market creator of 0x5ccf21332df9af6195a5b1ba78d15562db915a35\n", "ERROR getting the market creator of 0xf8e68d9f66d2534df36c23db6770467da1c1ff1b\n", "ERROR getting the market creator of 0x2b9274ddf2213d8a6b2930a5b82801165df55017\n", "ERROR getting the market creator of 0xf9349c5ea0b5559abd8dfa6cdd4e4d5d913e1e61\n", "ERROR getting the market creator of 0xad8aa6f927bb6a38af8121418f1b64d4ed8be99c\n", "ERROR getting the market creator of 0x3dcc00904249d796a89943de15c85ac11afc5d66\n", "ERROR getting the market creator of 0x10ece1553b5017414388fe78f64720814d7f8799\n", "ERROR getting the market creator of 0x0930bcc328a695419d596dae380dec7fb43cd715\n", "ERROR getting the market creator of 0x956d8bbc930372482a361dec7e4707b15d8b02f4\n", "ERROR getting the market creator of 0x14da1cc12b382142ac3e2422162f122a0a31ec45\n", "ERROR getting the market creator of 0x28dd86a2c82ce02970eff7f4ea9ebde97750adc8\n", "ERROR getting the market creator of 0xb997d5e2fddf39b8a197715c7b200df612d74360\n", "ERROR getting the market creator of 0x2064ceecb78a382f4988d41f881abef89b6e785c\n", "ERROR getting the market creator of 0xe715cc8f264ab48f75bb1b5c11d7dbaf949d73c5\n", "ERROR getting the market creator of 0x5fc7213135962250147030c5dd30b84a80f2ad1e\n", "ERROR getting the market creator of 0x10ccffdc8e801ab4fda98371723cda4e30e6d672\n", "ERROR getting the market creator of 0x6e5d93fdcc14db02a58ace636c2dcff8db36039d\n", "ERROR getting the market creator of 0xf792f6a308525b72b5d47f12798668c140f5968e\n", "ERROR getting the market creator of 0x00897abcbbefe4f558956b7a9d1b7819677e4d90\n", "ERROR getting the market creator of 0x29448445959cc5045c03b7f316fa3332cc2b37b7\n", "ERROR getting the market creator of 0xdb8c2038cd17645216125f323048dcd4c9845826\n", "ERROR getting the market creator of 0x32969cce1791f13dc5d500b9e701ffb931baae03\n", "ERROR getting the market creator of 0x84aeb93d348c6da1ea4b0016c207aefc26edaa44\n", "ERROR getting the market creator of 0xdda87f7ec43aab7080e9ac23ae1550e5bc89d6cc\n", "ERROR getting the market creator of 0xafd80421ce35298d3698ca0f4008477a169c9ea2\n", "ERROR getting the market creator of 0xffc47cb1ecd41daae58e39fd4193d6fe9a6f5d2e\n", "ERROR getting the market creator of 0x351d430d229740f986ee240612c932c66188dd09\n", "ERROR getting the market creator of 0xd72455c8d5398a2b3b822bbc7cc0de638ea35519\n", "ERROR getting the market creator of 0x2c83cf4bb92e55e35b6e4af6eca6c0a85fb73650\n", "ERROR getting the market creator of 0xf2baf410b7d42d7572fb2f39cf216ffae8d4cafe\n", "ERROR getting the market creator of 0xb42a955a0e06b3e6bdf229c9abfd2fdad20688a7\n", "ERROR getting the market creator of 0x35021fcc0d15c4e87fc1c7fb527f389829dde3d9\n", "ERROR getting the market creator of 0xaa19120a9976c75dc569ab2cfcc087cd224db4e2\n", "ERROR getting the market creator of 0x6e79766698f58a25d2548b76601de9535c5080d3\n", "ERROR getting the market creator of 0x6915dcb7601802ea4a2dd840c44b6ed4473b5ce2\n", "ERROR getting the market creator of 0x6957f7ac4a0a09f237a901749e518a678d1a614a\n", "ERROR getting the market creator of 0x785a9d3329955ffd7cd24ca7a89ce2da21ac62da\n", "ERROR getting the market creator of 0x1e738f7e82102e2f56fef62df473d3f1f1dc53b1\n", "ERROR getting the market creator of 0x8e23b89649f22a6e8084b34a1a5de28d9ddf5a88\n", "ERROR getting the market creator of 0x31c6b19cae793ba90ee9c70263af773c27df2774\n", "ERROR getting the market creator of 0x3a2d7bf095988f30daf308b5484cd74903d82c22\n", "ERROR getting the market creator of 0xde10d01d4315cf64d9feeb79e9a593d78da8a50b\n", "ERROR getting the market creator of 0xa57b7f04bb813b5a6ded7cc92c5bd56586d8f7d4\n", "ERROR getting the market creator of 0x97609769fddc72ea9f45f62cef1f7a9658dd1efe\n", "ERROR getting the market creator of 0x7ddbfbebbec1635315f9217cbf9de8afd272c8de\n", "ERROR getting the market creator of 0x37cdc93194dc7f46f3cc377cf4350f56455a4f85\n", "ERROR getting the market creator of 0x75c10935141d740b71e1763aa6a3139643754655\n", "ERROR getting the market creator of 0x0f98789650877b1928960490a5a19769ac1c84b3\n", "ERROR getting the market creator of 0x9f87c202db8b3270406a3084817909a9d4afc6ea\n", "ERROR getting the market creator of 0x8cfb5af2b0287b34a423755d0481478f0a8f1356\n", "ERROR getting the market creator of 0x09244905029648aca18830291bb62634b04d9a46\n", "ERROR getting the market creator of 0x4e9a5580ce24dd06ed8d6b1d75a7ccce7abf7361\n", "ERROR getting the market creator of 0x8bbeb8a3e1f6fdc9e95aa0d7e80ebc6dc1468b7a\n", "ERROR getting the market creator of 0xcb279a4ebb3f0d78cb15817e942cc7aea01b8545\n", "ERROR getting the market creator of 0xb36fa15e34dd50b8199c57305573dc48d1271b50\n", "ERROR getting the market creator of 0x2198981fc1d8b3c61e7df9a50cf240708c057dfa\n", "ERROR getting the market creator of 0x37bab68f9ae4f9c7ce915d9e1f3404e7cd1794cc\n", "ERROR getting the market creator of 0x97f59586921ebdcfc07694ba8376f59871db11f9\n", "ERROR getting the market creator of 0xc79bf3f6370e8a8002a3093c379752f395a3c291\n", "ERROR getting the market creator of 0x178021f40d4e1ed270f2d2125f9f80d3e78a1836\n", "ERROR getting the market creator of 0xcca6ccde20a551caec29d6c1318f4f2ec7e6063c\n" ] } ], "source": [ "tools[\"market_creator\"] = \"\"\n", "# traverse the list of traders\n", "traders_list = list(tools.trader_address.unique())\n", "for trader_address in traders_list:\n", " market_creator = \"\"\n", " try:\n", " trades = fpmms_trades[fpmms_trades[\"trader_address\"] == trader_address]\n", " market_creator = trades.iloc[0][\"market_creator\"] # first value is enough\n", " except Exception:\n", " print(f\"ERROR getting the market creator of {trader_address}\")\n", " tools_of_the_trader = tools[tools[\"trader_address\"] == trader_address]\n", " # update\n", " tools.loc[tools[\"trader_address\"] == trader_address, \"market_creator\"] = market_creator" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "market_creator\n", "quickstart 121106\n", "pearl 12729\n", " 5182\n", "Name: count, dtype: int64" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tools.market_creator.value_counts()" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "139017" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(tools)" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.03727601660228605" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "5182/139017" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [], "source": [ "tools = tools.loc[tools[\"market_creator\"] != \"\"]\n", "tools.to_parquet(\"../data/tools.parquet\", index=False)" ] } ], "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 }