The simple model methodology to track insiders

Disclaimer All content and information on this website (the "Site") is for informational and educational purposes only, does not constitute financial, investment, legal, or tax advice, and is not an offer, solicitation, or recommendation to buy or sell any security, futures contract, or financial instrument. No Investment Advice The author of this Site is not a financial advisor. The information presented is not intended to be and does not constitute personalized investment advice. Any discussion of securities or markets is for illustrative purposes only. You are solely responsible for your own investment decisions. You should not make any financial, investment, legal, or tax decision based on any of the information provided on this Site without first consulting a qualified and licensed professional and conducting your own research and due diligence. Risk of Loss All trading and investing involve a substantial risk of loss. The assets and strategies discussed on this Site may not be suitable for all investors. You may lose all or more than your initial investment. Past performance is not indicative of future results. No Warranties The information on this Site is provided on an "as is" basis. We make no warranties or representations, express or implied, as to the accuracy, completeness, or timeliness of the information. We are not liable for any errors, omissions, or any losses, injuries, or damages arising from your use of this information. Any forward-looking statements or market predictions are speculative by nature and are not guarantees. Disclosure The author may hold, buy, or sell positions in any assets, securities, or financial instruments discussed on this Site at any time and without notice. Personal Opinions All views and opinions expressed herein are the author's own and do not represent the opinions of any entity whatsoever with which the author has been, is now, or will be affiliated.

1. The Market Library (Sheet2)

  • What it is: The "library" is the Google Sheet named Sheet2.

  • Its Purpose: It acts as a local database or an encyclopedia of every market that has ever closed on Polymarket.

  • What's Inside: It stores a list of markets. For each market, it saves the most important, unchanging facts:

    • The market's question.

    • Its unique ID (Market ID and Condition ID).

    • When it ended (End Date (ISO)).

    • The final result (Winning Outcome Index and Winning Outcome Name).

2. Script 1: market_library_builder.py

  • Purpose: This script's only job is to create and fill the library (Sheet2).

  • What it Does (Step-by-Step):

    1. It connects to your Google Sheet (Polyscraper) and opens the Sheet2 tab.

    2. It completely clears Sheet2 and writes new headers.

    3. It asks the Polymarket API for "the 100 most recent closed markets."

    4. It processes those 100 markets, saves their key info (ID, question, end date, winner), and writes them to Sheet2.

    5. It then asks the API for "the next 100 markets" and repeats the process.

    6. It continues doing this, 100 markets at a time, until the API says "no more markets found."

  • The Result: After running, Sheet2 is a complete historical database of all closed markets.

3. Script 2: poly_insider_analyzer.py

  • Purpose: This is the main "analysis" tool. It uses the library to find potential insider trading within a specific date range.

  • What it Does (Step-by-Step):

    1. Asks for a Date Range: It first prompts you to enter a START date and END date.

    2. Prepares Results Sheet: It opens Sheet1 (your results sheet) and clears it to prepare for a fresh report.

    3. Reads Library (Sheet2): It reads the entire market database you built in Sheet2 into its memory.

    4. Filters by Date: It loops through that large list in memory and creates a new, much smaller list containing only the markets that resolved within your specified date range.

    5. Analyzes Each Filtered Market: It then loops through that small, filtered list, one market at a time:

      • Fetches Trades: It makes a new API call to get the full trade history for that single market.

      • Calculates Baseline: It splits the trades into "historical" (all trades before the final 24 hours) and "final day" (all trades within the final 24 hours).

      • Finds Spikes: It uses the historical trades to calculate a "normal" volume baseline. It then checks if any "final day" trades were part of a statistically huge, abnormal volume spike.

    6. Reports to Sheet1: If (and only if) it finds a spike, it checks the winner from its library. If the spike was on the correct winning outcome, it writes the details of that market to Sheet1 as a Potential Insider Case.

How They Work Together

  • Script 1 (Builder) is the librarian. It builds the "encyclopedia" (Sheet2) of all past events. You run it once to gather all the data.

  • Script 2 (Analyzer) is the detective. It reads the encyclopedia (Sheet2), asks you which dates to investigate, and then does the deep "insider trading" analysis on only those markets, writing its findings to a new report (Sheet1).

Disclaimer All content and information on this website (the "Site") is for informational and educational purposes only, does not constitute financial, investment, legal, or tax advice, and is not an offer, solicitation, or recommendation to buy or sell any security, futures contract, or financial instrument. No Investment Advice The author of this Site is not a financial advisor. The information presented is not intended to be and does not constitute personalized investment advice. Any discussion of securities or markets is for illustrative purposes only. You are solely responsible for your own investment decisions. You should not make any financial, investment, legal, or tax decision based on any of the information provided on this Site without first consulting a qualified and licensed professional and conducting your own research and due diligence. Risk of Loss All trading and investing involve a substantial risk of loss. The assets and strategies discussed on this Site may not be suitable for all investors. You may lose all or more than your initial investment. Past performance is not indicative of future results. No Warranties The information on this Site is provided on an "as is" basis. We make no warranties or representations, express or implied, as to the accuracy, completeness, or timeliness of the information. We are not liable for any errors, omissions, or any losses, injuries, or damages arising from your use of this information. Any forward-looking statements or market predictions are speculative by nature and are not guarantees. Disclosure The author may hold, buy, or sell positions in any assets, securities, or financial instruments discussed on this Site at any time and without notice. Personal Opinions All views and opinions expressed herein are the author's own and do not represent the opinions of any entity whatsoever with which the author has been, is now, or will be affiliated.

Comments

Popular posts from this blog

CME vs Polymarket Arbitrage

Understanding how Polymarket works

Fed decision in December - Polymarket arbitrage